mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge branch 'master' of https://github.com/librenms/librenms into ifSpeed
This commit is contained in:
@@ -47,15 +47,18 @@ if ($rowCount != -1) {
|
||||
$sql .= " LIMIT $limit_low,$limit_high";
|
||||
}
|
||||
|
||||
$sql = "SELECT `S`.`schedule_id`, DATE_FORMAT(`S`.`start`, '".$config['dateformat']['mysql']['compact']."') AS `start`, DATE_FORMAT(`S`.`end`, '".$config['dateformat']['mysql']['compact']."') AS `end`, `S`.`title` $sql";
|
||||
$sql = "SELECT `S`.`schedule_id`, DATE_FORMAT(NOW(), '".$config['dateformat']['mysql']['compact']."') AS now, DATE_FORMAT(`S`.`start`, '".$config['dateformat']['mysql']['compact']."') AS `start`, DATE_FORMAT(`S`.`end`, '".$config['dateformat']['mysql']['compact']."') AS `end`, `S`.`title` $sql";
|
||||
|
||||
foreach (dbFetchRows($sql, $param) as $schedule) {
|
||||
$status = 0;
|
||||
if ($schedule['end'] < date('dS M Y H:i::s')) {
|
||||
$start = strtotime($schedule['start']);
|
||||
$end = strtotime($schedule['end']);
|
||||
$now = strtotime($schedule['now']);
|
||||
if ($end < $now) {
|
||||
$status = 1;
|
||||
}
|
||||
|
||||
if (date('dS M Y H:i::s') >= $schedule['start'] && date('dS M Y H:i::s') < $schedule['end']) {
|
||||
if ($now >= $start && $now < $end) {
|
||||
$status = 2;
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,11 @@ if (!empty($filter_hostname)) {
|
||||
$query .= ' && ';
|
||||
}
|
||||
$ip = gethostbyname($filter_hostname);
|
||||
$device = device_by_name($filter_hostname);
|
||||
$query .= 'source:"'.$filter_hostname.'" || source:"'.$ip.'"';
|
||||
if (isset($device['ip']) && $ip != $device['ip']) {
|
||||
$query .= ' || source:"'.$device['ip'].'"';
|
||||
}
|
||||
}
|
||||
|
||||
$graylog_url = $config['graylog']['server'] . ':' . $config['graylog']['port'] . '/search/universal/relative?query=' . urlencode($query) . '&range='. $filter_range . $extra_query;
|
||||
|
@@ -19,6 +19,10 @@ if (isset($searchPhrase) && !empty($searchPhrase)) {
|
||||
$sql .= " AND (hostname LIKE '%$searchPhrase%' OR last_polled LIKE '%$searchPhrase%' OR last_polled_timetaken LIKE '%$searchPhrase%')";
|
||||
}
|
||||
|
||||
if ($_POST['type'] == "unpolled") {
|
||||
$sql .= " AND `last_polled` <= DATE_ADD(NOW(), INTERVAL - 15 minute)";
|
||||
}
|
||||
|
||||
if (!isset($sort) || empty($sort)) {
|
||||
$sort = 'last_polled_timetaken DESC';
|
||||
}
|
||||
|
Reference in New Issue
Block a user