02-18-2013 05:46 PM
We have a problem where the SCCP get stuck in 'UNKNOWN' / 'inactive' state. we run 'show sccp conn' command to check it manually. Looking for a script where we check for 'UNKNOWN' / 'inactive' sessions every hour, if there are 'n' number of sessions, then it would send out SNMP trap. Example output shown from 'sh sccp conn' command -
#sh sccp conn
sess_id conn_id stype mode codec sport rport ripaddr conn_id_tx
53645003 50656921 conf inactive UNKNOWN 31106 0 UNKNOWN
53667104 50665149 conf inactive UNKNOWN 16976 0 UNKNOWN
53671501 50666736 conf inactive UNKNOWN 32456 0 UNKNOWN
Total number of active session(s) 3, and connection(s) 3
Thanks in advance...totally new to EEM scripting.....
Solved! Go to Solution.
02-23-2013 09:43 AM
Okay, then you can do this using an applet.
event manager applet sccp_watch
event timer watchdog time 3600
action 1.0 cli command "enable"
action 2.0 cli command "show sccp conn"
action 3.0 set i 0
action 4.0 foreach line $_cli_result "\n"
action 4.1 regexp UNKNOWN $line
action 4.2 if $_regexp_result eq 1
action 4.3 increment i 1
action 4.4 end
action 4.5 end
action 4.6 subtract $i 2
action 4.7 if $_result ge N
action 4.8 snmp-trap strdata "The number of UNKNOWN SCCP sessions is $_result"
action 4.9 end
02-19-2013 12:53 PM
What version of code is your router running?
02-19-2013 02:28 PM
IOS is 15.1.M4
02-23-2013 09:43 AM
Okay, then you can do this using an applet.
event manager applet sccp_watch
event timer watchdog time 3600
action 1.0 cli command "enable"
action 2.0 cli command "show sccp conn"
action 3.0 set i 0
action 4.0 foreach line $_cli_result "\n"
action 4.1 regexp UNKNOWN $line
action 4.2 if $_regexp_result eq 1
action 4.3 increment i 1
action 4.4 end
action 4.5 end
action 4.6 subtract $i 2
action 4.7 if $_result ge N
action 4.8 snmp-trap strdata "The number of UNKNOWN SCCP sessions is $_result"
action 4.9 end
02-23-2013 07:40 PM
thanks Joseph, it works. The only difference I had to make was the following to match my requirements, thanks a lot to you and this forum.
event manager applet sccp_watch
event timer watchdog time 3600
action 1.0 cli command "enable"
action 2.0 cli command "show sccp conn"
action 3.0 set i 0
action 4.0 foreach line $_cli_result "\n"
action 4.1 regexp inactive $line
action 4.2 if $_regexp_result eq 1
action 4.3 increment i 1
action 4.4 end
action 4.5 end
action 4.6 if i ge N
action 4.7 snmp-trap strdata "The number of inactive SCCP sessions are $i"
action 4.8 end
02-24-2013 04:44 PM
I assume you also changed the 'N' in action 4.6 to the actual value of problem sessions, correct?
02-25-2013 05:49 PM
yes, that's right. N was changed to a value.
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