08-28-2017 08:55 AM - edited 03-01-2019 06:05 PM
I would like to have access to the Mfg, Model and Serial number in my EEM applet but I did not find any default variables that store that information. One could use the "show ver" and parse the output but that seems like it could be a little messy but SNMP should be a reliable means to get that information.
However when I try to access the OID I keep getting "NO_SUCH_INSTANCE_EXCEPTION".
Are these not the correct OIDs?
1.3.6.1.2.1.47.1.1.1.1.11 = entPhysicalSerialNum
1.3.6.1.2.1.47.1.1.1.1.12 = entPhysicalMfgName
1.3.6.1.2.1.47.1.1.1.1.13 = entPhysicalModelName
My example test applet:
event manager applet test-snmp event none action 1 info type snmp oid 1.3.6.1.2.1.47.1.1.1.1.11 get-type exact action 2 syslog msg "Result is $_info_snmp_value"
08-28-2017 10:38 AM
Cisco IOS Software, C3750 Software (C3750-IPBASEK9-M), Version 12.2(55)SE11, RELEASE SOFTWARE (fc3)
08-29-2017 06:09 AM - edited 08-29-2017 06:30 AM
I am still working on this and testing primarily on 3750s and 3650s.
My first problem is that "show ver" has many locations that show the serial number and model number but each a little different. I wanted to always capture the "master" serial and model if the unit is in a stack. I think that this does that and also captures the full model number instead of the base model number.
Serial:
conf t no event manager applet test-serial event manager applet test-serial event none action 1.01 cli command "enable" action 1.02 set i 0 action 1.03 cli command "show ver | i ^System serial number" action 2.00 foreach line "$_cli_result" "\n" action 3.00 if $i eq 0 action 3.01 regexp "^System serial number\s*:\s*(.*)" $line match serial_num action 3.02 puts "$serial_num" action 4.00 end action 4.01 increment i 1 action 5.00 end exit end event manager run test-serial
Model:
conf t no event manager applet test-model event manager applet test-model event none action 1.01 cli command "enable" action 1.02 set i 0 action 1.03 cli command "show ver | i ^Model number" action 2.00 foreach line "$_cli_result" "\n" action 3.00 if $i eq 0 action 3.01 regexp "^Model number\s*:\s*(.*)" $line match model_num action 3.02 puts "$model_num" action 4.00 end action 4.01 increment i 1 action 5.00 end exit end event manager run test-model
[edit] I confirmed that the first entry is alway the master.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide