Great, after playing around I understand what your problem is and I have a solution.
What is going on is this, in Nagios you are seeing something like:
Code: Select all
sbdBagageStatus: device name - test-device, Connection status - 2, bagage status - 2 SQNI Raw: raw2 / enterprises.881.4.3.10.1.1.1.2 ():test-device enterprises.881.4.3.10.1.1.1.3 ():2 enterprises.881.4.3.10.1.1.1.11 ():2 enterprises.881.4.3.10.1.1.1.9 ():
Now this is happening because of the EXEC string:
Code: Select all
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "sbdBagageStatus: device name - $1, Connection status - $2, bagage status - $3 SQNI Raw: $4"
Specifically:
Which is this:
Code: Select all
enterprises.881.4.3.10.1.1.1.2 ():test-device enterprises.881.4.3.10.1.1.1.3 ():2 enterprises.881.4.3.10.1.1.1.11 ():2 enterprises.881.4.3.10.1.1.1.9 ():
snmptraphandling.py accepts the following format:
Code: Select all
<HOST> <SERVICE> <SEVERITY> <TIME> <PERFDATA> <DATA>
So $-* is being sent as the perfdata.
What is $-* ?
The
SNMPTT Documentation says:
$-* - Expand all variable-bindings in the format of variable name (variable type):value (see Note 2,3,5)
So basically you don't want this sent through. Simply change your EXEC line to:
Code: Select all
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "" "sbdBagageStatus: device name - $1, Connection status - $2, bagage status - $3 SQNI Raw: $4"
Now you are sending NO perfdata, but we still need to send nothing so we need the quotes "".
Restart snmptt and send another trap and you'll get something like:
Code: Select all
sbdBagageStatus: device name - test-device, Connection status - 1, bagage status - 1 SQNI Raw: raw1 /
One last thing you'll notice the / at the end. This is normally supposed to separate the "data" from the "performance data". Seeing as we're not sending any performance data then we don't need that /. A while ago I update the snmptraphandling.py script to fix this, please find attached.
snmptraphandling.zip
Once you replace the snmptraphandling.py script in /usr/local/bin/ you'll get the output:
Code: Select all
sbdBagageStatus: device name - test-device, Connection status - 1, bagage status - 1 SQNI Raw: raw1
I have previously reported this as a Feature Request and it is marked as being resolved and will be added in a future release, I'm just not sure when:
http://tracker.nagios.com/view.php?id=604
You do not have the required permissions to view the files attached to this post.