apcupsd how to setup and monitor APC UPS units

It really seems limited in that it can mainly give you the things you would see on the physical unit such as load etc..

 


wget https://downloads.sourceforge.net/project/apcupsd/apcupsd%20-%20Stable/3.14.14/apcupsd-3.14.14.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fapcupsd%2Ffiles%2Flatest%2Fdownload&ts=1598115866

 tar -zxvf apcupsd-3.14.14.tar.gz
 cd apcupsd-3.14.14
[root@somebox apcupsd-3.14.14]#
./configure --enable-usb

onfig.status: creating platforms/redhat/awkhaltprog
config.status: creating include/apcconfig.h


Configuration on Sat Aug 22 10:06:14 PDT 2020:

  Host:                       x86_64-unknown-linux-gnu -- redhat
  Apcupsd version:            3.14.14 (31 May 2016)
  Source code location:       .
  Install binaries:           /sbin
  Install config files:       /etc/apcupsd
  Install man files:          ${prefix}/share/man
  Nologin file in:            /etc
  PID directory:              /var/run
  LOG dir (events, status)    /var/log
  LOCK dir (for serial port)  /var/lock
  Power Fail dir              /etc/apcupsd
  Compiler:                   g++ 4.4.7
  Preprocessor flags:          -I/usr/local/include
  Compiler flags:             -g -O2 -fno-exceptions -fno-rtti -Wall -Wno-unused-result
  Linker:                     gcc
  Linker flags:                -L/usr/local/lib64 -L/usr/local/lib
  Host and version:           redhat
  Shutdown Program:           /sbin/shutdown
  Port/Device:                /dev/ttyS0
  Network Info Port (CGI):    3551
  UPSTYPE                     apcsmart
  UPSCABLE                    smart

  drivers (no-* are disabled): apcsmart dumb net no-usb snmp pcnet modbus no-modbus-usb no-test

  enable-nis:                 yes
  with-nisip:                 0.0.0.0
  enable-cgi:                 no
  with-cgi-bin:               /etc/apcupsd
  with-libwrap:              
  enable-pthreads:            yes
  enable-dist-install:        yes
  enable-gapcmon:             no
  enable-apcagent:            no
 
Configuration complete: Run 'make' to build apcuspd.


make




  AR    src/drivers/apcsmart/libapcsmartdrv.a
        src/drivers/dumb
  CXX   src/drivers/dumb/dumboper.c
  CXX   src/drivers/dumb/dumbsetup.c
  AR    src/drivers/dumb/libdumbdrv.a
        src/drivers/net
  CXX   src/drivers/net/net.c
  AR    src/drivers/net/libnetdrv.a
        src/drivers/pcnet
  CXX   src/drivers/pcnet/pcnet.c
  AR    src/drivers/pcnet/libpcnetdrv.a
        src/drivers/snmplite
  CXX   src/drivers/snmplite/apc-mib.cpp
  CXX   src/drivers/snmplite/asn.cpp
  CXX   src/drivers/snmplite/mge-mib.cpp
  CXX   src/drivers/snmplite/mibs.cpp
  CXX   src/drivers/snmplite/rfc1628-mib.cpp
  CXX   src/drivers/snmplite/snmp.cpp
  CXX   src/drivers/snmplite/snmplite.cpp
  AR    src/drivers/snmplite/libsnmplitedrv.a
        src/drivers/modbus
  CXX   src/drivers/modbus/mapping.cpp
  CXX   src/drivers/modbus/modbus.cpp
  CXX   src/drivers/modbus/ModbusComm.cpp
  CXX   src/drivers/modbus/ModbusRs232Comm.cpp
  AR    src/drivers/modbus/libmodbusdrv.a
  CXX   src/drivers/drivers.c
  AR    src/drivers/libdrivers.a
  CXX   src/options.c
  CXX   src/device.c
  CXX   src/reports.c
  CXX   src/action.c
  CXX   src/apcupsd.c
  CXX   src/apcnis.c
  LD    src/apcupsd
  CXX   src/apcaccess.c
  LD    src/apcaccess
  CXX   src/apctest.c
  LD    src/apctest
  CXX   src/smtp.c
  LD    src/smtp
        platforms
        platforms/etc
        platforms/redhat
        doc
  MAN   apcupsd.8 -> apcupsd.man.txt
  MAN   apcaccess.8 -> apcaccess.man.txt
  MAN   apctest.8 -> apctest.man.txt
  MAN   apccontrol.8 -> apccontrol.man.txt
  MAN   apcupsd.conf.5 -> apcupsd.conf.man.txt


