cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
426
Views
0
Helpful
5
Replies

EEM Script help for pinging IP addresses in the arp cache

kaval sandhu
Level 1
Level 1

Hi Guys,

is anyone able to help me write a event manager script to extract all of the IP addresses from the arp cache and then ping them in turn

something like this pseudo code

event manager applet Check_ARP_and_Ping


event timer cron cron-entry "*/1 * * * *"


action 1.0 cli command "enable"
action 2.0 cli command "show ip arp vrf IOT"


action 3.0 regexp "COLLECT THE IP ADDRESSES from the above output" in $ip_list
action 4.0 foreach ip "$ip_list"
action 4.1 cli command "ping vrf IOT $ip_list repeat 2"

action 5.0 end

5 Replies 5

Joseph W. Doherty
Hall of Fame
Hall of Fame

Just curious, why?

Hi Joseph,

it is part of an SDA deployment where I have trouble with silent hosts dropping off the network, these pesky devices wont respond to broadcast pings either of 255.255.255.255 so I need to check what's online and then keep it talking.

I have wrote a python script from a centralised machine that will SSH into the switch and perform the ARP capture and subsequent ping commands but it I think it would be neat to do it all on the box via eem.

also I cannot use the built in docker as I'm using it for something else  

Hosts also will not respond to a subnet broadcast?

kaval sandhu
Level 1
Level 1

correct..... they wont respond to the subnet broadcast either, it seems the network cards they use in these IOT devices are not developed very well  

As a possible alternative approach, how about the possibly of just sequentially pinging all the IPs that these IoT devices might use?  Although this approach will ping unused IPs, it probably would be an easier EEM script.

BTW this question might also get better EEM help within the Network Management topic.

Review Cisco Networking for a $25 gift card