Last modified: Jun. 11, 2010
Contents
1 - Summary
2 - Dependencies
3 - Apcupsd installation
4 - Service configuration
5 - Apcaccess example
6 - Apctray example
7 - Service check
1 - Summary
This guide will show how to install apcupsd in Windows. Apcupsd is used
for power management and controlling of APC UPS's. This has been tested in
Windows 2000, XP, 2003 and 2008.
2 - Dependencies
You will need to have Windows configured to send emails using Blat. You will
will also need some information about the UPS and the UPS cable.
Model number
UPS cable type
The serial port or USB ports will need to be enabled in the BIOS of the
computer. If you enabled the serial port in the BIOS and plan to use it, you
can find out what the serial COM port is by doing the following. Type the
following in at the Run button on the Start Menu. This will open the device
management console.
devmgmt.msc
Expand Port (COM & LPT) to find the serial COM port number in the computer.
For this guide we will use the serial port.
3 - Apcupsd installation
Download the apcupsd Windows package at http://www.apcupsd.org/. Run the
installer and keep all components selected to be installed.
I set the destination folder to be C:\Program Files\apcupsd. Uncheck the box to
edit the client configuration file (apcupsd.conf). On the next screen, keep the
box checked next to Install Apcupsd as a Service and uncheck the box next to
Start Apcupsd now. Next, you will get a message that says the apcupsd service
has been successfully installed.
Keep the box checked to Install the icon in the System Tray. Next, you will get
a message that says the apctray has been successfully installed.
The apcupsd service and the apctray application have been successfully installed.
4 - Service configuration
We need to make a change in the registry to the apcupsd service so that it will
kill the power to the UPS after the computer has been shut down. Open the
registry editor by typing the following at the Run button on the Start Menu.
regedit
Navigate to the following area and change the ImagePath entry to end in -p.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apcupsd
Set it so that the apcupsd service will start when the system starts up. Open
the services management console by typing the following at the Run button on
the Start Menu.
services.msc
Set the Apcupsd UPS Monitor service to have it's startup type to be Automatic.
You can modify the apccontrol script to send email notifications for different
UPS events. The apccontrol script is the following file.
C:\Program Files\apcupsd\etc\apcupsd\apccontrol.bat
Navigate to C:\Program Files\apcupsd\etc\apcupsd and make a backup of the
apccontrol.bat file. Afterwards, edit the apccontrol.bat file.
The configuration file that the apcupsd service will use is the following file.
C:\Program Files\apcupsd\etc\apcupsd\apcupsd.conf
You can create your own configuration file. Here is a simple example. This uses
an APC UPS 940-0095A serial cable.
## apcupsd.conf v1.1 ##
UPSCABLE 940-0095A
UPSTYPE apcsmart
DEVICE COM1
UPSCLASS standalone
UPSMODE disable
Navigate to C:\Program Files\apcupsd\etc\apcupsd and make a backup of the
apcupsd.conf file. Afterwards, edit the apcupsd.conf file.
Open a command prompt and start the apcupsd service.
The service has successfully started. Also, you will now see the apctray icon
in the lower right-hand corner of the screen near where the time is displayed.
5 - Apcaccess example
This command prints the UPS model number, software version, status, load
percentage, battery charge and other information.
6 - Apctray example
You can view the apcaccess information graphically by right-clicking on the
apctray icon and selecting Status.
7 - Service check
Reboot your computer. Log in like normal and check to see that the apcupsd
service is running. Open the services management console by typing the
following at the Run button on the Start Menu.
services.msc
Check to make sure that the apcupsd service has started.
That's it, now you have apcupsd running in Windows.
|