Files
librenms-librenms/snmptrap.php
T

26 lines
510 B
PHP
Raw Normal View History

2010-09-03 18:26:59 +00:00
#!/usr/bin/env php
<?php
/**
* LibreNMS
*
* This file is part of LibreNMS.
*
* @copyright (C) 2006 - 2012 Adam Armstrong
2018-08-11 23:37:45 +02:00
* @copyright (C) 2018 LibreNMS
* Adapted from old snmptrap.php handler
*/
2019-03-14 08:06:27 -05:00
$init_modules = [];
require __DIR__ . '/includes/init.php';
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));