Ping Client IP Address With Ping Live Tool

Solved
AhmedJawad
Getting noticed

Ping Client IP Address With Ping Live Tool

Trying to get the ping to result below, but I'm getting the result. 

 

{'pingId': '766174886620948907', 'url': '/devices/XXXX-XXXX-XXXX/liveTools/ping/766174886620948907', 'request': {'serial': 'XXXX-XXXX-XXXX', 'target': '10.51.133.49', 'count': '2'}, 'status': 'ready'}

 

From the API result in this URL 

https://developer.cisco.com/meraki/api-latest/#!get-device-live-tools-ping

 

I suppose to get a full body of the ping result? with thing like "loss": { "percentage": 0 },  

I'm not getting that. Am I missing anything?  

 

Here is my code. 

 

Clients = dashboard.networks.getNetworkClients(
network_id, total_pages='all')         # get a client list of the network 

 

my_dict = {}
for client in Clients:
       my_dict.update(client)
       serial = my_dict.get('recentDeviceSerial')             # get the serial number   
       target = str(my_dict.get('ip'))                                   # get the IP address 
       ping_resp1 = dashboard.devices.createDeviceLiveToolsPing(serial, target, count=2)  # create ping 
       pingid = ping_resp1.get('pingId')     ## get the ping ID 
       ping_resp2 = dashboard.devices.getDeviceLiveToolsPing(serial, pingid)    ### get ping result 
       print(ping_resp2)

1 Accepted Solution
sungod
Head in the Cloud

You're making the two API calls without any significant delay between them. It may simply be that you get no results because the pinging hasn't yet completed.

 

If you put a delay of, say, 5 seconds, between the two calls, does it help? I.e.   time.sleep(5000)

View solution in original post

2 Replies 2
sungod
Head in the Cloud

You're making the two API calls without any significant delay between them. It may simply be that you get no results because the pinging hasn't yet completed.

 

If you put a delay of, say, 5 seconds, between the two calls, does it help? I.e.   time.sleep(5000)

Thank you very much! it worked 

Get notified when there are additional replies to this discussion.