mkdir -p /etc/apcupsd/;vi /etc/apcupsd/apcupsd.conf

UPSCABLE smart

UPSTYPE smartups

DEVICE /dev/ttyS0



 ./apcupsd
./apcupsd: Warning: old configuration file found.

./apcupsd: Expected: "## apcupsd.conf v1.1 ##"
./apcupsd: Found:    "
"

./apcupsd: Please check new file format and
./apcupsd: modify accordingly the first line
./apcupsd: of config file.

./apcupsd: Processing config file anyway.
./apcupsd: Bogus configuration value (*invalid-ups-type*)
apcupsd FATAL ERROR in apcconfig.c at line 672
Terminating due to configuration file errors.
[root@somebox src]# vi /etc/apcupsd/apcupsd.conf
[root@somebox src]# ./apcupsd
./apcupsd: Warning: old configuration file found.

./apcupsd: Expected: "## apcupsd.conf v1.1 ##"
./apcupsd: Found:    "UPSCABLE smart
"

./apcupsd: Please check new file format and
./apcupsd: modify accordingly the first line
./apcupsd: of config file.

./apcupsd: Processing config file anyway.
./apcupsd: Bogus configuration value (*invalid-ups-type*)
apcupsd FATAL ERROR in apcconfig.c at line 672
Terminating due to configuration file errors.


#change to this

UPSCABLE usb

UPSTYPE usb
# For USB UPSes, leave the DEVICE directive blank.
DEVICE




 ./apcupsd
./apcupsd: Warning: old configuration file found.

./apcupsd: Expected: "## apcupsd.conf v1.1 ##"
./apcupsd: Found:    "UPSCABLE smart
"

./apcupsd: Please check new file format and
./apcupsd: modify accordingly the first line
./apcupsd: of config file.

./apcupsd: Processing config file anyway.
./apcupsd: Bogus configuration value (*invalid-ups-type*)
apcupsd FATAL ERROR in apcconfig.c at line 672
Terminating due to configuration file errors.
[root@somebox src]# vi /etc/apcupsd/apcupsd.conf
[root@somebox src]# ./apcupsd
./apcupsd: Warning: old configuration file found.

./apcupsd: Expected: "## apcupsd.conf v1.1 ##"
./apcupsd: Found:    "UPSCABLE usb
"

./apcupsd: Please check new file format and
./apcupsd: modify accordingly the first line
./apcupsd: of config file.

./apcupsd: Processing config file anyway.

Apcupsd driver usb not found.
The available apcupsd drivers are:
dumb
apcsmart
net
snmplite
pcnet
modbus

Most likely, you need to add --enable-usb to your ./configure options.

apcupsd FATAL ERROR in apcupsd.c at line 196
Apcupsd cannot continue without a valid driver.





#recompile

./src/apcupsd: Warning: old configuration file found.

./src/apcupsd: Expected: "## apcupsd.conf v1.1 ##"
./src/apcupsd: Found:    "UPSCABLE usb
"

./src/apcupsd: Please check new file format and
./src/apcupsd: modify accordingly the first line
./src/apcupsd: of config file.

./src/apcupsd: Processing config file anyway.



./src/apcaccess
: Warning: old configuration file found.

: Expected: "## apcupsd.conf v1.1 ##"
: Found:    "UPSCABLE usb
"

: Please check new file format and
: modify accordingly the first line
: of config file.

: Processing config file anyway.
APC      : 001,037,0887
DATE     : 2020-08-22 10:11:18 -0700 
HOSTNAME : somebox.home
VERSION  : 3.14.14 (31 May 2016) redhat
UPSNAME  : somebox.home
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  :
STARTTIME: 2020-08-22 10:11:16 -0700 
SHARE    :
MODEL    : Back-UPS NS 1500M2
STATUS   : ONLINE
LINEV    : 120.0 Volts
LOADPCT  : 4.0 Percent
BCHARGE  : 100.0 Percent
TIMELEFT : 131.9 Minutes
MBATTCHG : 10 Percent
MINTIMEL : 5 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 88.0 Volts
HITRANS  : 142.0 Volts
ALARMDEL : No alarm
BATTV    : 27.3 Volts
LASTXFER : Unacceptable line voltage changes
NUMXFERS : 0
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x05000008
SERIALNO : 3B1938X20056 
BATTDATE : 2019-09-16
NOMINV   : 120 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 900 Watts
FIRMWARE : 957.e3 .D USB FW:e3
END APC  : 2020-08-22 10:11:51 -0700 
 


