Files
librenms-librenms/syslog.php
T

29 lines
602 B
PHP
Raw Normal View History

2010-09-03 18:26:59 +00:00
#!/usr/bin/env php
<?php
2011-09-03 15:04:19 +00:00
/**
* LibreNMS
2011-09-03 15:04:19 +00:00
*
* This file is part of LibreNMS.
2011-09-03 15:04:19 +00:00
*
* @package LibreNMS
* @subpackage syslog
* @copyright (C) 2006 - 2012 Adam Armstrong
2011-09-03 15:04:19 +00:00
*
*/
$init_modules = array();
require __DIR__ . '/includes/init.php';
$i = "1";
2016-08-28 17:32:55 -05:00
$s = fopen('php://stdin', 'r');
2015-07-13 20:10:26 +02:00
while ($line = fgets($s)) {
#logfile($line);
list($entry['host'],$entry['facility'],$entry['priority'], $entry['level'], $entry['tag'], $entry['timestamp'], $entry['msg'], $entry['program']) = explode("||", trim($line));
process_syslog($entry, 1);
unset($entry);
unset($line);
$i++;
}