Linux scripted action tool needed - Relative Newb

I am a Windows guy who has had to play a lot of "catch up" in Linux after taking a new position. I am in need of a rather simple tool that will ping a small number of hosts at  short intervals and proceed to run an existing script if any of those hosts do not reply.

I have been searching around for an app or script that may already do this, but nothing found so far. I could easily do this in Windows, but my low level of proficiency in Linux is making this trickier than I anticipated.
Who is Participating?
ghostdog74Connect With a Mentor Commented:
here's a pseudocode
while true
  while read line
    ping -c 2 $line > /dev/null 2>&1
    if [ $? -ne 0 ]; then
   done < my_ping_list
  sleep 5 #

Open in new window

The best free tool to monitor server/routers/switches on linux is using Nagios.

It is a bit difficult to setup but documentation is well written,.


Nagios can send emails run scripts etc.
Look into bash scripting if you want some custom script to run
JPasterniakAuthor Commented:
Thanks, but I've already looked at Nagios and it's much more robust of a system than I need. All I need to do is ping 6 different hosts every few seconds  and run one script if any one of the hosts stops responding.

I'm working on getting familiar with Bash scripting, but I need to find a solution more quickly than I can learn how to write one myself.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.