winpopup system check script
Nick Sayer
nsayer at quack.kfu.com
Thu May 21 17:05:20 GMT 1998
I don't pretend to be the first, but we have a FreeBSD server for
mail and samba here and the other sysadmin types (not me. :-) )
use win95. I thought of this as a quick solution to letting them
know when there's a problem.
#! /bin/sh
WARN()
{
# Change the next line to be the list of machines to notify
for j in zephyr irocz sjrr
do
echo $@ | /usr/local/bin/smbclient -M $j >/dev/null
done
}
# If a PID file doesn't refer to a running job, it must have died.
for i in /var/run/*.pid
do
if [ ! -d /proc/`head -1 $i` ]; then
WARN `echo $i | sed -e s./var/run/.. -e s/.pid//` not running on `hostname -s`!
fi
done
# Check for disk space
for i in / /usr /home
do
if [ `df -k $i | tail +2 | awk '{print $4}'` -lt 2500 ]; then
WARN Disk space on `hostname -s`:$i is low!
fi
done
exit 0
More information about the samba
mailing list