We have a monitoring system to check network devices, sometimes we got an alert saying the remote device is down. We check the remote device and it’s working fine. To ensure that our monitoring working properly, we create an external script to monitor system, then we want to compare the result between 2 systems. I finally come with this script (ping.sh) , it will continuously ping the remote server, if it’s down, it will write a log.

I want to run this script in background so i run it like this:

The script is just the basic only, you can do a lot of customization such as format the log.