Monday, July 13, 2009

Command to check whether the sytem is alive or not

FPING

fping is a ping like program which uses the (ICMP) echo request to determine whether an ip is up or not.

fping is different from ping in that you can specify any number of hosts on the command line, or specify a file containing the lists of hosts to ping.

Working
fping will send out a ping packet and move on to the next host in a round-robin fashion.

If a host replies, it is noted and removed from the list of hosts to check. If a host does not respond within a certain time limit and/or retry limit it will be considered unreachable.

Unlike ping, fping is meant to be used in scripts .
Really helpful when we need to set the status of the a particular host in our applications.

Download Link

http://linux.softpedia.com/progDownload/fping-Download-10469.html

download and install the software. Type fping -h will list out the various parameters.

Example shell script

#!/bin/sh
status=`fping 192.168.0.88 | cut -d ' ' -f 1`
if [ $status != "alive" ]
then
echo 'Server Down. Please check the network'
fi


No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails