Thursday, September 15, 2005

good perl web sites

http://learn.perl.org/library/beginning_perl/

Tuesday, September 13, 2005

To install NUT on debian/ubuntu machines

apt-get install nut

install the standard nut from
http://random.networkupstools.org/

sudo cp /usr/local/ups/bin/mustek /lib/nut/

sudo su
cd /usr/local/ups/bin
cp upsc upslog upsrw upscmd /bin
cp upsdrvctl /sbin

cd /usr/local/ups/sbin
cp upsmon upssched /sbin

vi /usr/share/doc/nut/README.Debian.gz
To see step by step instructions

How to make NUT notify a cellphone when power goes down

In the /usr/local/ups/etc/upsmon.conf file

add
NOTIFYCMD /usr/local/ups/bin/notifyme

Then create the file /usr/local/ups/bin/notifyme

It looks as follows
#! /bin/bash
echo "$*" | sendmail -F "ups@mybox" djohnson@csir.co.za
echo "$*" | qpage -f '' -s zibbi.icomtek.csir.co.za -p 0827792258

This will email a message to djohnson@csir.co.za when power goes down
and it will sms to 0827792258 when power goes down

A NUT tip

if when running
/usr/local/ups/sbin/upsd

you find that it won't synchronize

Check the permissions on the serial port
Make sure they are like this:

chmod 0600 /dev/ttyS0
chown nut:nut /dev/ttyS0