".__('Pandora Agents')." > "; echo __('Tactical view').""; $data = general_stats ($config['id_user'],-1); $monitor_checks = $data[0]; $monitor_ok = $data[1]; $monitor_bad = $data[2]; $monitor_unknown = $data[3]; $monitor_alert = $data[4]; $total_agents = $data[5]; $data_checks = $data[6]; $data_unknown = $data[7]; $data_alert = $data[8]; $data_alert_total = $data[9]; $monitor_alert_total = $data[10]; $data_not_init = $data[11]; $monitor_not_init = $data[12]; // Calculate global indicators $total_checks = $data_checks + $monitor_checks; if($total_checks != 0){ $notinit_percentage = (($data_not_init + $monitor_not_init) / ($total_checks / 100)); } else { $notinit_percentage = 0; } $module_sanity = format_numeric (100 - $notinit_percentage); $total_alerts = $data_alert + $monitor_alert; $total_fired_alerts = $monitor_alert_total+$data_alert_total; if ($total_fired_alerts > 0) $alert_level = format_numeric (100 - ($total_alerts / ($total_fired_alerts / 100))); else $alert_level = 100; if ($monitor_checks > 0){ $monitor_health = format_numeric ( 100- (($monitor_bad + $monitor_unknown) / ($monitor_checks/100)) , 1); } else $monitor_health = 100; if ($data_checks > 0){ $data_health = format_numeric ( (($data_checks -($data_unknown + $data_alert)) / $data_checks ) * 100,1);; } else $data_health = 100; if ($data_health < 0) $data_health =0; if (($data_checks != 0) OR ($data_checks != 0)){ $global_health = format_numeric ((($data_health * $data_checks) + ($monitor_health * $monitor_checks)) / $total_checks); } else $global_health = 100; if ($global_health < 0) $global_health; // Monitor checks // ~~~~~~~~~~~~~~~ echo ""; echo "
"; echo ""; // Summary echo ""; echo ""; echo ""; echo ""; // Monitor OK echo ""; echo ""; echo ""; // Monitor unknown echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
".__('Monitor health').""; echo "
"; echo "
".__('Data health').""; echo "
"; echo "
".__('Global health').""; echo "
"; echo "
".__('Module sanity').""; echo "
"; echo "
".__('Alert level').""; echo "
"; echo "

"; // Monitor checks echo "
".__('Monitor checks')."
".__('Monitor checks').""; echo ""; echo $monitor_checks."
".__('Monitor OK').""; echo ""; if ($monitor_ok > 0) echo $monitor_ok; else echo "-"; echo ""; // Monitor BAD echo "
".__('Monitor BAD').""; echo ""; if ($monitor_bad > 0) echo $monitor_bad; else echo "-"; echo ""; echo "
"; echo "".__('Monitor Unknown').""; echo ""; if ($monitor_unknown > 0) echo $monitor_unknown; else echo "-"; echo ""; echo "
".__('Monitor Not Init').""; if ($monitor_not_init> 0) echo $monitor_not_init; else echo "-"; echo "
".__('Alerts Fired').""; echo ""; if ($monitor_alert > 0) echo $monitor_alert; else echo "-"; echo ""; echo "
".__('Alerts Total')."".$monitor_alert_total; // Data checks // ~~~~~~~~~~~~~~~ echo "
".__('Data Checks')."
".__('Data Checks')."".$data_checks; echo "
".__('Data Unknown').""; if ($data_unknown > 0) echo $data_unknown; else echo "-"; echo "
".__('Data Not Init').""; if ($data_not_init > 0) echo $data_not_init; else echo "-"; echo "
".__('Alerts Fired').""; echo ""; if ($data_alert > 0) echo $data_alert; else echo "-"; echo ""; echo "
".__('Alerts Total'); echo "".$data_alert_total; // Summary // ~~~~~~~~~~~~~~~ echo "
".__('Summary')."
".__('Total Agents')."".$total_agents; echo "
".__('Total Checks')."".$total_checks; echo "
".__('Server Sanity').""; echo format_numeric($notinit_percentage); echo "% ".__('Uninitialized modules'); echo "
"; echo "
"; // Server information // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $total_modules = (int) get_db_sql ("SELECT COUNT(*) FROM tagente_modulo WHERE tagente_modulo.disabled = 0"); $sql='SELECT * FROM tserver'; $result=mysql_query($sql); if (mysql_num_rows($result)){ echo ""; echo "
"; echo __('Tactical server information'); echo "
".__('Name').""; echo "".__('Status').""; echo "".__('Load').""; echo "".__('Modules').""; echo "".__('LAG').""; $color=1; while ($row=mysql_fetch_array($result)){ if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } $id_server = $row["id_server"]; $name = $row["name"]; $address = $row["ip_address"]; $status = $row["status"]; $laststart = $row["laststart"]; $keepalive = $row["keepalive"]; $network_server = $row["network_server"]; $data_server = $row["data_server"]; $snmp_server = $row["snmp_server"]; $recon_server = $row["recon_server"]; $master = $row["master"]; $checksum = $row["checksum"]; $description = $row["description"]; $version = $row["version"]; $modules_server = 0; $serverinfo = server_status ($id_server); // Name of server echo "
"; echo $name; // Status echo ""; if ($status ==0){ echo ""; } else { echo ""; } // Load echo ""; if ($total_modules > 0) $percentil = $serverinfo["modules"] / ($total_modules / 100); else $percentil = 0; if ($percentil > 100) $percentil = 100; // Progress bar render echo ''; // Modules echo ""; echo $serverinfo["modules"] . " ".__('of')." ". $total_modules; // Lag echo ""; echo human_time_description_raw ($serverinfo["lag"]) . " / ". $serverinfo["module_lag"]; } echo '
'; // Event information smal_event_table ("", 10, 440); } echo "
"; ?>