Now modules without events in the last 24h it shows as green bar. Fixed time of data checks in events graph (agent general view).
This commit is contained in:
parent
48274bac6d
commit
d67af2d0f4
|
@ -507,13 +507,17 @@ if (!empty($network_interfaces)) {
|
||||||
$id_modules_array = array();
|
$id_modules_array = array();
|
||||||
$id_modules_array[] = $interface['status_module_id'];
|
$id_modules_array[] = $interface['status_module_id'];
|
||||||
|
|
||||||
|
$unixtime = get_system_time () - SECONDS_1DAY; //last hour
|
||||||
|
$time_condition = 'WHERE (te.utimestamp > '.$unixtime.')';
|
||||||
|
|
||||||
$sqlEvents = sprintf('
|
$sqlEvents = sprintf('
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM tevento te
|
FROM tevento te
|
||||||
INNER JOIN tagente_estado tae
|
INNER JOIN tagente_estado tae
|
||||||
ON te.id_agentmodule = tae.id_agente_modulo
|
ON te.id_agentmodule = tae.id_agente_modulo
|
||||||
AND tae.id_agente_modulo IN (%s)
|
AND tae.id_agente_modulo IN (%s)
|
||||||
', implode(',', $id_modules_array));
|
%s
|
||||||
|
', implode(',', $id_modules_array), $time_condition);
|
||||||
|
|
||||||
$sqlLast_contact = sprintf ('
|
$sqlLast_contact = sprintf ('
|
||||||
SELECT last_try
|
SELECT last_try
|
||||||
|
@ -527,8 +531,13 @@ if (!empty($network_interfaces)) {
|
||||||
|
|
||||||
$events = db_get_all_rows_sql ($sqlEvents);
|
$events = db_get_all_rows_sql ($sqlEvents);
|
||||||
$text_event_header = __('Events info (24hr.)');
|
$text_event_header = __('Events info (24hr.)');
|
||||||
|
if (!$events) {
|
||||||
|
$no_events = array('color' => array('criticity' => 2));
|
||||||
|
$e_graph = reporting_get_event_histogram ($no_events, $text_event_header);
|
||||||
|
}
|
||||||
|
else {
|
||||||
$e_graph = reporting_get_event_histogram ($events, $text_event_header);
|
$e_graph = reporting_get_event_histogram ($events, $text_event_header);
|
||||||
|
}
|
||||||
$data = array();
|
$data = array();
|
||||||
$data['interface_name'] = "<strong>" . $interface_name . "</strong>";
|
$data['interface_name'] = "<strong>" . $interface_name . "</strong>";
|
||||||
$data['interface_status'] = $interface['status_image'];
|
$data['interface_status'] = $interface['status_image'];
|
||||||
|
|
Loading…
Reference in New Issue