Solved

Linux scripted action tool needed - Relative Newb

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…

707 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

13 Experts available now in Live!

Get 1:1 Help Now