06-12-2013 01:44 AM
i'm trying to build an applet that will reset modem (819 , 888 , 1841 ) routers every 1 hr when the track reachability is down
i wrote that
event manager applet RESET_MODEM
event track 100 state down
event timer watchdog time 3600
action 1.0 cli command "enable"
action 2.0 cli command "test cellular X modem-power-cycle"
action 3.0 syslog priority informational msg " ******* MODEM RESET SUCCESSFULLY ******* "
the problem is that router don't apply watch dog event with track state event i.e only one is applied !!
plz help
06-12-2013 08:50 AM
The way you've written this only one event will ever take precedence (the last one configured). I'm not sure what you're trying to achieve really. Do you want the modem to only reset if it's connectivity has been down for an hour? What version of code is this router running?
06-12-2013 09:00 AM
I want to reset the modem when reachability is DOWN and if it remains DOWN it will reset after one hour as some times reachability still down after resetting so i don't want to repeat that action as it will be a headache on the router
Sent from Cisco Technical Support iPhone App
06-12-2013 09:02 AM
Regarding the running code , do you mean IOS version ?
Sent from Cisco Technical Support iPhone App
06-12-2013 09:03 AM
Yes, I mean IOS version.
06-12-2013 09:15 AM
c800-universalk9-mz.SPA.151-4.M2.bin
Sent from Cisco Technical Support iPhone App
06-12-2013 09:25 AM
Then you could do:
event manager environment q "
!
event manager applet TRACK_MODEM_DOWN
event track 100 state down
action 001 cli command "enable"
action 002 cli command "config t"
action 003 cli command "event manager applet REST_MODEM"
action 004 cli command "event timer watchdog time 3600"
action 005 cli command "action 1.0 cli command enable"
action 006 cli command "action 2.0 cli command $q test cellular X modem-power-cycle$q"
action 007 cli command "action 3.0 syslog priority info msg $q ******* MODEM RESET SUCCESSFULLY ******* $q"
action 008 cli command "action 4.0 cli command $q config t$q"
action 009 cli command "action 5.0 cli command $q no event manager applet RESET_MODEM$q"
action 010 cli command "action 6.0 cli command end"
!
event manager applet TRACK_MODEM_UP
event track 100 state up
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "no event manager applet RESET_MODEM"
action 4.0 cli command "end"
06-12-2013 09:31 AM
WOW !
I'll try it and feed you back ASAP
Thank you :)
Sent from Cisco Technical Support iPhone App
06-14-2013 09:34 AM
i faced a problem while applying it !
Jun 14 18:21:31.162 EGY: EM: No consumer registered for any event type
P.S
i uswd the below commnad too
event manager session cli username "USER NAME"
06-14-2013 05:35 PM
At what point exactly did you get this message?
06-14-2013 07:45 PM
From starting point !!
Sent from Cisco Technical Support iPhone App
06-15-2013 07:52 AM
Does that mean the moment you pasted in the command:
event manager environment q "
You got this error? Post your entire running config.
06-15-2013 07:54 AM
Yes !
I got this message while DEBUG is activated
Sent from Cisco Technical Support iPhone App
06-16-2013 02:30 AM
Building configuration...
Current configuration : 13564 bytes
!
! Last configuration change at 11:26:27 EGY Sun Jun 16 2013 by allmalia
version 15.1
no service pad
service tcp-keepalives-in
service tcp-keepalives-out
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
service internal
service sequence-numbers
!
hostname ATM47
!
boot-start-marker
boot-end-marker
!
!
security authentication failure rate 3 log
security passwords min-length 6
logging count
no logging buffered
--More--
000173: .Jun 16 11:27:50.860 EGY: EM: No consumer registered for any event type
enable secret 5 $1$MHOf$popdGdIXbwizPq5HElrdH/
!
aaa new-model
!
!
aaa group server tacacs+ ACS
server-private 10.40.0.100 key 7 115A3923561C2B02272F2C747F
ip tacacs source-interface Loopback0
!
aaa group server tacacs+ ACS-Backup
server-private 10.40.0.50 key 7 101D293F441932052F012D7B73687375
ip tacacs source-interface Loopback0
!
aaa authentication login default group ACS group ACS-Backup local
aaa authorization exec default group ACS group ACS-Backup none
aaa authorization commands 0 default group ACS group ACS-Backup none
aaa authorization commands 15 default group ACS group ACS-Backup none
aaa accounting commands 0 default
action-type start-stop
group ACS
group ACS-Backup
!
aaa accounting commands 15 default
action-type start-stop
group ACS
group ACS-Backup
!
!
!
!
!
!
aaa session-id common
!
memory-size iomem 10
clock timezone EGY 2 0
crypto pki token default removal timeout 0
!
crypto pki trustpoint TP-self-signed-3598259383
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-3598259383
revocation-check none
rsakeypair TP-self-signed-3598259383
!
!
no ip source-route
no ip gratuitous-arps
ip cef
!
!
!
!
!
no ip bootp server
no ip domain lookup
ip domain name efinance.com.eg
ip inspect WAAS flush-timeout 10
no ipv6 cef
!
!
multilink bundle-name authenticated
chat-script modem "" "AT+IPR=9600" timeout 5 ok "at&w" timout 5 ok
chat-script tmobile5 "" "AT" TIMEOUT 5 OK "ATE0V1" TIMEOUT 5 OK AT+CGDCONT=1,"IP","ef-atm.vfe.net" TIMEOUT 5 OK "ATS0=0" TIMEOUT 5 OK "AT+CGATT=1" TIMEOUT 5 OK "ATD*99***1#" TIMEOUT 10 CONNECT
chat-script ping ping 10.252.7.98
license udi pid C819G-U-K9 sn FCZ15469000
!
!
archive
log config
hidekeys
!
spanning-tree vlan 1 priority 65535
username allmalia secret 5 $1$NNvC$5WTb5C1aU1lNT8p38z94R/
!
!
!
!
controller Cellular 0
gsm sim primary slot 1
gsm failovertimer 1
!
ip ssh version 2
!
track 10 ip sla 10 reachability
!
track 20 ip sla 20 reachability
!
!
crypto isakmp policy 30
encr aes
authentication pre-share
group 2
crypto isakmp key rbPOc#{0cN" address 0.0.0.0 0.0.0.0
crypto isakmp invalid-spi-recovery
--More--
000174: .Jun 16 11:27:57.124 EGY: EM: No consumer registered for any event type
000175: .Jun 16 11:27:57.144 EGY: %HA_EM-6-LOG: REST_MODEM: ******* MODEM RESET SUCCESSFULLY *******
000176: .Jun 16 11:27:57.152 EGY: EM: No consumer registered for any event type
000177: .Jun 16 11:27:57.160 EGY: EM: No consumer registered for any event type
000178: .Jun 16 11:27:57.168 EGY: %SYS-5-CONFIG_I: Configured from console by allmalia on vty0 (EEM:REST_MODEM)
000179: .Jun 16 11:27:57.172 EGY: EM: No consumer registered for any event type
!
!
crypto ipsec transform-set efinance esp-aes esp-sha-hmac
mode transport
!
crypto ipsec profile ATM
set security-association lifetime seconds 120
set transform-set efinance
!
!
!
!
!
!
interface Loopback0
description ***Crypto***
ip address 192.168.9.225 255.255.255.255
no ip redirects
no ip unreachables
no ip proxy-arp
!
interface Loopback1
description ***GPRS Loopback***
ip address 172.26.9.225 255.255.255.255
no ip redirects
no ip unreachables
no ip proxy-arp
!
interface Tunnel1
description ***GPRS Tunnel***
bandwidth 64
ip address 172.49.9.225 255.255.0.0
no ip redirects
no ip unreachables
no ip proxy-arp
ip bandwidth-percent eigrp 2526 100
ip nhrp authentication efinance
ip nhrp map 172.49.0.1 10.94.251.85
ip nhrp network-id 2526
ip nhrp holdtime 360
ip nhrp nhs 172.49.0.1
ip tcp adjust-mss 1360
delay 70
cdp enable
tunnel source Cellular0
tunnel destination 10.94.251.85
tunnel key 2526
tunnel protection ipsec profile ATM
!
interface Tunnel4
description ***GPRS***
bandwidth 64
ip address 172.25.9.225 255.255.0.0
no ip redirects
no ip unreachables
no ip proxy-arp
ip bandwidth-percent eigrp 2526 100
ip nhrp authentication efinance
ip nhrp map 172.25.0.1 10.252.7.98
ip nhrp network-id 2526
ip nhrp holdtime 360
ip nhrp nhs 172.25.0.1
ip tcp adjust-mss 1360
delay 1000
cdp enable
tunnel source Cellular0
tunnel destination 10.252.7.98
tunnel key 2526
tunnel protection ipsec profile ATM
!
interface Cellular0
ip address negotiated
no ip redirects
no ip unreachables
no ip proxy-arp
ip verify unicast reverse-path
encapsulation ppp
dialer in-band
dialer string gsm
dialer-group 1
async mode interactive
ppp authentication chap pap callin
ppp chap hostname test
ppp chap password 7 00554155501B4B464F610C0E49594557524B4C446A6B
ppp ipcp dns request
!
interface FastEthernet0
switchport access vlan 20
no ip address
no cdp enable
!
interface FastEthernet1
switchport access vlan 20
no ip address
no cdp enable
!
interface FastEthernet2
switchport access vlan 20
no ip address
no cdp enable
!
interface FastEthernet3
switchport access vlan 20
no ip address
no cdp enable
!
interface GigabitEthernet0
no ip address
shutdown
duplex auto
speed auto
no cdp enable
!
interface Serial0
description connection to TE Data
no ip address
no ip redirects
no ip unreachables
no ip proxy-arp
ip flow ingress
ip flow egress
encapsulation frame-relay IETF
ip ospf mtu-ignore
shutdown
no fair-queue
clock rate 2000000
frame-relay lmi-type ansi
!
interface Vlan1
no ip address
shutdown
!
interface Vlan20
description ***LAN***
ip address 10.40.9.225 255.255.255.240
no ip redirects
no ip unreachables
no ip proxy-arp
!
!
router eigrp 2526
distribute-list EIGRP-GPRS out Tunnel1
network 10.40.9.224 0.0.0.15
network 172.25.9.225 0.0.0.0
network 172.26.9.225 0.0.0.0
network 172.27.9.225 0.0.0.0
network 172.49.9.225 0.0.0.0
network 192.168.9.225 0.0.0.0
distance eigrp 140 190
passive-interface Vlan20
eigrp stub connected summary
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
ip route 10.94.251.85 255.255.255.255 Cellular0
!
ip access-list standard EIGRP-GPRS
deny 172.27.0.0 0.0.255.255
deny 172.28.0.0 0.0.255.255
permit any
ip access-list standard LMS
permit 10.40.0.26
permit 10.40.0.27
deny any
!
ip sla 10
icmp-echo 10.94.251.85 source-ip 10.82.81.128
ip sla schedule 10 life forever start-time now
ip sla 20
icmp-echo 10.252.7.98 source-ip 10.252.8.230
ip sla schedule 20 life forever start-time now
logging trap warnings
logging source-interface Loopback0
logging 10.40.0.26
access-list 1 permit any
access-list 20 permit 10.40.0.26
access-list 20 permit 10.40.0.27
access-list 20 deny any
access-list 99 permit 172.30.133.2
access-list 99 remark Access-Mgmt
access-list 99 permit 10.236.7.98
access-list 99 permit 10.252.7.98
access-list 99 permit 172.20.41.58
access-list 99 permit 10.94.251.85
access-list 99 permit 10.40.0.0 0.0.0.255
access-list 99 deny any
dialer-list 1 protocol ip list 1
!
menu TST title ^CCCCCCC Menu for Tech support team ^C
menu TST text 1 IPS
menu TST command 1 show ip inter brief
menu TST text 2 GPRS Status
menu TST command 2 sh cellular 0 all
menu TST text 3 reset cellular
menu TST command 3 test cellular 0 modem-reset
menu TST text 4 check routing
menu TST command 4 sh ip route
menu TST text 5 sh neighbor status
menu TST command 5 sh ip eigrp neighbors
menu TST text 6 check router uptime
menu TST command 6 sh version
menu TST text 7 bye bye
menu TST command 7 exit
!
!
!
!
snmp-server group cisco v3 auth access 20
snmp-server group efinance v3 auth
snmp-server ifindex persist
snmp-server trap-source Loopback0
snmp-server source-interface informs Loopback0
snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart
snmp-server enable traps vrrp
snmp-server enable traps flowmon
snmp-server enable traps call-home message-send-fail server-fail
snmp-server enable traps tty
snmp-server enable traps eigrp
snmp-server enable traps ospf state-change
snmp-server enable traps ospf errors
snmp-server enable traps ospf retransmit
snmp-server enable traps ospf lsa
snmp-server enable traps ospf cisco-specific state-change nssa-trans-change
snmp-server enable traps ospf cisco-specific state-change shamlink interface
snmp-server enable traps ospf cisco-specific state-change shamlink neighbor
snmp-server enable traps ospf cisco-specific errors
snmp-server enable traps ospf cisco-specific retransmit
snmp-server enable traps ospf cisco-specific lsa
snmp-server enable traps license
snmp-server enable traps stun
snmp-server enable traps bstun
snmp-server enable traps envmon
snmp-server enable traps ethernet cfm cc mep-up mep-down cross-connect loop config
snmp-server enable traps ethernet cfm crosscheck mep-missing mep-unknown service-up
snmp-server enable traps flash insertion removal
snmp-server enable traps c3g
snmp-server enable traps isdn call-information
snmp-server enable traps isdn layer2
snmp-server enable traps isdn chan-not-avail
snmp-server enable traps isdn ietf
snmp-server enable traps adslline
snmp-server enable traps vdsl2line
snmp-server enable traps mac-notification
snmp-server enable traps energywise
snmp-server enable traps cef resource-failure peer-state-change peer-fib-state-change inconsistency
snmp-server enable traps aaa_server
snmp-server enable traps atm subif
snmp-server enable traps bfd
snmp-server enable traps bgp
snmp-server enable traps memory bufferpeak
snmp-server enable traps cnpd
snmp-server enable traps config-copy
snmp-server enable traps config
snmp-server enable traps config-ctid
snmp-server enable traps entity
snmp-server enable traps fru-ctrl
snmp-server enable traps resource-policy
snmp-server enable traps event-manager
snmp-server enable traps frame-relay multilink bundle-mismatch
snmp-server enable traps frame-relay
snmp-server enable traps frame-relay subif
snmp-server enable traps hsrp
snmp-server enable traps ipmulticast
snmp-server enable traps msdp
snmp-server enable traps mvpn
snmp-server enable traps pim neighbor-change rp-mapping-change invalid-pim-message
snmp-server enable traps cpu threshold
snmp-server enable traps rsvp
snmp-server enable traps ipsla
snmp-server enable traps syslog
snmp-server enable traps l2tun session
snmp-server enable traps l2tun pseudowire status
snmp-server enable traps vtp
snmp-server enable traps pw vc
snmp-server enable traps firewall serverstatus
snmp-server enable traps ipmobile
snmp-server enable traps nhrp nhs
snmp-server enable traps nhrp nhc
snmp-server enable traps nhrp nhp
snmp-server enable traps nhrp quota-exceeded
snmp-server enable traps isakmp policy add
snmp-server enable traps isakmp policy delete
snmp-server enable traps isakmp tunnel start
snmp-server enable traps isakmp tunnel stop
snmp-server enable traps ipsec cryptomap add
snmp-server enable traps ipsec cryptomap delete
snmp-server enable traps ipsec cryptomap attach
snmp-server enable traps ipsec cryptomap detach
snmp-server host 10.40.0.26 version 3 auth efinance
snmp-server host 10.40.0.27 version 3 auth efinance
!
!
!
control-plane
!
alias exec r sh ip route
alias exec c conf t
alias exec s sh ip inter brief
alias exec srb sh run | begin
alias exec sri sh run | inc
alias exec srs sh run | sec
alias exec sr sh run
alias exec n show ip eigrp nei
banner motd ^CCCCCCC
--------------------------------------------------------
AUTHORIZED Access only
this system is the property of E-Finance Enterprise.
UNAUTHORISED ACCESS TO THIS DEVICE IS PROHIBITED.
You must have explicit permission to access this device.
all activities performed on this device are logged and
violations of this policy result in disciplinary action.
--------------------------------------------------------
UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED.%
--------------------------------------------------------^C
!
line con 0
exec-timeout 5 0
logging synchronous
line aux 0
password 7 104B0F100B161C0809
line 3
exec-timeout 0 0
script startup modem
script dialer tmobile5
script reset ping
script activation tmobile5
modem InOut
no exec
rxspeed 7200000
txspeed 5760000
line vty 0 4
transport input all
!
scheduler max-task-time 5000
scheduler allocate 20000 1000
ntp logging
ntp authentication-key 1 md5 124E0A1C130A0056243875 7
ntp authenticate
ntp trusted-key 1
ntp source Loopback0
ntp update-calendar
ntp server 10.40.0.199 key 1 source Loopback0
ntp server 10.40.0.99 key 1 prefer source Loopback0
event manager environment q "
event manager session cli username "allmalia"
event manager applet TRACK_MODEM_DOWN
event track 20 state down
action 001 cli command "enable"
action 002 cli command "config t"
action 003 cli command "event manager applet REST_MODEM"
action 004 cli command "event timer watchdog time 120 "
action 005 cli command "action 1.0 cli command enable"
action 006 cli command "action 2.0 cli command $q test cellular 0 modem-power-cycle$q"
action 007 cli command "action 3.0 syslog priority info msg $q ******* MODEM RESET SUCCESSFULLY ******* $q"
action 008 cli command "action 4.0 cli command $q config t$q"
action 009 cli command "action 5.0 cli command $q no event manager applet RESET_MODEM$q"
action 010 cli command "action 6.0 cli command end"
event manager applet TRACK_MODEM_UP
event track 10 state up
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "no event manager applet RESET_MODEM"
action 4.0 cli command "end"
!
end
06-17-2013 07:53 AM
I had a typo. The internal applet name should be RESET_MODEM not REST_MODEM (fix action 002 in the TRACK_MODEM_DOWN applet). However, the debug message shouldn't be an issue. Also, you shouldn't be tracking two different track IDs in these applets. They are designed to track the same object.
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: