Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.ysu.edu!odin.oar.net!malgudi.oar.net!rclnews.eng.ohio-state.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!uwm.edu!news-res.gsl.net!news.gsl.net!nntp.coast.net!dispatch.news.demon.net!demon!news.xciv.org!usenet
From: paul@xciv.org (Paul Civati)
Newsgroups: comp.sys.sun.admin,alt.sys.sun,comp.unix.bsd.misc,comp.unix.programmer,comp.unix.bsd.bsdi.misc,comp.unix.admin
Subject: Re: ping script
Date: 17 Jul 1996 00:19:14 GMT
Organization: XCIV
Lines: 42
Message-ID: <4shbi2$7v@xciv.demon.co.uk>
References: <Pine.SOL.3.93.960702171209.4062B-100000@gold.acns.fsu.edu>
<4sbfat$ll@keyhole.west.spy.net>
Reply-To: paul@xciv.org
NNTP-Posting-Host: pantera.xciv.org
X-NNTP-Posting-Host: xciv.demon.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.7
Xref: euryale.cc.adfa.oz.au comp.sys.sun.admin:70704 alt.sys.sun:10418 comp.unix.bsd.misc:1255 comp.unix.programmer:39698 comp.unix.bsd.bsdi.misc:4328 comp.unix.admin:45004
In article <4sbfat$ll@keyhole.west.spy.net>,
dustin@keyhole.west.spy.net (Dustin Sallings) writes:
>: I am trying to make a script that will ping a computer every few minutes
>: and run a program if there is no answer.
>
>: I was thinking about making a C program to do the same thing. it would
>: just do a :
>: system("ping blazay > datafile ")
>: then it would read datafile to see if the ping worked.
>
> That's silly, do it in scotty or something that you can actually
> ping from. Don't use system.
There's a nice little utility called fping, which can handle pinging
multiple hosts and return useful error levels, from the docs and man
page:
DESCRIPTION
fping is a like program which uses the Internet Control
Message Protocol (ICMP) echo request to determine if a
target host is responding. fping differs 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. Instead of sending to one host until it times out or
replies, fping will send out a ping packet and move on to
the next host in a round-robin fashion.
Unlike ping , fping is meant to be used in scripts, so its
output is designed to be easy to parse.
AVAILABILITY
Available by anonymous FTP from argus.stanford.edu, in file
pub/fping.shar. Questions and suggestions can be directed to:
Roland Schemers, schemers@stanford.edu.
-Paul-
--
Paul Civati =O= Home: paul@xciv.org =O= http://www.xciv.org/
London UK =O= Home: paul@xciv.demon.co.uk =O= http://www.cheese.org/