05-26-2021 10:55 AM
Cisco TAC does not support EEM. Below is the verbiage from the ticket. Can someone please assit?
My EEM script has parts that at are recycled from existing working scripts and part that I lifted from Cisco's website. Ultimately I want to send an email notification (from the working script) if the output in the "show sccp connection" contains the verbiage xcode. Right now I am testing it if a conference bridge is established (conf) and the script is not working. Once I get it working it will be used to see if a transcoder (xcode) is established. Attached to the ticket is the full CUBE config and version but this is the EEM script:
event manager environment _email_server 10.100.50.60
event manager environment _info_routername rtr01-liv-sbc@aaalife.com
event manager environment _email_from rtr01-liv-sbc@aaalife.com
event manager environment _email_to wan-outage@aaalife.com
event manager session cli username "netadmin"
event manager applet xcode_trace authorization bypass
event timer watchdog time 15
action 0001 cli command "enable"
action 0002 cli command "term exec prompt timestamp"
action 0003 cli command "term length 0"
action 0010 cli command "show sccp connection | in conf"
action 0020 regexp ".*(conf).*" "$_cli_result"
action 0030 if $_regexp_result ge "1"
action 0040 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Xcode established on rtr01-liv-sbc" body "$_cli_result"
action 0041 syslog msg "Xcode established alert has been sent to email server"
action 0042 cli command "exit"
action 0043 cli command "end"
This is the output of the show sccp connection when a conference bridge is established:
rtr01-liv-sbc#sh sccp conn
rtr01-liv-sbc#sh sccp connections
sess_id conn_id stype mode codec sport rport ripaddr conn_id_tx dtmf_method
33699121 33702041 conf sendrecv g711u 11486 21206 192.168.149.62 none
33699121 50432977 conf sendrecv g711u 11484 24802 192.168.149.62 none
33699121 33702039 conf sendrecv g711u 11482 26156 172.25.250.3 none
Total number of active session(s) 1, and connection(s) 3
Solved! Go to Solution.
05-26-2021 11:57 AM
Try using this in place of what your current policy has starting at 0030.
action 0030 if $_regexp_result eq "1"
action 0040 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Xcode established on rtr01-liv-sbc" body "$_cli_result"
action 0041 syslog msg "Xcode established alert has been sent to email server"
action 0042 else
action 0043 syslog msg "regex did not match"
action 0044 end
05-26-2021 11:57 AM
Try using this in place of what your current policy has starting at 0030.
action 0030 if $_regexp_result eq "1"
action 0040 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Xcode established on rtr01-liv-sbc" body "$_cli_result"
action 0041 syslog msg "Xcode established alert has been sent to email server"
action 0042 else
action 0043 syslog msg "regex did not match"
action 0044 end
05-26-2021 01:37 PM
That worked Daniel! Thank you.
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: