Changes

Jump to: navigation, search

Load balancing

438 bytes added, 09:33, 21 November 2012
Net-SNMP guide
Install the HALON-RELAYD-TRAP-MIB.txt file to your mibs/ folder.
Create a configuration file for snmptrap (snmptrapd.conf). Run whatever script/interpreter you prefer (eg. PHP).
authCommunity log,execute,net public
traphandle HALON-RELAYD-TRAP-MIB::relaydStateChange /usr/local/bin/php /mailopt/trap.php Start <tt>snmptrapd</tt>. Example <tt>trap.php</tt> script file.  <?php $result = array(); $result['host'] = fgets(STDIN); $result['ip'] = fgets(STDIN); while(!feof(STDIN)) { list($type, $value) = explode(' ', trim(fgets(STDIN)), 2); if ($type == "") break; $result[$type] = $value; }  file_put_contents(var_export($result, true), "/tmp/trap-output"); ?>

Navigation menu