Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Serial down message timers

              I have a router that has a 3G backup VPN, and am trying to setup it to send a text when the primary circuit fails.

I realize it has some shortcomings in that it doesn't check if the cell connection is up or anything. But want I'm looking for is a way to avoid the situation of a million text messages if the primary connection is flapping. I see there are a number of timers, I'm not sure which is most appropriate. Is there a way for it to only send the message say no more than every 30 minutes?

Thanks in advance for the help

Here is my current script.

event manager applet track_Serial_down
event track 1 state down
action 1 syslog msg "EEM applet track_Serial_down sending messag"
action 2 cli command "enable"
action 3 cli command "cellular 0/1/0 cdma sms send xxxxxx 'text message down'"

event manager applet track_Serial_up
event track 1 state up
action 1 syslog msg "EEM applet track_Serial_up Sending message"
action 2 cli command "enable"
action 3 cli command "cellular 0/1/0 cdma sms send xxxxxxxx 'tex message up'"
!
end

  • EEM Scripting
6 REPLIES
Cisco Employee

Serial down message timers

You could have the down applet reconfigure itself so the event is none.  Then have it reconfigure a third applet to rearm it after a certain amount of time.  The same could be done for the up applet:

event manager applet track_Serial_down

action 3.1 cli command "config t"

action 3.2 cli command "event manager applet track_Serial_down"

action 3.3 cli command "event none"

action 3.4 cli command "event manager applet timer_down"

action 3.5 cli command "event timer countdown time 1800"

action 3.6 cli command "end"

!

event manager applet track_Serial_up

action 3.1 cli command "config t"

action 3.2 cli command "event manager applet track_Serial_up"

action 3.3 cli command "event none"

action 3.4 cli command "event manager applet timer_up"

action 3.5 cli command "event timer countdown time 1800"

action 3.6 cli command "end"

!

event manager applet timer_down

event none

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "event manager applet track_Serial_down"

action 4.0 cli command "event track 1 state down"

action 5.0 cli command "event manager applet timer_down"

action 6.0 cli command "event none"

action 7.0 cli command "end"

!

event manager applet timer_up

event none

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "event manager applet track_Serial_up"

action 4.0 cli command "event track 1 state up"

action 5.0 cli command "event manager applet timer_up"

action 6.0 cli command "event none"

action 7.0 cli command "end"

New Member

Serial down message timers

Thanks for the help Joesph. I set it up as below.(which I think is right). What happened was the message events would fire once. The parts of the script that set the countdown time would not set. lines 3.6 and 3.7. I inserted the end and config t to see if that made difference it didn't. In the debug it puts out a message for the line 3.6 but nothing for 3.7. Not sure if it is running it or not.

event manager applet track_Serial_down
event track 1 state down
action 1 syslog msg "EEM applet track_Serial_down sending messag"
action 2 cli command "enable"
action 3 cli command "cellular 0/1/0 cdma sms send 111111111 'message'"
action 3.1 cli command "config t"
action 3.2 cli command "event manager applet track_Serial_down"
action 3.3 cli command "event none"
action 3.4 cli command "end"
action 3.5 cli command "config t"
action 3.6 cli command "event manager applet timer_down"
action 3.7 cli command "event timer countdown time 300"
action 3.8 cli command "end"
!

event manager applet track_Serial_up
event track 1 state up
action 1 syslog msg "EEM applet track_Serial_up Sending message"
action 2 cli command "enable"
action 3 cli command "cellular 0/1/0 cdma sms send 1111111111 'message'"
action 3.1 cli command "config t"
action 3.2 cli command "event manager applet track_Serial_up"
action 3.3 cli command "event none"
action 3.4 cli command "end"
action 3.5 cli command "config t"
action 3.6 cli command "event manager applet timer_up"
action 3.7 cli command "event timer countdown time 300"
action 3.8 cli command "end"

