Re: passing format to traphandle
Terry <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On Nov 1, 2007 5:06 PM, Terry <[email protected]> wrote: > Hello, > > I want to pass the format2 output to traphandle somehow. Here is my > snmptrapd.conf: > > format1 "%B" > traphandle SNMPv2-SMI::enterprises.15538.1.4.0.100 /usr/bin/script $string > > I want $string to contain whatever the format1 is limiting. Is this possible? > I have some more information. Here is the mib I am including, or at least one part of it: dssslaportableRequest NOTIFICATION-TYPE STATUS current DESCRIPTION "DS-Client requested a Portable DS-System" ::= { dssslaTraps 3 } I want to pass on the description, "DS-Client requested a Portable DS-System" in this case, to my traphandle somehow. It does not appear to show up in VARBINDS. Any ideas on how to get this passed onto my traphandle? Here are the relevant parts of my configs: outputOption efqs doNotLogTraps yes traphandle default /usr/lib/nagios/eventhandlers/handle-trap In my trap handle, for debug purposes, I am just reading in everything and echoing it out to a file....ignore the methods used, just testing: read host echo $host >> /tmp/narf read ip echo $ip >> /tmp/narf read varbinds0 echo $varbinds0 >> /tmp/narf read varbinds1 echo $varbinds1 >> /tmp/narf read varbinds2 echo $varbinds2 >> /tmp/narf read varbinds3 echo $varbinds3 >> /tmp/narf read varbinds4 echo $varbinds4 >> /tmp/narf read varbinds5 echo $varbinds5 >> /tmp/narf read varbinds6 echo $varbinds6 >> /tmp/narf read varbinds7 echo $varbinds7 >> /tmp/narf read varbinds8 echo $varbinds8 >> /tmp/narf read varbinds9 echo $varbinds9 >> /tmp/narf read varbinds10 echo $varbinds10 >> /tmp/narf echo "" exit 0 Here is what I see in /tmp/narf: <UNKNOWN> UDP: [192.168.40.124]:21926 sysUpTimeInstance 122:19:30:12.50 snmpTrapOID.0 dssslaportableRequest dssslaportableRequest "(From system <foobar>)" snmpTrapAddress.0 192.168.40.124 snmpTrapCommunity.0 "public" Thanks for any help you can provide. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users