I'm currently working on automation of template changes for devices. Currently when changing templates, the devices lose their local settings, so the script we have written will pull things like current bandwidth shaping, vlans, uplink IPs, etc. and push them to the device after changing the assigned template.
What I am trying to do now is build in some health checking to this. When I run it now, it will confirm if the MX has taken the configuration, but as we are aware the devices can take 5+ minutes to take the configuration from the cloud occasionally. When this is complete, I want to ensure that clients behind the MX are working correctly. Is anyone aware of or has anyone created something that will pull clients from a list of networks and ping them? The current goal would be to run this once prior to doing the template migration, then a second time afterwards and do a diff over the two outputs.
All sounds perfectly doable. Take that automation script you have already made for deployment, then wrap it up in a script that first generates the baseline network status report, runs your changes, then waits for the amount of time you want, time.sleep(300), then runs the same reporting script and compares the output.
But it might be easier and more accurate to simply record the results of the ping in whatever language you're using to run it, and generate a report based on that. When it comes to reporting things that are sensitive to time with a precision under 5 minutes, some API's don't exactly work perfectly, but some do.
Regarding pinging the clients, use the "get clients" API call to obtain a list of clients in the last x time frame. When I did this, I used 2 hours (7200secs). If you are using Python, use the ping() function from the Ping3 package on Pypi. Adjust the following accordingly for your purpose.