Folks,
I've had a few exchanges with Jim about the "right" way to do this, and I
agree that SNMP or a sockets-based app running as a daemon would be a more
elegant solution, but I now have running, on a client near me, a script that
collects information from the /proc/meminfo file and dumps the results in the
system log on the server. Since it's script-based, I plan on making it more
elegant, collect more data, and do some filtering, etc.
The concept is that I use the at "batch" command to execute a script which
sits in an infinite loop. Data is collected into shell variables which are
then written to the system log by the logger utility. I chose the batch
command, rather than cron or at, because I didn't need to specify an exact
time, and I could do the scheduling by simply doing a sleep command in the
script.
My first trivial data collection script:
(Clearly you could watch for enemy spies or ...)
#! /bin/bash
while [ -d /root ]; do
foo=$(cat /proc/meminfo|grep Swap:)
logger -p info $foo
sleep 300
done
The RCFILE_01 script:
#!/bin/bash
#start the at daemon
/usr/sbin/atd
#start a script to collect swap file usage at 5 minute intervals.
/usr/bin/batch -f /etc/rc.d/logit.sh
#this also works:
#/usr/bin/at -qb -f /etc/rc.d/logit.sh now
To make this work, I had to add a few files to the /lib directory:
libnss_file* from the glibc package
as well as /sbin/atd and /bin/at and /bin/batch.
Finally, /etc/{group,passwd} were augmented with info for user daemon.
Enjoy,
Skip
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_____________________________________________________________________
Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto:
https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help, try #ltsp channel on irc.openprojects.net