forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsyslog.php
executable file
·35 lines (30 loc) · 849 Bytes
/
syslog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env php
<?php
/**
* LibreNMS
*
* This file is part of LibreNMS.
*
* @package LibreNMS
* @subpackage syslog
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
chdir(__DIR__); // cwd to the directory containing this script
require 'includes/defaults.inc.php';
require 'config.php';
require 'includes/definitions.inc.php';
require_once 'includes/syslog.php';
require_once 'includes/dbFacile.php';
require_once 'includes/common.php';
require_once 'includes/functions.php';
$i = "1";
$s = fopen('php://stdin', 'r');
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++;
}