event manager applet timer_down
event none
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet track_Serial_down"
action 4.0 cli command "event track 1 state down"
action 5.0 cli command "event manager applet timer_down"
action 6.0 cli command "event none"
action 7.0 cli command "end"
!
event manager applet timer_up
event none
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet track_Serial_up"
action 4.0 cli command "event track 1 state up"
action 5.0 cli command "event manager applet timer_up"
action 6.0 cli command "event none"
action 7.0 cli command "end"

Cisco Employee

Serial down message timers

Can you post the debug output from "debug event manager action cli" showing one of the track applets running?

New Member

Serial down message timers


Before

event manager applet track_Serial_down
event track 1 state down
action 1 syslog msg "EEM applet track_Serial_down sending messag"
action 2 cli command "enable"
action 3 cli command "cellular 0/1/0 cdma sms send 1111111111 'Site  MPLS Down on Cell modem'"
action 3.1 cli command "config t"
action 3.2 cli command "event manager applet track_Serial_down"
action 3.3 cli command "event none"
action 3.6 cli command "event manager applet timer_down"
action 3.7 cli command "event timer countdown time 300"
action 3.8 cli command "end"
!

event manager applet track_Serial_up
event track 1 state up
action 1 syslog msg "EEM applet track_Serial_up Sending message"
action 2 cli command "enable"
action 3 cli command "cellular 0/1/0 cdma sms send 1111111111 'Site  back on MPLS'"
action 3.1 cli command "config t"
action 3.2 cli command "event manager applet track_Serial_up"
action 3.3 cli command "event none"
action 3.6 cli command "event manager applet timer_up"
action 3.7 cli command "event timer countdown time 300"
action 3.8 cli command "end"

event manager applet timer_down
event none
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet track_Serial_down"
action 4.0 cli command "event track 1 state down"
action 5.0 cli command "event manager applet timer_down"
action 6.0 cli command "event none"
action 7.0 cli command "end"
!
event manager applet timer_up
event none
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet track_Serial_up"
action 4.0 cli command "event track 1 state up"
action 5.0 cli command "event manager applet timer_up"
action 6.0 cli command "event none"
action 7.0 cli command "end"


after

scheduler allocate 20000 1000
ntp server 10.32.161.245 prefer
event manager applet track_Serial_down
event none
action 1   syslog msg "EEM applet track_Serial_down sending messag"
action 2   cli command "enable"
action 3   cli command "cellular 0/1/0 cdma sms send 1111111111 'Site  MPLS Down on Cell modem'"
action 3.1 cli command "config t"
action 3.2 cli command "event manager applet track_Serial_down"
action 3.3 cli command "event none"
action 3.6 cli command "event manager applet timer_down"
action 3.7 cli command "event timer countdown time 300"
action 3.8 cli command "end"
event manager applet track_Serial_up
event track 1 state up
action 1   syslog msg "EEM applet track_Serial_up Sending message"
action 2   cli command "enable"
action 3   cli command "cellular 0/1/0 cdma sms send 1111111111 'Site  back on MPLS'"
action 3.1 cli command "config t"
action 3.2 cli command "event manager applet track_Serial_up"
action 3.3 cli command "event none"
action 3.6 cli command "event manager applet timer_up"
action 3.7 cli command "event timer countdown time 300"
action 3.8 cli command "end"
event manager applet timer_down
event none
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet track_Serial_down"
action 4.0 cli command "event track 1 state down"
action 5.0 cli command "event manager applet timer_down"
action 6.0 cli command "event none"
action 7.0 cli command "end"
event manager applet timer_up
event none
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet track_Serial_up"
action 4.0 cli command "event track 1 state up"
action 5.0 cli command "event manager applet timer_up"
action 6.0 cli command "event none"
action 7.0 cli command "end"
!
end

debug

