Solved

Linux scripted action tool needed - Relative Newb

Posted on 2008-06-19
3
215 Views
Last Modified: 2013-12-16
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.
0
Comment
Question by:JPasterniak
3 Comments
 
LVL 3

Expert Comment

by:dextermain
ID: 21824726
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,.

See http://www.nagios.org/

Nagios can send emails run scripts etc.
Look into bash scripting if you want some custom script to run
0
 

Author Comment

by:JPasterniak
ID: 21825543
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.
0
 
LVL 9

Accepted Solution

by:
ghostdog74 earned 100 total points
ID: 21827425
here's a pseudocode
e
while true
do
  while read line
  do 
    ping -c 2 $line > /dev/null 2>&1
    if [ $? -ne 0 ]; then
 
    fi
   done < my_ping_list
  sleep 5 #
done

Open in new window

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question