[TriLUG] scripted sesssions with ssh

John Turner ukcsgrad89 at gmail.com
Mon Jul 6 11:39:48 EDT 2009

It may be just me but there is NO WAY that running a script from cron every
5 minutes and sending the results to another machine can be more work for a
machine then for you to ssh into the same machine every 5 minutes and run a
bunch of commands.  And doing an ssh connection for every check is just
Maybe your manager has an issue with running the script on the monitored
machine 24x7 and if that is the case using cron would solve that issue.

On Mon, Jul 6, 2009 at 11:07 AM, Joseph Mack NA3T <jmack at wm7d.net> wrote:

> At $work I nonitor about 1000 parameters every 5 minutes (cpu usage,
> ethernet throughput, temperature of disks...). I'm required to do this by
> ssh from another machine. This involves scripts which make calls like
> monitoring_machine#: result=`ssh remote_machine du | grep ...`
> This works, except the large number (1000/5mins) of ssh calls cause a high
> load on the both the client and remote machine.
> My $manager says that since he can ssh to the remote machine and do the at
> the command prompt the same thing as my scripts do, that my scripts should
> only have to make one ssh connection and they should run all their commands
> and receive the responses without exiting the ssh session.
> The only way I can see to do this is with expect scripts (it would be a
> nightmare to code up)
> Are there other ways for a script to open an ssh connection, make about
> 1000 calls, and process 1000 respones before closing the ssh session?
> My preference would be to run the monitoring on each machine and ship the
> results back to the monitoring machine, but I'm not allowed to do that (it
> would result in too much load on the monitored machine).
> Thanks
> Joe
> --
> Joseph Mack NA3T EME(B,D), FM05lw North Carolina
> jmack (at) wm7d (dot) net - azimuthal equidistant map
> generator at http://www.wm7d.net/azproj.shtml
> Homepage http://www.austintek.com/ It's GNU/Linux!
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions

More information about the TriLUG mailing list