catos support for syslog

git-svn-id: http://www.observium.org/svn/observer/trunk@2187 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-04-27 19:34:16 +00:00
parent 1d01f291f3
commit 238c8cf85a

View File

@ -36,7 +36,15 @@ function process_syslog ($entry, $update)
if ($entry['device_id'] && !$delete)
{
$os = mysql_result(mysql_query("SELECT `os` FROM `devices` WHERE `device_id` = '".$entry['device_id']."'"),0);
if ($os == "ios" || $os == "iosxe")
if ($os == 'catos')
{
$matches = array();
preg_match('#%(?P<program>[A-Z0-9\-_]*):(?P<msg>(.*))#', $entry['msg'], $matches);
$entry['msg'] = $matches['msg'];
$entry['program'] = $matches['program'];
unset($matches);
}
elseif ($os == "ios" || $os == "iosxe")
{
if (strstr($entry[msg], "%"))
{