2009-03-11 Esteban Sanchez <estebans@artica.es>
* include/functions_reporting.php: Fixed an error on get_group_stats() that gives wrong monitor status count because it was counting some modules twice. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1523 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
98a8c2c7fb
commit
df43c25f45
|
@ -1,3 +1,9 @@
|
|||
2009-03-11 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
* include/functions_reporting.php: Fixed an error on get_group_stats()
|
||||
that gives wrong monitor status count because it was counting some
|
||||
modules twice.
|
||||
|
||||
2009-03-10 Evi Vanoost <vanooste@rcbi.rochester.edu>
|
||||
|
||||
* include/functions_visual_map: Small fixes to render backgrounds with
|
||||
|
|
|
@ -127,8 +127,8 @@ function get_group_stats ($id_group = 0) {
|
|||
$data["monitor_checks"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter);
|
||||
$data["monitor_not_init"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND utimestamp = 0");
|
||||
$data["monitor_unknown"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND UNIX_TIMESTAMP() - utimestamp >= current_interval * 2");
|
||||
$data["monitor_critical"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND estado = 1");
|
||||
$data["monitor_warning"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND estado = 2");
|
||||
$data["monitor_critical"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND estado = 1 AND UNIX_TIMESTAMP() - utimestamp < current_interval * 2");
|
||||
$data["monitor_warning"] = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_estado WHERE ".$filter."AND estado = 2 AND UNIX_TIMESTAMP() - utimestamp < current_interval * 2");
|
||||
$data["monitor_ok"] = $data["monitor_checks"] - $data["monitor_not_init"] - $data["monitor_unknown"] - $data["monitor_critical"] - $data["monitor_warning"];
|
||||
|
||||
$sql = sprintf ("SELECT times_fired FROM talert_template_modules WHERE id_agent_module IN (%s)", implode (",", array_keys ($agents)));
|
||||
|
@ -169,6 +169,7 @@ function get_group_stats ($id_group = 0) {
|
|||
|
||||
*/
|
||||
if ($data["monitor_bad"] > 0 && $data["monitor_checks"] > 0) {
|
||||
echo $data["monitor_bad"].' / '.$data["monitor_checks"];
|
||||
$data["monitor_health"] = format_numeric (100 - ($data["monitor_bad"] / ($data["monitor_checks"] / 100)), 1);
|
||||
} else {
|
||||
$data["monitor_health"] = 100;
|
||||
|
|
Loading…
Reference in New Issue