Tags:

apcusd, apc, unitsit, limited, mainly, etc, wget, https, downloads, sourceforge, apcupsd, tar, gz, fsourceforge, fprojects, fapcupsd, ffiles, flatest, fdownload, ts, zxvf, somebox, configure, enable, usb, onfig, creating, platforms, redhat, awkhaltprog, config, apcconfig, configuration, aug, pdt, _, linux, gnu, install, binaries, sbin, prefix, nologin, pid, directory, var, dir, compiler, preprocessor, flags, usr, fno, exceptions, rtti, wno, unused, linker, gcc, lib, shutdown, dev, ttys, info, cgi, upstype, apcsmart, upscable, drivers, disabled, snmp, pcnet, modbus, nis, nisip, bin, libwrap, pthreads, dist, gapcmon, apcagent, apcuspd, ar, src, libapcsmartdrv, cxx, dumboper, dumbsetup, libdumbdrv, libnetdrv, libpcnetdrv, snmplite, mib, cpp, asn, mge, mibs, rfc, libsnmplitedrv, mapping, modbuscomm, modbusrs, comm, libmodbusdrv, libdrivers, apcnis, ld, apcaccess, apctest, smtp, txt, apccontrol, conf, mkdir, vi, smartups, quot, format, modify, accordingly, processing, bogus, invalid, fatal, terminating, errors, upses, directive, valid, recompile, hostname, upsname, upsmode, starttime, ns, online, linev, volts, loadpct, bcharge, timeleft, mbattchg, mintimel, maxtime, medium, lotrans, hitrans, alarmdel, battv, lastxfer, unacceptable, voltage, numxfers, tonbatt, cumonbatt, xoffbatt, selftest, statflag, serialno, battdate, nominv, nombattv, nompower, watts, firmware, fw,

Latest Articles

  • ssh Too many authentication failures not prompting for password
  • LightDM Mint Ubuntu Debian won't start errors Nvidia Graphics
  • WARNING: Unable to determine the path to install the libglvnd EGL vendor library config files. Check that you have pkg-config and the libglvnd development libraries installed, or specify a path with --glvnd-egl-config-path. Linux Ubuntu Mint Debian E
  • How To Upgrade Linux Mint 18.2 to 18.3 to 19.x and 20.x
  • MP3s Won't Play / ID3 Version 2.4 Issues in Cars and Other MP3 Players/CDs/DVDs Solution
  • LXC Containers LXD How to Install and Configure Tutorial Ubuntu Debian Mint
  • GlusterFS HowTo Tutorial For Distributed Storage in Docker, Kubernetes, LXC, KVM, Proxmox
  • Ubuntu Mint audio output not working pulseaudio "pulseaudio[13710]: [pulseaudio] sink-input.c: Failed to create sink input: too many inputs per sink."
  • How To Shrink Dynamically Allocated VM QEMU KVM VMware Disk Image File
  • How To Enable Linux Swapfile Instead of Partition Ubuntu Mint Debian Centos
  • 404 Not Found [IP: 151.101.194.132 80] apt update Debian 11 Bullseye Solution The repository 'http://security.debian.org bullseye/updates Release' does not have a Release file.
  • WARNING: Can't download daily.cvd from db.local.clamav.net freshclam clamav error solution
  • (firefox:9562): LIBDBUSMENU-GLIB-WARNING **: Unable to get session bus: Failed to execute child process "dbus-launch" (No such file or directory) Solution
  • Debian Mint Ubuntu Which Package Provides missing top, ps and w Solution
  • Vbox Virtualbox DNS NAT Network Mode NOT working
  • Docker Tutorial HowTo Install Docker, Use and Create Docker Container Images Clustering Swarm Mode Monitoring Service Hosting Provider
  • Zoom Password Error 'That passcode was incorrect' - Solution Wrong Passcode Wrong Meeting Name
  • How To Startup and Open Remote/Local Folder/Directory in Ubuntu Linux Mint automatically upon login
  • How To Reset Windows Server Password 2019, 2022, 7, 8, 10, 11 Recovery and Removal Guide Using Linux Ubuntu Mint Debian
  • How To Create OpenVPN Server for Secure Remote Corporate Access in Linux Debian/Mint/Ubuntu with client public key authentication