Solved

Linux scripted action tool needed - Relative Newb

Posted on 2008-06-19
3
211 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now