mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
migrate from reprocessing syslog from sql to native sql injector. changes dateime to timestamp in database. will break existing syslog dates! ** BEWARE **
git-svn-id: http://www.observium.org/svn/observer/trunk@885 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+3
-7
@@ -65,15 +65,11 @@ function process_syslog ($entry, $update) {
|
||||
}
|
||||
}
|
||||
$x = "UPDATE `syslog` set `device_id` = '".$entry['device_id']."', `program` = '".$entry['program']."', `msg` = '" . mysql_real_escape_string($entry['msg']) . "', processed = '1' WHERE `seq` = '" . $entry['seq'] . "'";
|
||||
$entry['processed'] = 1;
|
||||
$x = "INSERT INTO `syslog` (`device_id`,`program`,`facility`,`priority`, `level`, `tag`, `msg`, `timestamp`) ";
|
||||
$x .= "VALUES ('".$entry['device_id']."','".$entry['program']."','".$entry['facility']."','".$entry['priority']."', '".$entry['level']."', '".$entry['tag']."', '".$entry['msg']."','".$entry['timestamp']."')";
|
||||
if($update) { mysql_query($x); }
|
||||
if(mysql_affected_rows() > "0") { shell_exec("echo written $x >> /tmp/syslog"); } else { echo(mysql_error()); }
|
||||
unset ($fix);
|
||||
} else {
|
||||
$x = "DELETE FROM `syslog` where `seq` = '" . $entry['seq'] . "'";
|
||||
if($update) { mysql_query($x);}
|
||||
|
||||
$entry['deleted'] = '1';
|
||||
|
||||
}
|
||||
|
||||
return $entry;
|
||||
|
||||
Reference in New Issue
Block a user