User's Manual UPS control system
Table Of Contents
- Apcupsd User's Manual
- Release Notes
- How To Use This Manual
- Basic User's Guide
- Planning Your Installation
- Building and Installing apcupsd
- After Installation
- Configuration Examples
- Testing Apcupsd
- Troubleshooting Your Installation
- Monitoring and Tuning your UPS
- Maintaining Your UPS
- Frequently-Asked Questions
- Apcupsd Bugs
- Advanced topics
- Customizing Event Handling
- Master/Slave Configurations
- Controlling Multiple UPSes on one Machine
- Support for SNMP UPSes
- Alternate Ways To Run The Network Information Server
- apcupsd System Logging
- Installation: Windows
- Windows Version of apcupsd
- Installation: Serial-Line UPSes
- Overview of Serial-Interface UPSes
- Connecting a Serial-Line UPS to a USB Port
- Connecting a APC USB UPS to either a PC USB or Serial Port
- Cables
- Smart-Custom Cable for SmartUPSes
- Smart Signalling Cable for BackUPS CS Models
- Voltage-Signalling Cable for "dumb" UPSes
- Other APC Cables that apcupsd Supports
- Voltage Signalling Features Supported by Apcupsd for Various Cables
- Voltage Signalling
- Back-UPS Office 500 signals
- Analyses of APC Cables
- Win32 Implementation Restrictions for Simple UPSes
- Internal Apcupsd Actions for Simple Cables
- RS232 Wiring and Signal Conventions
- Pin Assignment for the Serial Port (RS-232C), 25-pin and 9-pin, Female End
- Ioctl to RS232 Correspondence
- Testing Serial-Line UPSes
- Troubleshooting Serial Line communications
- Recalibrating the UPS Runtime
- DATA Logging
- Technical Reference
- Configuration Directive Reference
- apcupsd Status Logging
- Shutown Sequence and its Discontents
- APC smart protocol
- Apcupsd --- RPM Packaging FAQ
- Credits
- Kernel Config

More work needs to be done to the code to ensure that it corresponds to the
above levels.
As a practical example of how to setup your syslog() to use the new log-
ging feature, suppose you wish to direct all DATA logging to a file named
/var/log/apcupsd.data, all EVENTS to the standard /var/log/messages file
(to be mixed with other system messages), and at the same time send all
EVENTS to /var/log/apcupsd.events, and finally, you want to send all STA-
TUS logging to the named pipe /var/log/apcupsd.status
First as root, you create the named pipe:
mkfifo /var/log/apcupsd.status
Change its permissions as necessary or use the -m option to set them when
creating the pipe.
Then you modify your /etc/syslog.conf file to direct the appropriate levels
of messages where you want them. To accomplish the above, my syslog.conf
file looks like:
# exclude all apcupsd info by default
*.info;local0.none /var/log/messages
# Everything for apcupsd goes here
local0.info;local0.!notice /var/log/apcupsd.data
local0.notice;local0.!warn |/var/log/apcupsd.status
local0.warn /var/log/apcupsd.events
local0.warn /var/log/messages
Developers Notes
All logging functions and all error reporting are now done through the
log
event() subroutine call. Exceptions to this are: initialization code where
printf’s are done, and writing to the status file. Once the initialization code
has completed and the fork() to become a daemon is done, no printf’s are
used. log event() has exactly the same format as syslog(). In fact, the sub-
routine consists of only a syslog() call. If anyone really wishes to log to a
file, the code to do so can easily be done by adding code to log event() in
apclog.c.
120










