2013-01-08 Miguel de Dios <miguel.dedios@artica.es>

* util/pandora_db.pl: fixed the SQL query for the checking modules
	status count.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7378 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-01-08 17:56:32 +00:00
parent 8417ad0c22
commit d4f7e9c254
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2013-01-08 Miguel de Dios <miguel.dedios@artica.es>
* util/pandora_db.pl: fixed the SQL query for the checking modules
status count.
2013-01-02 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* lib/PandoraFMS/Core.pm: Added macro _email_tag_ to replace with

View File

@ -91,11 +91,11 @@ sub pandora_purgedb ($$) {
# Numeric data deletion
print "[PURGE] Deleting old data... \n";
# This could be very timing consuming, so make this operation in $BIG_OPERATION_STEP
# steps (100 fixed by default)
# Starting from the oldest record on the table
$first_mark = get_db_value ($dbh, 'SELECT utimestamp FROM tagente_datos ORDER BY utimestamp ASC LIMIT 1');
if (defined ($first_mark)) {
$total_time = $ulimit_timestamp - $first_mark;
@ -569,7 +569,7 @@ sub pandora_checkdb_consistency {
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 disabled=0),
db_do ($dbh, 'UPDATE tagente SET normal_count=(SELECT COUNT(*) FROM tagente_estado WHERE id_agente=' . $id_agente . ' AND estado=0 AND disabled=0),
critical_count=(SELECT COUNT(*) FROM tagente_estado WHERE id_agente=' . $id_agente . ' AND estado=1 AND disabled=0),
warning_count=(SELECT COUNT(*) FROM tagente_estado WHERE id_agente=' . $id_agente . ' AND estado=2 AND disabled=0),
unknown_count=(SELECT COUNT(*) FROM tagente_estado WHERE id_agente=' . $id_agente . ' AND estado=3 AND disabled=0),