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

Attention: The Cisco Support Community site will be in read only mode on Dec14, 2017 from 12:01am PST to 11:30am for standard maintenance. Sorry for the inconvenience.

New Member

Router Script

Is possible than a router  generate each eight hours a ping to a IP address predefined?

New Member

Re: Router Script

Possibly an EEM applet, maybe something like the following.  Check out the link below, it has some great info about this sort of thing.

event manager applet email_server_unreachable

event track 10 state down

action 1.0 syslog msg "Houston we have a problem. Ping failed, server unreachable!"

action 1.1 cli command "enable"

action 1.2 cli command "del /force flash:server_unreachable"

action 1.3 cli command "show clock | append server_unreachable"

action 1.4 cli command "show ip arp | append server_unreachable"

action 1.5 cli command "show ip route | append server_unreachable"

action 1.6 cli command "show interface FastEthernet0/1/1 | append server_unreachable"

action 1.7 cli command "more flash:server_unreachable"

action 1.8 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "Server Unreachable: ICMP-Echos Failed" body "$_cli_result"

action 1.9 syslog msg "Server unreachable alert has been sent to email server!"

I copied the info from:

New Member

Re: Router Script

Thanks Jason,

But, How do I run the TCL file?

New Member

Re: Router Script

You could use TCL and if you have 12.3 IOS (might be 12.4) you can run a kron to kick off the timer.  You are going to have to work out the details on notification of failures, etc, because I am just learning EEM and TCL myself.

TCL: save this code as "ping_ip1.tcl" (or whatever you'd like, just make changes below to reflect the new filename).  Once saved, load into flash, or onto a TFTP server.  If you store anywhere other than flash, be sure to change the IOS kron line below (tclsh tftp/ftp/disk0/etc).

foreach ip {

} {

ping $ip


kron policy-list ping_ip1

tclsh flash:/ping_ip1.tcl

kron occurrence ping_ip1 in 8:0 recurring

policy-list ping_ip1

Edit: See this script for an example of how to get email notifications...

CreatePlease to create content