2010-09-03 20:26:59 +02:00
|
|
|
#!/usr/bin/env php
|
2010-02-17 12:02:18 +01:00
|
|
|
<?php
|
|
|
|
|
2012-05-09 12:01:42 +02:00
|
|
|
/**
|
2016-09-08 15:12:23 +02:00
|
|
|
* LibreNMS
|
2012-05-09 12:01:42 +02:00
|
|
|
*
|
2016-09-08 15:12:23 +02:00
|
|
|
* This file is part of LibreNMS.
|
2012-05-09 12:01:42 +02:00
|
|
|
*
|
2013-10-28 20:01:36 +01:00
|
|
|
* @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 12:01:42 +02:00
|
|
|
*/
|
2021-04-30 05:42:18 +02:00
|
|
|
|
|
|
|
use LibreNMS\Util\Debug;
|
|
|
|
|
2019-03-14 14:06:27 +01:00
|
|
|
$init_modules = [];
|
2016-11-21 21:12:59 +01:00
|
|
|
require __DIR__ . '/includes/init.php';
|
2010-02-17 12:02:18 +01:00
|
|
|
|
2018-07-14 00:08:00 +02:00
|
|
|
$options = getopt('d::');
|
|
|
|
|
2021-04-30 05:42:18 +02:00
|
|
|
if (Debug::set(isset($options['d']))) {
|
2018-07-14 00:08:00 +02:00
|
|
|
echo "DEBUG!\n";
|
|
|
|
}
|
|
|
|
|
2018-08-11 23:37:45 +02:00
|
|
|
$text = stream_get_contents(STDIN);
|
2011-03-16 23:04:29 +01:00
|
|
|
|
2018-08-14 08:56:16 +02:00
|
|
|
// create handle and send it this trap
|
|
|
|
\LibreNMS\Snmptrap\Dispatcher::handle(new \LibreNMS\Snmptrap\Trap($text));
|