*BSD News Article 72718


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!cs.utexas.edu!geraldo.cc.utexas.edu!arlut.utexas.edu!usenet
From: Ian Fink <fink@arlut.utexas.edu>
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: Wed, 03 Jul 1996 12:36:04 -0500
Organization: Applied Research Laboratories - The University of Texas at Austin
Lines: 23
Message-ID: <31DAAF84.19B7@arlut.utexas.edu>
References: <Pine.SOL.3.93.960702171209.4062B-100000@gold.acns.fsu.edu>
NNTP-Posting-Host: seadevil.arlut.utexas.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0 (X11; I; HP-UX A.09.05 9000/730)
To: "Douglass E. Davis" <davis@gold.acns.fsu.edu>
Xref: euryale.cc.adfa.oz.au comp.sys.sun.admin:69943 alt.sys.sun:10362 comp.unix.bsd.misc:1204 comp.unix.programmer:39078 comp.unix.bsd.bsdi.misc:4222 comp.unix.admin:44445

Douglass E. Davis wrote:
> 
> 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.
> 
> But if some one has a script or C program  that could do this I would
> appreciate the source, or if you could just tell me how to do it.

Expect would be the easiest choice :)

Then have cron run the expect script.

You can obtian expect (and I think a script called ping-and-page) from

ftp.cme.nist.gov

Ian Fink
fink@arlut.utexas.edu