router#
router#
router#
Oct 25 11:58:27.851: %CONTROLLER-5-UPDOWN: Controller T1 0/0/0, changed state to      
administratively down
Oct 25 11:58:28.787: %TRACKING-5-STATE: 1 interface Se0/0/0:0 line-protocol Up->     
Down
Oct 25 11:58:28.787: %HA_EM-6-LOG: track_Serial_down: EEM applet track_Serial_do     
wn sending messag
Oct 25 11:58:28.787: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : CTL :      
cli_open called.
Oct 25 11:58:28.795: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Oct 25 11:58:28.795: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
! WARNING: All changes are logged and must be cleared through    !
Oct 25 11:58:28.795: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
! Network Engineering Services and Change Authorization Board.  !
Oct 25 11:58:28.795: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
! Failure to do so can result in immediate termination.          !
Oct 25 11:58:28.795: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Oct 25 11:58:28.795: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :
Oct 25 11:58:28.795: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
router>
Oct 25 11:58:28.795: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : IN  :      
router>enable
Oct 25 11:58:28.807: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
router#
Oct 25 11:58:28.807: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : IN  :      
router#cellular 0/1/0 cdma sms send 1111111111 'Site MPL     
S Down on Cell modem'
Oct 25 11:58:28.967: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
router#
Oct 25 11:58:28.967: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : IN  :      
router#config t
Oct 25 11:58:28.979: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
Enter configuration commands, one per line.  End with CNTL/Z.
Oct 25 11:58:28.979: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
router(config)#
Oct 25 11:58:28.979: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : IN  :      
router(config)#event manager applet track_Serial_down
Oct 25 11:58:28.991: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
router(config-applet)#
Oct 25 11:58:28.991: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : IN  :      
router(config-applet)#event none
Oct 25 11:58:29.003: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : OUT :      
router(config-applet)#
Oct 25 11:58:29.003: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : IN  :      
router(config-applet)#event manager applet timer_down
Oct 25 11:58:29.015: %HA_EM-6-LOG: track_Serial_down : DEBUG(cli_lib) : : CTL :      
cli_close called.
Oct 25 11:58:29.015: tty is now going through its death sequence
Oct 25 11:58:29.847: %LINK-3-UPDOWN: Interface Serial0/0/0:0, changed state to d     
own
Oct 25 11:58:30.847: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0     
:0, changed state to down
Oct 25 11:58:31.123: %CELLWAN-2-SMS_ARCH_PATH_UNCONFIGURED: Cellular0/1/0 failed      
to archive SMS because 'gsm|cdma sms archive path' under cellular controller is      
not configured.
Oct 25 11:58:31.123: %CELLWAN-5-OUTGOING_SMS_SENT: Cellular0/1/0 has just sent a     
n outgoing SMS successfully.
router#
Oct 25 11:59:18.591: %SYS-5-CONFIG_I: Configured from console by vty0 (10.36.180.1)
router#show clock
11:59:34.687 UTC Fri Oct 25 2013
router#show clock
12:00:54.551 UTC Fri Oct 25 2013
router#show clock
12:01:44.095 UTC Fri Oct 25 2013
router#show clock
12:03:34.003 UTC Fri Oct 25 2013
router#sh run

Cisco Employee

Serial down message timers

Reverse the actions so that you reconfigure the other applet first:

action 3.2 cli command "event manager applet timer_up"

action 3.3 cli command "event timer countdown time 300"

action 3.6 cli command "event manager applet track_Serial_up"

action 3.7 cli command "event none"

Follow this same approach for the other applets, too.

New Member

Serial down message timers

That did the trick. Thanks a million for the help.

I'm wondering if using an  IPSLA to generate the message would be cleaner. The issue I noticed is after circuits flapping the last message sent doesn't reflect the state of the circuit. like for example if it goes down up down (within the timer) then the second down message won't be sent, (which is by design i know), but I can see that as a problem in that the people getting the message won't know the status.

Maybe using an IPSLA to check if the circuit is up would be cleaner. I'll check that out.. and come back if I can't figure it out.

999
Views
0
Helpful
6
Replies