2010-09-03 18:26:59 +00:00
|
|
|
#!/usr/bin/env php
|
2010-02-17 11:02:18 +00:00
|
|
|
<?php
|
|
|
|
|
2012-05-09 10:01:42 +00:00
|
|
|
/**
|
2016-09-08 14:12:23 +01:00
|
|
|
* LibreNMS
|
2012-05-09 10:01:42 +00:00
|
|
|
*
|
2016-09-08 14:12:23 +01:00
|
|
|
* This file is part of LibreNMS.
|
2012-05-09 10:01:42 +00:00
|
|
|
*
|
2016-09-08 14:12:23 +01:00
|
|
|
* @package LibreNMS
|
2013-10-28 12:01:36 -07:00
|
|
|
* @subpackage snmptraps
|
|
|
|
* @copyright (C) 2006 - 2012 Adam Armstrong
|
2018-08-11 23:37:45 +02:00
|
|
|
* @copyright (C) 2018 LibreNMS
|
|
|
|
* Adapted from old snmptrap.php handler
|
2012-05-09 10:01:42 +00:00
|
|
|
*/
|
|
|
|
|
2019-03-14 08:06:27 -05:00
|
|
|
$init_modules = [];
|
2016-11-21 14:12:59 -06:00
|
|
|
require __DIR__ . '/includes/init.php';
|
2010-02-17 11:02:18 +00:00
|
|
|
|
2018-07-13 17:08:00 -05:00
|
|
|
$options = getopt('d::');
|
|
|
|
|
|
|
|
if (set_debug(isset($options['d']))) {
|
|
|
|
echo "DEBUG!\n";
|
|
|
|
}
|
|
|
|
|
2018-08-11 23:37:45 +02:00
|
|
|
$text = stream_get_contents(STDIN);
|
2011-03-16 22:04:29 +00:00
|
|
|
|
2018-08-14 01:56:16 -05:00
|
|
|
// create handle and send it this trap
|
|
|
|
\LibreNMS\Snmptrap\Dispatcher::handle(new \LibreNMS\Snmptrap\Trap($text));
|