mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Updated discovery to log new type + updated eventlog page to show this
This commit is contained in:
@@ -20,6 +20,8 @@ var grid = $("#eventlog").bootgrid({
|
||||
{
|
||||
return {
|
||||
id: "eventlog",
|
||||
device: "' .mres($vars['device']) .'",
|
||||
type: "' .mres($vars['type']) .'",
|
||||
};
|
||||
},
|
||||
url: "/ajax_table.php"
|
||||
|
@@ -7,6 +7,11 @@ if (is_numeric($_POST['device'])) {
|
||||
$param[] = $_POST['device'];
|
||||
}
|
||||
|
||||
if (!empty($_POST['type'])) {
|
||||
$where .= ' AND `E`.`type` = ?';
|
||||
$param[] = $_POST['type'];
|
||||
}
|
||||
|
||||
if ($_POST['string']) {
|
||||
$where .= ' AND E.message LIKE ?';
|
||||
$param[] = '%'.$_POST['string'].'%';
|
||||
@@ -54,7 +59,7 @@ foreach (dbFetchRows($sql, $param) as $eventlog) {
|
||||
$type = '<b>'.generate_port_link($this_if, makeshortif(strtolower($this_if['label']))).'</b>';
|
||||
}
|
||||
else {
|
||||
$type = 'System';
|
||||
$type = $eventlog['type'];;
|
||||
}
|
||||
|
||||
$response[] = array(
|
||||
|
@@ -37,6 +37,25 @@ print_optionbar_start();
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<strong>Type: </strong>
|
||||
</label>
|
||||
<select name="type" id="type" class="form-control input-sm">
|
||||
<option value="">All types</option>
|
||||
<?php
|
||||
|
||||
foreach (dbFetchRows("SELECT `type` FROM `eventlog` GROUP BY `type`") as $types) {
|
||||
echo '<option value="'.$types['type'].'"';
|
||||
if ($types['type'] === $_POST['type']) {
|
||||
echo ' selected';
|
||||
}
|
||||
echo '>'.$types['type'].'</option>';
|
||||
}
|
||||
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-default input-sm">Filter</button>
|
||||
</form>
|
||||
|
||||
|
@@ -67,10 +67,10 @@ function discover_new_device($hostname, $device='', $method='', $interface='') {
|
||||
$extra_log = ' (port '.$int['label'].') ';
|
||||
}
|
||||
|
||||
log_event('Device $'.$remote_device['hostname']." ($ip) $extra_log autodiscovered through $method on ".$device['hostname'], $remote_device_id, 'system');
|
||||
log_event('Device $'.$remote_device['hostname']." ($ip) $extra_log autodiscovered through $method on ".$device['hostname'], $remote_device_id, 'discovery');
|
||||
}
|
||||
else {
|
||||
log_event("$method discovery of ".$remote_device['hostname']." ($ip) failed - check ping and SNMP access", $device['device_id'], 'system');
|
||||
log_event("$method discovery of ".$remote_device['hostname']." ($ip) failed - check ping and SNMP access", $device['device_id'], 'discovery');
|
||||
}
|
||||
|
||||
return $remote_device_id;
|
||||
|
Reference in New Issue
Block a user