mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Changed to exlcude ok state + user configurable for resolution
This commit is contained in:
@ -19,11 +19,11 @@ if (isset($device['device_id']) && $device['device_id'] > 0) {
|
||||
}
|
||||
|
||||
if ($_SESSION['userlevel'] >= '5') {
|
||||
$query = "SELECT DATE_FORMAT(time_logged, '%Y-%m-%d %H:%i') Date, COUNT(alert_log.rule_id) totalCount, alert_rules.severity Severity FROM alert_log,alert_rules WHERE alert_log.rule_id=alert_rules.id $sql GROUP BY DATE_FORMAT(time_logged, '%Y-%m-%d %H:%i'),alert_rules.severity";
|
||||
$query = "SELECT DATE_FORMAT(time_logged, '".$config['alert_graph_date_format']."') Date, COUNT(alert_log.rule_id) totalCount, alert_rules.severity Severity FROM alert_log,alert_rules WHERE alert_log.rule_id=alert_rules.id AND `alert_log`.`state` != 0 $sql GROUP BY DATE_FORMAT(time_logged, '".$config['alert_graph_date_format']."'),alert_rules.severity";
|
||||
}
|
||||
|
||||
if ($_SESSION['userlevel'] < '5') {
|
||||
$query = "SELECT DATE_FORMAT(time_logged, '%Y-%m-%d %H:%i') Date, COUNT(alert_log.device_id) totalCount, alert_rules.severity Severity FROM alert_log,alert_rules,devices_perms WHERE alert_log.rule_id=alert_rules.id $sql AND alert_log.device_id = devices_perms.device_id AND devices_perms.user_id = " . $_SESSION['user_id'] . " GROUP BY DATE_FORMAT(time_logged, '%Y-%m-%d %H:%i'),alert_rules.severity";
|
||||
$query = "SELECT DATE_FORMAT(time_logged, '".$config['alert_graph_date_format']."') Date, COUNT(alert_log.device_id) totalCount, alert_rules.severity Severity FROM alert_log,alert_rules,devices_perms WHERE alert_log.rule_id=alert_rules.id AND `alert_log`.`state` != 0 $sql AND alert_log.device_id = devices_perms.device_id AND devices_perms.user_id = " . $_SESSION['user_id'] . " GROUP BY DATE_FORMAT(time_logged, '".$config['alert_graph_date_format']."'),alert_rules.severity";
|
||||
}
|
||||
|
||||
?>
|
||||
@ -86,7 +86,7 @@ echo $max_count; ?>
|
||||
}
|
||||
}
|
||||
},
|
||||
zoomMin: 2073600000, //24hrs
|
||||
zoomMin: <?php echo 86400; ?>, //24hrs
|
||||
zoomMax: <?php
|
||||
$first_date = reset($data);
|
||||
$last_date = end($data);
|
||||
|
@ -603,4 +603,7 @@ $config['distributed_poller_memcached_port'] = '11211';
|
||||
$config['callback_post'] = 'https://stats.librenms.org/log.php';
|
||||
$config['callback_clear'] = 'https://stats.librenms.org/clear.php';
|
||||
|
||||
// Stat graphs
|
||||
$config['alert_graph_date_format'] = '%Y-%m-%d %H:%i';
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user