APCUPSD.CONF(5)
β¨ NAME β¨
apcupsd.conf β apcupsd(8) configuration file
πΈ DESCRIPTION πΈ
okay so bestie, welcome to APCUPSD.CONF(5), straight out of the File Formats Manual π this is the whole vibe guide and yes it's giving iconic.
apcupsd.conf is the configuration file for the apcupsd(8) program. It's a plain ASCII text file β no binary nonsense, just text, we love that β and it's made up of a bunch of configuration directives that control how the apcupsd program behaves when it's controlling most American Power Conversion Corp (APC) UPSes. π
Also it's the same file the apctest(8) program uses when it's bulk programming the EEPROM in a Smart-UPS model. Double duty, main character energy fr fr.
It will almost certainly be necessary to customise the information in the configuration file to suit your particular configuration and operating requirements. Like, the defaults are cute but they're not you. π
β οΈ okay important bestie: the apcupsd daemon must be restarted in order for changes to the configuration file to become active. Editing and hoping is not a strategy, no cap.
The configuration file directives are explained in the subsections below π
π¦ GENERAL CONFIGURATION DIRECTIVES π¦
UPSNAME <string>β specify a name for the UPS for log files, status reports etc. Give her a name, she deserves one β¨UPSCABLE [ simple | smart | ether | usb | 940-0119A | 940-0127A | 940-0128A | 940-0020B | 940-0020C | 940-0023A | 940-0024B | 940-0024C | 940-1524C | 940-0024G | 940-0095A | 940-0095B | 940-0095C | 940-0625A | MAM-04-02-2000 ]β the type of cable used to connect the UPS to the computer. Pick your fighter πUPSTYPE [ dumb | apcsmart | net | usb | snmp | pcnet | modbus |test ]β the type of APC UPS that you have.DEVICE <name>β the name of the device used for communication between the UPS and the computer. For a USB UPS, you should leave theDEVICEdirective blank andapcupsdwill figure out where the device is located. (she'll find it herself, trust π«Ά)apcsmart:/dev/tty**(serial connection)usb: leave blank! (USB connection)net:hostname:port(NIS connection)snmp:hostname:port:vendor:community(SNMP connection)dumb:/dev/tty**(serial connection)pcnet:ipaddr:username:passphrase(AP9617 SmartSlot card)modbus:/dev/tty**(serial connection)modbus: leave blank (USB connection)
If you have problems, please see the apcupsd manual for more detailed information and comprehensive troubleshooting advice. π
POLLTIME <seconds>β the rate in seconds that the daemon polls the UPS for status. This rate is automatically set to 1 second when the UPS goes on battery, and reset to the specified value when the utility power returns. This setting applies both to directly-attached UPSes and networked UPSes. A low setting will improve the daemon's responsiveness to certain events at the cost of higher CPU utilisation. The default of60is appropriate for most situations.LOCKFILE <path>βapcupsdcreates a lockfile for the serial or USB port in the specified directory. It must be changed when running more than one copy ofapcupsdon the same computer to control multiple UPSes. πSCRIPTDIR <path>β directory in whichapccontroland event scripts are located. Defaults to/usr/local/etc/apcupsd. It must be changed when running more than one copy ofapcupsdon the same computer to control multiple UPSes.PWRFAILDIR <path>β directory in whichapcupsdwrites the powerfail flag file created whenapcupsdinitiates a system shutdown. The directory is checked in halt scripts to determine if turning off the UPS output power is required. Defaults to/var/run. It must be changed when running more than one copy ofapcupsdon the same computer to control multiple UPSes.NOLOGINDIR <path>β directory in whichapcupsdwrites the nologin file which tells the OS to disallow new logins. Defaults to/var/run. It must be changed when running more than one copy ofapcupsdon the same computer to control multiple UPSes.
π₯ NIS CONFIGURATION DIRECTIVES π₯
NETSERVER [ on | off ]β turns the network information server (NIS) on or off. When on,apcupsdserves status and event information over the network. This information is also used by the web-based CGI monitoring programs. The default is set toon. β¨NISIP <IP address>β specifies the IP address of the network interface on whichapcupsdwill listen for incoming connections. The default value is0.0.0.0which means the NIS will listen for connections on all network interfaces. If the computer has more than one interface, you can specify the IP of a single interface to limit connections to that interface. Specifying the loopback address (127.0.0.1) will cause the NIS daemon to accept connections only from the local computer. π¦NISPORT <port>β specifies the port to be used by the NIS daemon. The default is3551which has been received from IANA as the officialapcupsdnetworking port. It must be changed when running more than one copy ofapcupsdon the same computer to control multiple UPSes.EVENTSFILE <filename>β if you want NIS to provide the last 10 events via the network, you must specify a file whereapcupsdwill save these events. The default is:/var/log/apcupsd.events.apcupsdwill save at most the last 50 events to this file. When more than 50 events are saved and a network request for the events arrives,apcupsdwill truncate the file to the most recent 10 events. It must be changed when running more than one copy ofapcupsdon the same computer to control multiple UPSes.
π LOGGING CONFIGURATION DIRECTIVES π
STATTIME <seconds>β specifies the time interval between writes to the status file. If set to zero, the status file will not be written. The status file will disappear in a futureapcupsdversion as its functionality has been replaced by the Network Information Server and theapcaccess(8)program. (rip bestie, you had a good run π)STATFILE <file>β specifies the file to be used when writing the status information. The default is/etc/apcupsd/apcupsd.status. It must be changed when running more than one copy ofapcupsdon the same computer to control multiple UPSes.LOGSTATS [ on | off ]β activate log file. This generates a lot of output, so if you turn this on, be sure that the file defined insyslog.conf(5)forLOG_NOTICEis a named pipe. π¨DATATIME <seconds>β specifies the time interval between writes of the APC PowerChute software-like data information to the log file.FACILITY <log-facility>β change the system logging (syslog) facility. The default isdaemon. This parameter can be useful if you wish to direct theapcupsdsystem logging information to other than your system default files. Seesyslog.conf(5)for details of other possible facilities and general system logging configuration.
π POWER FAILURE CONFIGURATION DIRECTIVES π
ONBATTERYDELAY <seconds>β the number of seconds from when a power failure is detected untilapcupsdreacts with an onbattery event. β‘BATTERYLEVEL <percentage>βapcupsdwill shutdown the system during a power failure when the remaining battery charge falls below the specified percentage. The default is5.MINUTES <minutes>βapcupsdwill shutdown the system during a power failure when the remaining runtime on batteries as internally calculated by the UPS falls below the specified minutes. The default is3.TIMEOUT <seconds>β after a power failure occurs,apcupsdwill shutdown the system after the specified number of seconds have expired. For a Smart-UPS, this should normally be set to zero so that the shutdown time will be determined by the battery level or remaining runtime (see above). This command is, however, useful for a Back-UPS or other simple signalling UPS which does not report battery level or the remaining runtime. It is also useful for testingapcupsdbecause you can force a rapid shutdown by setting a small value (eg60) and turning off the power to the UPS.
TIMEOUT, BATTERYLEVEL, and MINUTES can all be set without problems. apcupsd will initiate a shutdown when the first of these conditions becomes valid. (first one to trigger wins, slay π)
ANNOY <seconds>β specifies the time in seconds between broadcast messages requesting logged in users to log off from the system. This timer starts only when the UPS is running on battery. The default is300seconds (5 minutes).ANNOYDELAY <seconds>β specifies the delay time in seconds before broadcast messages requesting logged in users to log off from the system. This timer starts only after the UPS is running on battery power. This timer is reset when the power returns. The default is60seconds (ie the first request to log off occurs after 60 seconds on battery power). π£NOLOGON [ disable | timeout | percent | minutes | always ]β specifies whenapcupsdshould create the nologon file to prevent users from logging on to the system."disable"preventsapcupsdfrom creating the nologin file."timeout"specifies a specific wait time beforeapcupsdcreates the nologin file."percent"specifies the percentage of battery charge remaining beforeapcupsdcreates the nologin file."minutes"specifies the battery runtime remaining beforeapcupsdcreates the nologin file."always"specifies thatapcupsdshould create the nologin file immediately after a power failure occurs.
This directive is important for allowing systems with BIG UPSes to run normally until the system administrator determines the need for dumping users. It also allows the system administrator to hold the "ANNOY" factor until the /etc/nologin file is created. π
KILLDELAY <seconds>
Bestie, this next directive is lowkey the "okay we're done here" button. It sets the number of seconds apcupsd keeps running after a shutdown has been requested. Once that time is up, apcupsd will attempt to put the UPS into hibernate mode and kill the power to the computer. This exists for operating systems where apcupsd cannot regain control after a shutdown (eg FreeBSD) so it can issue an apcupsd --killpower command. Set the delay to 0 and the whole thing is disabled. β¨
π SHARE-UPS CONFIGURATION DIRECTIVES π
UPSCLASS [ standalone | shareslave | sharemaster ]β the vibe check for how this machine relates to the UPS. Default isstandalone, and honestly that's the one you want for all computers powered by the UPS that have a direct connection to the UPS and no other computers depending on power from it. That's the "normal" case, periodt.- Use
shareslaveif you're running a Share-UPS interface expander and you're plugged into the BASIC port (simple signalling). - Use
sharemasterif you're running a Share-UPS interface expander and you're plugged into the ADVANCED port (smart signalling).
- Use
UPSMODE [ disable | share ]β set todisablefor normal standalone operation, which tells everything you are disabling the Share-UPS interface expander support. Set tosharefor two to seven additional simple signalling ports on a Share-UPS interface expander. Heads up though: this code may not be fully tested in every new release. π
π§ APCTEST EEPROM CONFIGURATION DIRECTIVES π§
Okay so these ones are the little backstage crew: they have no effect on the operation of apcupsd(8), but they're reserved for use by apctest(8) when bulk programming the values of the UPS EEPROM configuration variables in a Smart-UPS model.
UPSNAME <string>β name of the UPS. Maximum of 8 characters.BATTDATE [ mm/dd/yy | dd/mm/yy ]β last battery replacement date. Maximum of 8 characters.SENSITIVITY [ H | M | L ]β how jumpy your UPS is about line voltage.H: High (most sensitive setting)M: MediumL: Low (least sensitive setting)
WAKEUP [ 000 | 060 | 180 | 300 ]β the time delay in seconds that the UPS waits after the return of utility power before "waking up" and restoring power to the connected equipment.SLEEP [ 020 | 180 | 300 | 600 ]β the time delay in seconds for which the UPS waits or "sleeps" after it receives a request to power off the connected system.LOTRANSFER <voltage>β low line voltage causing transfer to battery power or activation of SmartBoost. Allowable values depend on the last letter of the firmware orAPCMODEL. Typical values are:
D 106 103 100 097
M 177 172 168 182
A 092 090 088 086
I 208 204 200 196
where D = domestic (USA), M = Canada, A = Asia and I = International.
HITRANSFER <voltage>β high line voltage causing transfer to battery power or activation of SmartTrim. Allowable values depend on the last letter of the firmware orAPCMODEL. Typical values are:
D 127 130 133 136
M 229 234 239 224
A 108 110 112 114
I 253 257 261 265
where D = domestic (USA), M = Canada, A = Asia and I = International.
RETURNCHARGE [ 00 | 15 | 50 | 90 ]β percentage of battery charge needed for the UPS to restore power to the connected equipment.BEEPSTATE [ 0 | T | L | N ]β alarm delay. The beeping schedule, basically.0: Zero delay after power fails.T: When power fails plus 30 seconds.L: When low battery occurs.N: Never.
LOWBATT <minutes>β low battery warning occurs when the specified number of minutes remains before the UPS estimates battery power will be exhausted. There are four user-changeable settings:2,5,7, or10minutes.OUTPUTVOLTS <voltage>β UPS nominal output voltage when running on battery. Allowable values depend on the last letter of the firmware orAPCMODEL. Typical values are:
D 115
M 208
A 100
I 230 240 220 225
where D = domestic (USA), M = Canada, A = Asia and I = International.
SELFTEST [ 336 | 168 | ON | OFF ]β self test interval in hours (336= 2 weeks,168= 1 week,ON= at power on,OFF= never).
π EXAMPLES π
Note that in the following examples, the device names assume that you are using Linux. Device names for serial devices in *BSD and other operating systems will be different.
π¦ Minimal USB Configuration for a USB UPS
UPSCABLE usb
UPSTYPE usb
DEVICE
LOCKFILE /var/lock
UPSCLASS standalone
UPSMODE disable
Notice no device name is specified. apcupsd(8) will try all the well known USB ports. Only specify a specific USB device name if you know what you are doing. For detailed information on setting up a USB UPS, refer to the "USB Configuration" section of the apcupsd manual.
π¦ Minimal Serial Configuration for a Smart UPS
UPSCABLE smart
UPSTYPE apcsmart
DEVICE /dev/ttyS0
LOCKFILE /var/lock
UPSCLASS standalone
UPSMODE disable
Normally there would be more configuration directives to completely customise your installation, but this example shows the minimum required.
π¦ Minimal Serial Configuration for a Dumb UPS
UPSCABLE <number of the cable used>
UPSTYPE dumb
DEVICE /dev/ttyS0
LOCKFILE /var/lock
UPSCLASS standalone
UPSMODE disable
If your cable does not have low battery detection (eg such cables include the APC 940-0020B and 940-0023A), you will also need to define the TIMEOUT <seconds> configuration directive to set the number of seconds on battery during a power failure after which apcupsd will do a system shutdown.
Normally there would be more configuration directives to completely customise your installation, but this example shows the minimum required.
π FILES π
/etc/apcupsd/apcupsd.confβ default configuration file
π SEE ALSO π
syslog.conf(5), apcupsd(8), apctest(8).
The HTML apcupsd manual installed on your system or available online at http://www.apcupsd.org/
π AUTHORS π
- Trevor Roydhouse (current)
- Andre M. Hedrick
- Christopher J. Reimer
And that's a wrap on apcupsd.conf bestie!! π«Ά This whole glow-up is from the apcupsd.conf v3.14.6 era, dated January 10, 2009 β and it lives in section APCUPSD.CONF(5) of the manual. Go forth and configure responsibly, mwah πβ¨
π¦ where this page comes from
- alpine 3.22: apcupsd-doc 3.14.14-r6 Β· GPL-2.0-or-later
- alpine 3.23: apcupsd-doc 3.14.14-r6 Β· GPL-2.0-or-later
- alpine 3.24: apcupsd-doc 3.14.14-r6 Β· GPL-2.0-or-later
- arch rolling: apcupsd 3.14.14-9 Β· GPL
- debian bookworm: apcupsd 3.14.14-3.1+b1 Β· GPL-2.0-or-later
- debian trixie: apcupsd 3.14.14-5 Β· GPL-2.0-or-later
- epel 10: apcupsd 3.14.14-36.el10_1 Β· GPL-2.0-only
- epel 9: apcupsd 3.14.14-35.el9 Β· GPL-2.0-only
- fedora 43: apcupsd 3.14.14-39.fc43 Β· GPL-2.0-only
- fedora 44: apcupsd 3.14.14-41.fc44 Β· GPL-2.0-only
- nixos 26.05: apcupsd 3.14.14
- nixpkgs unstable: apcupsd 3.14.14
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- opensuse-leap 16.0: apcupsd 3.14.14-bp160.1.1 Β· GPL-2.0-only
- ubuntu jammy: apcupsd 3.14.14-3.1build1 Β· GPL-2.0-or-later
- ubuntu noble: apcupsd 3.14.14-3.1build2 Β· GPL-2.0-or-later
- ubuntu questing: apcupsd 3.14.14-5
- ubuntu resolute: apcupsd 3.14.14-7 Β· GPL-2.0-or-later
- ubuntu stonking: apcupsd 3.14.14-7build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms