|
illuin Homepage | Richard |
UPTIME version 0.2Source: http://www.illuin.org/Software/uptime-0.2.tar Source: http://www.illuin.org/Software/uptime-0.2.tar.gz This is a program I wrote to produce uptime and availability statistics for the fileservers on campus. It makes use of the BER support produced for MRTG. HOWEVER it only uses a single socket and doesn't need to wait for responses before polling other devices.
How it works.The uptime.pl script polls the list of devices in uptime.hosts for their sysuptime and records the results in uptime.log. It is designed to be a long-running process. It reads the uptime.hosts file once when it starts.The process sends the SNMP queries to each host in the file over $maxtime, polling each device approximately every $polltime seconds. The use of $maxtime means that you can prevent the script from flooding the network with queries. The use of $maxtime gives the shortest period a host could be reloaded in without the script noticing. (eg if a system restarts twice in $maxtime the script only sees one of these events). After the script has been running for $compresstime seconds it compresses the logfiles and exits. I make use of the supervise program from Dan Bernstein to keep uptime.pl running, it prevents more than one instance running at once, and allows the program to be run from a crontab which makes it more resilient to failures. Though I find that the script can run for days/weeks without crashing. crontab entry: 5 * * * * cd /info/uptime ; supervise /info/uptime ./uptime.pl >/dev/null 2>&1 &
calculation.plThis script compresses the log-file, removing all redundant elements from it. It writes out a series of HTML tables for including in status pages crontab entry: 6 * * * * cd /info/uptime ; ./calculation >/dev/null 2>&1 TODO:References:MRTGhttp://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.htmldaemontools packageftp://koobera.math.uic.edu/pub/software/daemontools-0.53.tar.gz |
| Last Updated: 2000-09-11 01:17:13 -0000 |