Solution 1 - Install statserial (most Linux distros include the 
package) and write a little shell script that parses its output.

Solution 2 - If you're more into perl:

	$port = '/dev/ttyS0';
	open(FD, "<$port") || die "error opening $port";

	ioctl(FD, 0x5415, $ioctlinput);	# TIOCMGET ioctl call
	$test = unpack("I", $ioctlinput);	# convert to integer

	print "DTR\n"  if $test & 0x002;	# TIOCM_DTR
	print "RTS\n"  if $test & 0x004;	# TIOCM_RTS
	print "RING\n" if $test & 0x080;	# TIOCM_RNG
	print "CTS\n"  if $test & 0x020;	# TIOCM_CTS
	print "DCD\n"  if $test & 0x040;	# TIOCM_CAR
	print "DSR\n"  if $test & 0x100;	# TIOCM_DSR

The TIOCM... constants are hard coded here to avoid h2ph hassles.

Writing nice print statements to match your hardware signals and
be a good MON plugin is left as en exercise for the reader ...

--Peter

-----Original Message-----
From: pwardell@lawton-comm.com [mailto:pwardell@lawton-comm.com]
Sent: Wednesday, April 14, 2004 6:58 PM
To: mon@linux.kernel.org
Subject: UPS Status

I want to have mon monitor the AC status line of a UPS (DTR or DSR) and send
an alert via Qpage at the loss of AC Power.  Any suggestions on how I can do
this or is there a module already available to do this?

Paul

_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon