mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Lots of additions.
git-svn-id: http://www.observium.org/svn/observer/trunk@108 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -4,11 +4,12 @@
|
||||
include("config.php");
|
||||
include("includes/functions.php");
|
||||
|
||||
if(!$enable_syslog) { exit(); }
|
||||
|
||||
$add = 0;
|
||||
$discard = 0;
|
||||
$total = 0;
|
||||
|
||||
|
||||
mysql_query("DELETE FROM `logs` WHERE `msg` LIKE '%Connection from UDP: [89.21.224.44]:%'");
|
||||
mysql_query("DELETE FROM `logs` WHERE `msg` LIKE '%Connection from UDP: [89.21.224.35]:%'");
|
||||
|
||||
@@ -26,7 +27,7 @@ while($l = mysql_fetch_array($q)){
|
||||
$host = $maybehost;
|
||||
} elseif($perhapshost) {
|
||||
$host = $perhapshost;
|
||||
}
|
||||
} else { `echo Failed log entry from $l[host] > /var/log/observer.log`; }
|
||||
|
||||
if($host) {
|
||||
|
||||
@@ -36,13 +37,10 @@ while($l = mysql_fetch_array($q)){
|
||||
$l[msg] = preg_replace("/^%(.+):\ /", "\\1||", $l[msg]);
|
||||
list($l[program], $l[msg]) = explode("||", $l[msg]);
|
||||
} else {
|
||||
|
||||
$l[msg] = preg_replace("/^" . $l[program] . ":\ /", "", $l[msg]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$x = "INSERT INTO syslog (`host` , `facility` , `priority` , `level` , `tag` , `datetime` , `program` , `msg` )";
|
||||
$x .= " VALUES ( '$host', '$l[facility]', '$l[priority]', '$l[level]', '$l[tag]', '$l[datetime]', '$l[program]', '$l[msg]' );";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user