need to check on some hosts and send an email if there status changes
I wanna put together a script in bash that will allow me to check the up/down state of a single host via ping
i want it to run in a continuous loop so I can just fire the script and forget about it(dont want cron to drive the script), if the host is up..then just keep pinging until its down.
At that point i want it to ping about 4 more times just ensure its not a network glitch, and if its still down send me an email. from there just keep pinging until its back online and then send me an email to let me know its up
seems easy right? not when you actually have to sit down and write (at least for me)
I've got coders block, cant seem to figure out what logic i can use to figure this out --i've been writing tons of functions and array, but am having no luck tieing them together
any help would be so very very appreciated
Tks