Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2007 13:59:09 -0500
From:      Eric Crist <mnslinky@gmail.com>
To:        "Narek Gharibyan" <ngharibyan@arm.synisys.com>
Cc:        questions@freebsd.org, freebsd-questions@freebsd.org
Subject:   Re: load script at bootup
Message-ID:  <665F72C1-5495-4BD3-98E4-F687FB7B7BDA@gmail.com>
In-Reply-To: <015401c7e5b6$24b77580$180ca8c0@arm.synisys.com>
References:  <015401c7e5b6$24b77580$180ca8c0@arm.synisys.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 23, 2007, at 1:48 PMAug 23, 2007, Narek Gharibyan wrote:

> #!/bin/sh
>
> Ping -Dc 3600 xxx.xxx.xxx.xxx | tail -4 >>/root/stat && date >> / 
> root/stat
> && echo "===========================" >> /root/stat
>
>
>
> I wrote this script for collecting ping statistic (after I email to  
> a group
> the stat file).
>
> 1. how can I run this at startup

You can use cron with an entry similar to:

@reboot /path/to/script.sh

This will work as long as your script has the execute bit set for the  
user trying to run it.

> 2. how can I restart this script after 3600 counts down

You can use something like sleep, or you can schedule, again using  
cron, the script to run every 3600 seconds.  An entry such as:

0  *   *  *  * /path/to/script.sh

This will re-run your script every hour, on the hour.

> 3. Is there a program, script or any way more appropriate to track the
> packet loss and ping availability.?

I would recommend using some nrpe module you write for nagios and/or  
cacti to monitor and even graph this information.

> Thank you in advance

No problem!

-----
Eric F Crist
Secure Computing Networks





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?665F72C1-5495-4BD3-98E4-F687FB7B7BDA>