[asterisk-users] Calls Dropping

Bob Smither Smither at C-C-I.com
Sun May 2 08:02:32 CDT 2010


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.






More information about the asterisk-users mailing list