forked from sseshachala/observium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsyslog.php
executable file
·37 lines (32 loc) · 896 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
36
37
#!/usr/bin/env php
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage syslog
* @author Adam Armstrong <[email protected]>
* @copyright (C) 2006 - 2012 Adam Armstrong
*
*/
include("includes/defaults.inc.php");
include("config.php");
include("includes/definitions.inc.php");
include("includes/syslog.php");
include("includes/dbFacile.php");
include("includes/common.php");
include("includes/functions.php");
$i = "1";
$s = fopen('php://stdin','r');
while ($line = fgets($s))
{
//logfile($line);
// host || facility || priority || level || tag || timestamp || msg || program
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++;
}
?>