Merge branch 'master' of https://github.com/librenms/librenms into ifSpeed

This commit is contained in:
laf
2016-06-30 09:49:35 +01:00
78 changed files with 552 additions and 221 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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';
}