On Sun, 2010-05-02 at 08:34 -0400, Dan Journo wrote:

<snip>


> How can i log a continuous ping test to a file and include the date
> and time of each ping?

Try this:

#!/bin/sh
for (( ; ; ))
do
  NOW=$(date +"%T %m/%d/%Y")
  PING=$(ping -qc 1 example.com)
  echo $NOW: $PING >> pinger.log
done
exit 0

You can then monitor the log file using:

$ tail -f pinger.log

You will need to use ^C to kill the script.

Hope this helps.




-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to