2012-03-08 Koichiro Kikuchi <koichiro@rworks.jp>

* util/pandora_db.pl: Don't delete alerts if non-init/unknown
	 module to which these alerts assigned has not been deleted.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5716 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
koichirok 2012-03-08 06:35:48 +00:00
parent ec57fe6476
commit 82add0179d
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-03-08 Koichiro Kikuchi <koichiro@rworks.jp>
* util/pandora_db.pl: Don't delete alerts if non-init/unknown
module to which these alerts assigned has not been deleted.
2012-03-07 Sancho Lerena <slerena@artica.es>
* util/pandora_xml_stress.conf

View File

@ -447,7 +447,7 @@ sub pandora_checkdb_consistency {
db_do ($dbh, 'DELETE FROM tagente_modulo WHERE disabled = 0 AND id_agente_modulo = ?', $id_agente_modulo);;
# Delete any alerts associated to the module
db_do ($dbh, 'DELETE FROM talert_template_modules WHERE id_agent_module = ?', $id_agente_modulo);
db_do ($dbh, 'DELETE FROM talert_template_modules WHERE id_agent_module = ? AND NOT EXISTS (SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente_modulo = ?)', $id_agente_modulo, $id_agente_modulo);
}
print "[CHECKDB] Deleting unknown data (More than " . $conf{'_days_delete_unknown'} . " days)... \n";
@ -464,7 +464,7 @@ sub pandora_checkdb_consistency {
db_do ($dbh, 'DELETE FROM tagente_modulo WHERE disabled = 0 AND id_agente_modulo = ?', $id_agente_modulo);;
# Delete any alerts associated to the module
db_do ($dbh, 'DELETE FROM talert_template_modules WHERE id_agent_module = ?', $id_agente_modulo);
db_do ($dbh, 'DELETE FROM talert_template_modules WHERE id_agent_module = ? AND NOT EXISTS (SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente_modulo', $id_agente_modulo);
}
}
print "[CHECKDB] Checking database consistency (Missing status)... \n";