mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
tidy up some more eventlog things (#5885)
* tidy up some more eventlog things * update sql file
This commit is contained in:
@@ -337,7 +337,7 @@ class Component
|
||||
$MSG .= $k." => ".$v.",";
|
||||
}
|
||||
$MSG = substr($MSG, 0, -1);
|
||||
log_event($MSG, $device_id, 'component', $COMPONENT);
|
||||
log_event($MSG, $device_id, 'component', 3, $COMPONENT);
|
||||
}
|
||||
|
||||
// Process our AVP Adds and Updates
|
||||
@@ -350,14 +350,14 @@ class Component
|
||||
dbInsert($DATA, 'component_prefs');
|
||||
|
||||
// Log the addition to the Eventlog.
|
||||
log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was added with value: " . $VALUE, $device_id, 'component', $COMPONENT);
|
||||
log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was added with value: " . $VALUE, $device_id, 'component', 3, $COMPONENT);
|
||||
} elseif ($OLD[$device_id][$COMPONENT][$ATTR] != $VALUE) {
|
||||
// Attribute exists but the value is different, need to update
|
||||
$DATA = array('value'=>$VALUE);
|
||||
dbUpdate($DATA, 'component_prefs', '`component` = ? AND `attribute` = ?', array($COMPONENT, $ATTR));
|
||||
|
||||
// Add the modification to the Eventlog.
|
||||
log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was modified from: " . $OLD[$COMPONENT][$ATTR] . ", to: " . $VALUE, $device_id, 'component', $COMPONENT);
|
||||
log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $ATTR . ", was modified from: " . $OLD[$COMPONENT][$ATTR] . ", to: " . $VALUE, $device_id, 'component', 3, $COMPONENT);
|
||||
}
|
||||
} // End Foreach AVP
|
||||
|
||||
@@ -368,7 +368,7 @@ class Component
|
||||
dbDelete('component_prefs', "`component` = ? AND `attribute` = ?", array($COMPONENT,$KEY));
|
||||
|
||||
// Log the addition to the Eventlog.
|
||||
log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $KEY . ", was deleted.", $COMPONENT);
|
||||
log_event("Component: " . $AVP[$COMPONENT]['type'] . "(" . $COMPONENT . "). Attribute: " . $KEY . ", was deleted.", 4, $COMPONENT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -32,10 +32,10 @@ if (!empty($ifName) && is_numeric($port_id) && is_numeric($port_id)) {
|
||||
$device = device_by_id_cache($device_id);
|
||||
if (is_array($speed)) {
|
||||
del_dev_attrib($device, 'ifSpeed:'.$ifName);
|
||||
log_event("$ifName Port speed cleared manually", $device, 'interface', $port_id);
|
||||
log_event("$ifName Port speed cleared manually", $device, 'interface', 3, $port_id);
|
||||
} else {
|
||||
set_dev_attrib($device, 'ifSpeed:'.$ifName, 1);
|
||||
log_event("$ifName Port speed set manually: $speed", $device, 'interface', $port_id);
|
||||
log_event("$ifName Port speed set manually: $speed", $device, 'interface', 3, $port_id);
|
||||
$port_tune = get_dev_attrib($device, 'ifName_tune:'.$ifName);
|
||||
$device_tune = get_dev_attrib($device, 'override_rrdtool_tune');
|
||||
if ($port_tune == "true" ||
|
||||
|
@@ -460,7 +460,7 @@ function check_valid_sensors($device, $class, $valid, $poller_type = 'snmp')
|
||||
|
||||
//end check_valid_sensors()
|
||||
|
||||
function discover_juniAtmVp(&$valid, $port_id, $vp_id, $vp_descr)
|
||||
function discover_juniAtmVp(&$valid, $device, $port_id, $vp_id, $vp_descr)
|
||||
{
|
||||
d_echo("Discover Juniper ATM VP: $port_id, $vp_id, $vp_descr\n");
|
||||
|
||||
@@ -469,7 +469,7 @@ function discover_juniAtmVp(&$valid, $port_id, $vp_id, $vp_descr)
|
||||
d_echo("( $inserted inserted )\n");
|
||||
|
||||
// FIXME vv no $device!
|
||||
log_event('Juniper ATM VP Added: port ' . mres($port_id) . ' vp ' . mres($vp_id) . ' descr' . mres($vp_descr), 'juniAtmVp', 3, $inserted);
|
||||
log_event('Juniper ATM VP Added: port ' . mres($port_id) . ' vp ' . mres($vp_id) . ' descr' . mres($vp_descr), $device, 'juniAtmVp', 3, $inserted);
|
||||
} else {
|
||||
echo '.';
|
||||
}
|
||||
|
@@ -1 +1,2 @@
|
||||
ALTER TABLE `eventlog` CHANGE `datetime` `datetime` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:01';
|
||||
ALTER TABLE `eventlog` ADD COLUMN `severity` INT(1) NULL DEFAULT 2 AFTER `reference`;
|
||||
|
1
sql-schema/164.sql
Normal file
1
sql-schema/164.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE `eventlog` CHANGE `datetime` `datetime` DATETIME NOT NULL DEFAULT '1970-01-01 00:00:01';
|
Reference in New Issue
Block a user