mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Eventlog updates (#9633)
* Eventlog updates remove host from eventlog table, retain in api allow most fields nullable * updated schema * revert auth for legacy log_event function safer check in the model * add function modifiers
This commit is contained in:
@@ -941,17 +941,15 @@ function log_event($text, $device = null, $type = null, $severity = 2, $referenc
|
||||
$device = device_by_id_cache($device);
|
||||
}
|
||||
|
||||
$insert = array('host' => ($device['device_id'] ?: 0),
|
||||
dbInsert([
|
||||
'device_id' => ($device['device_id'] ?: 0),
|
||||
'reference' => ($reference ?: "NULL"),
|
||||
'type' => ($type ?: "NULL"),
|
||||
'datetime' => array("NOW()"),
|
||||
'reference' => $reference,
|
||||
'type' => $type,
|
||||
'datetime' => \Carbon\Carbon::now(),
|
||||
'severity' => $severity,
|
||||
'message' => $text,
|
||||
'username' => isset(LegacyAuth::user()->username) ? LegacyAuth::user()->username : '',
|
||||
);
|
||||
|
||||
dbInsert($insert, 'eventlog');
|
||||
], 'eventlog');
|
||||
}
|
||||
|
||||
// Parse string with emails. Return array with email (as key) and name (as value)
|
||||
|
||||
Reference in New Issue
Block a user