10-01-2013 05:55 PM
I ran into a wall with trying to figure this one out and hopefully someone can provide some insight. I am trying to send one snmp trap with multiple OID's using EEM. I've found two ways to do this but my main method isn't working.
Essentially, this is what I want.
event manager applet send-custom-trap
event none
action 1.0 info type snmp oid 1.3.6.1.2.1.31.1.1.1.18.1 get-type exact
action 2.0 info type snmp var vbinds oid 1.3.6.1.4.1.33333.2.0 string $_info_snmp_value
action 3.0 info type snmp oid 1.3.6.1.2.1.31.1.1.1.18.2 get-type exact
action 4.0 info type snmp var vbinds oid 1.3.6.1.4.1.33333.3.0 string $_info_snmp_value
action 5.0 info type snmp trap enterprise-oid 1.3.6.1.4.1.33333.1 generic-trapnum 6 specific-trapnum 1 trap-oid 1.3.6.1.4.1.9.33333.1.0.1 trap-var vbinds
The problem here is the string values of the snmp variable are not referencing the $_info_snmp_value variable. I also tried setting the value of these variables to another variable but still not working. Here's the output.
############# OUTPUT
R1#
sysUpTime.0 = 3007074
snmpTrapOID.0 = cisco.33333.1.0.1
enterprises.33333.2.0 = $_info_snmp_value
enterprises.33333.3.0 = scott
sysUpTime.0 = 3007074
snmpTrapOID.0 = cisco.33333.1.0.1
enterprises.33333.2.0 = $_info_snmp_value
enterprises.33333.3.0 = $_info_snmp_value
I can't seem to get the referenced OID value from the variable that I want. I know that $_info_snmp_value does have the correct data stored in it from this below config.
event manager applet send-custom-trap
event none
action 1.0 info type snmp oid 1.3.6.1.2.1.31.1.1.1.18.1 get-type exact
action 2.0 set oid1 $_info_snmp_value
action 3.0 info type snmp oid 1.3.6.1.2.1.31.1.1.1.18.2 get-type exact
action 4.0 set oid2 $_info_snmp_value
action 5.0 snmp-trap intdata1 0 intdata2 0 strdata "$oid1, $oid2"
############# OUTPUT
R1#
sysUpTime.0 = 2982412
snmpTrapOID.0 = cEventMgrMIB.0.2
ceemHistoryEventEntry.2.10 = 131
ceemHistoryEventEntry.3.10 = 0
ceemHistoryEventEntry.4.10 = 0
ceemHistoryEventEntry.5.10 = 0
ceemHistoryEventEntry.6.10 =
ceemHistoryEventEntry.7.10 = applet: send-custom-trap
ceemHistoryEventEntry.9.10 = 0
ceemHistoryEventEntry.10.10 = 0
ceemHistoryEventEntry.11.10 = F00000, F01
ceemHistoryEventEntry.13.10 = 0
ceemHistoryEventEntry.14.10 = 0
ceemHistoryEventEntry.15.10 = 0
ceemHistoryEventEntry.16.10 = 0
The problem with the second config is that my snmp trap manager doesn't parse the fields. If it did, i could take F00000 and F01 and send an email alert with this info formatted correctly. However, the manager can only take the field data and present it as whole, so I would be sending "F00000, F01". The first config set can send the data in multiple fields but just can't get the actual OID value.
I just can't seem to get the right combination with these two, or rather the first config set to reference the snmp get values. Thoughts?
Solved! Go to Solution.
10-02-2013 06:54 AM
For what you want to do, you'll need to use Tcl. Unfortunately, the applet code does not look at the values of the varbinds as a variable exapnsion field, so any variable syntax is passed as-is. However, if you conver this same applet to Tcl using http://www.marcuscom.com/convert_applet , it will work.
10-02-2013 06:54 AM
For what you want to do, you'll need to use Tcl. Unfortunately, the applet code does not look at the values of the varbinds as a variable exapnsion field, so any variable syntax is passed as-is. However, if you conver this same applet to Tcl using http://www.marcuscom.com/convert_applet , it will work.
10-02-2013 06:13 PM
Thanks Joseph!
That conversion script reduced my learning curve on TCL dramatically. Not only do I have the data I want now, I'm doing a bunch more with it too. Much thanks!
Scott
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: