2013-09-05 Sergio Martin <sergio.martin@artica.es>

* godmode/agentes/module_manager.php
	godmode/agentes/configurar_agente.php: Change old counts
	of status by new way setting flags to be updated by 
	server



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8746 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-09-05 16:35:49 +00:00
parent 361ed9b69d
commit d2dd361397
3 changed files with 12 additions and 57 deletions

View File

@ -1,3 +1,10 @@
2013-09-05 Sergio Martin <sergio.martin@artica.es>
* godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php: Change old counts
of status by new way setting flags to be updated by
server
2013-09-05 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/module_manager_editor_plugin.php,

View File

@ -1172,36 +1172,10 @@ if ($delete_module) { // DELETE agent module !
$error++;
}
else {
// Update module status count
if ($module_data['estado'] == 0) {
// Set flag to update module status count
db_process_sql ('UPDATE tagente
SET normal_count=normal_count-1
WHERE id_agente=' . $module_data['id_agente']);
}
else if ($module_data['estado'] == 1) {
db_process_sql ('UPDATE tagente
SET critical_count=critical_count-1
WHERE id_agente=' . $module_data['id_agente']);
}
else if ($module_data['estado'] == 2) {
db_process_sql ('UPDATE tagente
SET warning_count=warning_count-1
WHERE id_agente=' . $module_data['id_agente']);
}
else if ($module_data['estado'] == 3) {
db_process_sql ('UPDATE tagente
SET unknown_count=unknown_count-1
WHERE id_agente=' . $module_data['id_agente']);
}
else if ($module_data['estado'] == 4) {
db_process_sql ('UPDATE tagente
SET notinit_count=notinit_count-1
WHERE id_agente=' . $module_data['id_agente']);
}
db_process_sql ('UPDATE tagente
SET total_count=total_count-1
WHERE id_agente=' . $module_data['id_agente']);
SET update_module_count = 1, update_alert_count = 1
WHERE id_agente = ' . $module_data['id_agente']);
}
$result = db_process_sql_delete('tagente_estado',

View File

@ -176,36 +176,10 @@ if ($multiple_delete) {
$error++;
}
else {
// Update module status count
// Set flag to update module status count
if ($module !== false) {
if ($module['estado'] == AGENT_MODULE_STATUS_NORMAL) {
db_process_sql ('UPDATE tagente
SET normal_count = normal_count - 1
WHERE id_agente=' . $module['id_agente']);
}
else if ($module['estado'] == AGENT_MODULE_STATUS_CRITICAL_BAD) {
db_process_sql ('UPDATE tagente
SET critical_count = critical_count - 1
WHERE id_agente=' . $module['id_agente']);
}
else if ($module['estado'] == AGENT_MODULE_STATUS_WARNING) {
db_process_sql ('UPDATE tagente
SET warning_count = warning_count - 1
WHERE id_agente=' . $module['id_agente']);
}
else if ($module['estado'] == AGENT_MODULE_STATUS_UNKNOWN) {
db_process_sql ('UPDATE tagente
SET unknown_count = unknown_count - 1
WHERE id_agente =' . $module['id_agente']);
}
else if ($module['estado'] == AGENT_MODULE_STATUS_NO_DATA) {
db_process_sql ('UPDATE tagente
SET notinit_count = notinit_count - 1
WHERE id_agente = ' . $module['id_agente']);
}
db_process_sql ('UPDATE tagente
SET total_count = total_count - 1
SET update_module_count = 1, update_alert_count = 1
WHERE id_agente = ' . $module['id_agente']);
}
}