Can't think of a way to push the status of the TCP/IP stack, but I can pull
one:
#!/bin/sh
#
# This stupid little script loops until $1's IP stack
# responds to pings. This is usually a pretty good way to
# tell if it's up or down. It says something once a minute.
#
while ( ping -c1 -w2 $1 >/dev/null 2>&1 );do echo -n "$1 is up ";date;sleep
60;done
until ( ping -c1 -w2 $1 >/dev/null 2>&1 );do echo -n "$1 is down
";date;sleep 60;done
echo -n "$1 is back up at "
date
Lots of opportunities to error check/consolidate/optimize here -- you can
go a lot more fine-grained on the time units, too (I'd silence it if I did
that, though). I wrote this anticipating that the target system would go
off the air after I started it. For some, this thing would be a lot more
useful by having a switch that says "exit when I get the first ping back,
no matter what". But for your purposes, it might be what you're looking for
if you're trying to time the difference between if-down on telinit 0 and
if-up.
--Jim--
James S. Tison
Senior Software Engineer
TPF Laboratory / Architecture
IBM Corporation
"A bird in hand is safer than one overhead."
Jim Sibley/San
Jose/[EMAIL PROTECTED] To: [EMAIL PROTECTED]
Sent by: Linux on cc:
390 Port Subject: message at starting
<[EMAIL PROTECTED]
IST.EDU>
07/14/2003 14:41
Please respond to
Linux on 390 Port
I'm running some boot timings for multiple linux under vm. Is there a neat
why to notify either vm or another linux machine that TCP/IP or a certain
application has been started so I can get elapsed times?
Regards, Jim
Linux S/390-zSeries Support, SEEL, IBM Silicon Valley Labs
t/l 543-4021, 408-463-4021, [EMAIL PROTECTED]
*** Grace Happens ***