Name: Using upsmon and your pager together
File: pager.txt
Date: 31 October 2000
Auth: Russell Kroll <rkroll@exploits.org>

upsmon now has the ability to call an external program to send messages
about state changes.  It's pretty crude at this point, but it should
let you know what's going on.

Here's one way to use it - for the purposes of this example, mail will
go to an address that just happens to be a pager gateway.

First you write a script to handle the actual notifying work:

#! /bin/bash
echo "$*" | sendmail -F"ups@mybox" bofh@pager.example.com

Then you add the path to the script in the upsmon.conf:

NOTIFYCMD /usr/local/ups/bin/notifyme

Finally, start upsmon, pull the plug on the UPS, and see what happens.

Note that you have to add the EXEC flag with NOTIFYFLAGS in your upsmon.conf
before the NOTIFYCMD will get called for anything.

This will send mail every time something happens which may become annoying
rather quickly, especially for simple power fluctuations.  To only send
messages after some interval, see the upssched.txt file for information
on offset events.
