[CentOS] Shell Scripting Random Delay
Les Mikesell
lesmikesell at gmail.com
Wed May 15 19:26:52 UTC 2013
On Wed, May 15, 2013 at 1:38 PM, Thomas Johansson <thomasj at isy.liu.se> wrote:
> On 2013-05-15 17:44, Matt wrote:
>> When I run them all at once they bog the system and cause some of
>> latency graphs on equipment being monitored to look poor.
>
> Wait randomized interval of 60 seconds and start
>
> perl -e "sleep(int(rand(60)))" && (perl /scripts/my_script.pl)
Also you can add a
wait
to the script after starting some number of background commands to
wait until they have all completed before you start another batch.
But, rather than using so many home-grown scripts, maybe you should
look at OpenNMS, cacti, etc. for monitoring frameworks to manage it
all for you.
--
Les Mikesell
lesmikesell at gmail.com
More information about the CentOS
mailing list