2012-11-15 Ramon Novoa <rnovoa@artica.es>

* util/pandora_db.pl: Try to update module status count for all agents.
	  Further performance tests need to be done.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7149 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2012-11-15 15:13:13 +00:00
parent c13a86afe8
commit 42ad30cf11
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-11-15 Ramon Novoa <rnovoa@artica.es>
* util/pandora_db.pl: Try to update module status count for all agents.
Further performance tests need to be done.
2012-11-14 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm,

View File

@ -533,7 +533,9 @@ sub pandora_checkdb_consistency {
}
print "[CHECKDB] Checking module status count... \n";
my @agents = get_db_rows ($dbh, 'SELECT id_agente FROM tagente WHERE normal_count+warning_count+critical_count+unknown_count+notinit_count<>total_count');
#my @agents = get_db_rows ($dbh, 'SELECT id_agente FROM tagente WHERE normal_count+warning_count+critical_count+unknown_count+notinit_count<>total_count');
# Try to update module status count for all agents. Further performance tests need to be done.
my @agents = get_db_rows ($dbh, 'SELECT id_agente FROM tagente');
foreach my $agent (@agents) {
my $id_agente = $agent->{'id_agente'};
db_do ($dbh, 'UPDATE tagente SET normal_count=(SELECT COUNT(*) FROM tagente_estado WHERE id_agente=' . $id_agente . ' AND estado=0 AND utimestamp<>0),