Trying to get the NUT UPS monitor working

Installed NUT with yast. Followed a Suse guide for 12 and added the following to the etc/usp conf files

ups.conf

driver= usbhid-ups

driver= genericups upstype=20
port=   auto
desc=   "UPS:APC *500 USB"

upsd.conf
LISTEN 127.0.0.1 3493
MAXAGE 35
MAXCONN 16

upsusers.conf
[john]
password = #############
upsmon master

I didn’t add all of this to upsmon.conf - only the first line
MONITOR myups@localhost 1 john master
MINSUPPLIES 1
SHUTDOWNCMD “/sbin/shutdown -h +0”
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower
NOTIFYFLAG ONLINE SYSLOG
NOTIFYFLAG ONBATT SYSLOG+WALL
NOTIFYFLAG COMMOK SYSLOG
NOTIFYFLAG COMMBAD SYSLOG+WALL
NOTIFYFLAG SHUTDOWN SYSLOG
NOTIFYFLAG NOCOMM SYSLOG+WALL
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5

The Suse guide is rather similar to a number that are about.

Not at all sure if the above has done anything. The UPS is an APC SE700. Used 500 as they are the same apart from VA. It uses a usb cable with an rj45 connector for the ups but not sure if it’s serial or true usb hence 2 types of driver, one commented out.

Help :wink:

John

Whenever asking for help,

Provide source and how you installed the app
Provide a link if available or describe the Guide you’re using to set up
If something is failing, be descriptive about what you are running, what you expected to see and what you’re seeing instead including any errors (copy the exact error to your post, if unable to copy the error, take a picture, post somewhere and provide a link to your image).

The NUTS website and documentation
https://networkupstools.org/
https://networkupstools.org/documentation.html

The ArchWiki NUTS article, a 3rd party reference I often use for all topics
https://wiki.archlinux.org/index.php/Network_UPS_Tools

Also,
I’ve never thought twice but have always assumed that the communications cable has its own unique pinout and never thought to try an ethernet patch cable (and wouldn’t recommendt that)

TSU

Note to Tony: Since the OP said he use Yast, I’m guessing that he probably installed “nut” from the standard Leap 15.1 repos.

Note to John_82: I have not used “nut”. I am using “apcupsd” and “apcupsd-gui” with my APC UPS. It seems to work well enough. And yes, my UPS cable is RJ45 at one end and USB at the other. The advice I usually hear, it to go with “apcupsd” for APC devices and with “nut” for UPS from other manufacturers. But I have never tested “nut” so I don’t know if that is good advice.

Personally,
I’ve mainly used PowerChute.

I found the following which might be helpful,
It’s supposed to be a test suite to verify NUT is working properly

https://software.opensuse.org/package/monitoring-plugins-ups

There’s also plenty of documentation in openSUSE packages available, you can download in PDF and HTML formats.

TSU

Thanks for the supportive comments. New day so have started thinking again and had a look at the nut rpm file list. It’s helpful

linux-63yo:/home/john/Documents/Software/KnutSettings/knutsetting-0.2/build # nut-scanner
Scanning USB bus.
No start IP, skipping SNMP
Scanning XML/HTTP bus.
No start IP, skipping NUT bus (old connect method)
Scanning NUT bus (avahi method).
Scanning IPMI bus.
[nutdev1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "051D"
        productid = "0002"
        product = "Back-UPS ES 700G FW:871.O4 .I USB FW:4"
        serial = "5B1708T43072"
        vendor = "APC"
        bus = "001"

The naming of the UPS is confusing as it’s sold as an ES BE700G-UK often with the ES missing. I think that more recent models may have usb on both ends of the lead. I’ve had it for a while from new but hadn’t used it.

So now I know it is true usb rather than the earlier serial line approach that used the same style of lead.

It’s a rather long list of files. It will take me a while to look at them. Any suggestions on what starts it would be helpful as I suspect that may be the problem.

linux-63yo:/home/john/Documents/Software/KnutSettings/knutsetting-0.2/build # rpm -ql nut
/etc/logrotate.d/nut
/etc/sysconfig/SuSEfirewall2.d/services/nut
/etc/ups
/etc/ups/hosts.conf
/etc/ups/nut.conf
/etc/ups/ups.conf
/etc/ups/upsd.conf
/etc/ups/upsd.users
/etc/ups/upsmon.conf
/etc/ups/upssched.conf
/etc/ups/upsset.conf
/usr/bin/nut-scanner
/usr/bin/upsc
/usr/bin/upscmd
/usr/bin/upslog
/usr/bin/upsrw
/usr/bin/upssched-cmd
/usr/lib/systemd/system-shutdown/nutshutdown
/usr/lib/systemd/system-sleep/nut.sh
/usr/lib/systemd/system/nut-driver.service
/usr/lib/systemd/system/nut-monitor.service
/usr/lib/systemd/system/nut-server.service
/usr/lib/udev/rules.d/52-nut-ipmipsu.rules
/usr/lib/udev/rules.d/62-nut-usbups.rules
/usr/lib/ups
/usr/lib/ups/driver
/usr/lib/ups/driver/al175
/usr/lib/ups/driver/apcsmart
/usr/lib/ups/driver/apcsmart-old
/usr/lib/ups/driver/apcupsd-ups
/usr/lib/ups/driver/bcmxcp
/usr/lib/ups/driver/bcmxcp_usb
/usr/lib/ups/driver/belkin
/usr/lib/ups/driver/belkinunv
/usr/lib/ups/driver/bestfcom
/usr/lib/ups/driver/bestfortress
/usr/lib/ups/driver/bestuferrups
/usr/lib/ups/driver/bestups
/usr/lib/ups/driver/blazer_ser
/usr/lib/ups/driver/blazer_usb
/usr/lib/ups/driver/clone
/usr/lib/ups/driver/clone-outlet
/usr/lib/ups/driver/dummy-ups
/usr/lib/ups/driver/etapro
/usr/lib/ups/driver/everups
/usr/lib/ups/driver/gamatronic
/usr/lib/ups/driver/genericups
/usr/lib/ups/driver/isbmex
/usr/lib/ups/driver/ivtscd
/usr/lib/ups/driver/liebert
/usr/lib/ups/driver/liebert-esp2
/usr/lib/ups/driver/masterguard
/usr/lib/ups/driver/metasys
/usr/lib/ups/driver/mge-shut
/usr/lib/ups/driver/mge-utalk
/usr/lib/ups/driver/microdowell
/usr/lib/ups/driver/nut-ipmipsu
/usr/lib/ups/driver/nutdrv_atcl_usb
/usr/lib/ups/driver/nutdrv_qx
/usr/lib/ups/driver/oldmge-shut
/usr/lib/ups/driver/oneac
/usr/lib/ups/driver/optiups
/usr/lib/ups/driver/powercom
/usr/lib/ups/driver/powerman-pdu
/usr/lib/ups/driver/powerpanel
/usr/lib/ups/driver/rhino
/usr/lib/ups/driver/richcomm_usb
/usr/lib/ups/driver/riello_ser
/usr/lib/ups/driver/riello_usb
/usr/lib/ups/driver/safenet
/usr/lib/ups/driver/skel
/usr/lib/ups/driver/solis
/usr/lib/ups/driver/tripplite
/usr/lib/ups/driver/tripplite_usb
/usr/lib/ups/driver/tripplitesu
/usr/lib/ups/driver/upscode2
/usr/lib/ups/driver/usbhid-ups
/usr/lib/ups/driver/victronups
/usr/sbin/rcnut-driver
/usr/sbin/rcnut-monitor
/usr/sbin/rcnut-server
/usr/sbin/upsd
/usr/sbin/upsdrvctl
/usr/sbin/upsmon
/usr/sbin/upssched
/usr/share/bash-completion/completions/nut
/usr/share/doc/packages/nut
/usr/share/doc/packages/nut/AUTHORS
/usr/share/doc/packages/nut/COPYING
/usr/share/doc/packages/nut/ChangeLog
/usr/share/doc/packages/nut/MAINTAINERS
/usr/share/doc/packages/nut/NEWS
/usr/share/doc/packages/nut/README
/usr/share/doc/packages/nut/README.SUSE
/usr/share/doc/packages/nut/UPGRADING
/usr/share/man/man5/hosts.conf.5.gz
/usr/share/man/man5/nut.conf.5.gz
/usr/share/man/man5/ups.conf.5.gz
/usr/share/man/man5/upsd.conf.5.gz
/usr/share/man/man5/upsd.users.5.gz
/usr/share/man/man5/upsmon.conf.5.gz
/usr/share/man/man5/upssched.conf.5.gz
/usr/share/man/man5/upsset.conf.5.gz
/usr/share/man/man5/upsstats.html.5.gz
/usr/share/man/man8/al175.8.gz
/usr/share/man/man8/apcsmart-old.8.gz
/usr/share/man/man8/apcsmart.8.gz
/usr/share/man/man8/apcupsd-ups.8.gz
/usr/share/man/man8/bcmxcp.8.gz
/usr/share/man/man8/bcmxcp_usb.8.gz
/usr/share/man/man8/belkin.8.gz
/usr/share/man/man8/belkinunv.8.gz
/usr/share/man/man8/bestfcom.8.gz
/usr/share/man/man8/bestfortress.8.gz
/usr/share/man/man8/bestuferrups.8.gz
/usr/share/man/man8/bestups.8.gz
/usr/share/man/man8/blazer_ser.8.gz
/usr/share/man/man8/blazer_usb.8.gz
/usr/share/man/man8/clone.8.gz
/usr/share/man/man8/dummy-ups.8.gz
/usr/share/man/man8/etapro.8.gz
/usr/share/man/man8/everups.8.gz
/usr/share/man/man8/gamatronic.8.gz
/usr/share/man/man8/genericups.8.gz
/usr/share/man/man8/isbmex.8.gz
/usr/share/man/man8/ivtscd.8.gz
/usr/share/man/man8/liebert-esp2.8.gz
/usr/share/man/man8/liebert.8.gz
/usr/share/man/man8/masterguard.8.gz
/usr/share/man/man8/metasys.8.gz
/usr/share/man/man8/mge-shut.8.gz
/usr/share/man/man8/mge-utalk.8.gz
/usr/share/man/man8/microdowell.8.gz
/usr/share/man/man8/nut-ipmipsu.8.gz
/usr/share/man/man8/nut-recorder.8.gz
/usr/share/man/man8/nut-scanner.8.gz
/usr/share/man/man8/nutdrv_atcl_usb.8.gz
/usr/share/man/man8/nutdrv_qx.8.gz
/usr/share/man/man8/nutupsdrv.8.gz
/usr/share/man/man8/oneac.8.gz
/usr/share/man/man8/optiups.8.gz
/usr/share/man/man8/powercom.8.gz
/usr/share/man/man8/powerman-pdu.8.gz
/usr/share/man/man8/powerpanel.8.gz
/usr/share/man/man8/rhino.8.gz
/usr/share/man/man8/richcomm_usb.8.gz
/usr/share/man/man8/riello_ser.8.gz
/usr/share/man/man8/riello_usb.8.gz
/usr/share/man/man8/safenet.8.gz
/usr/share/man/man8/solis.8.gz
/usr/share/man/man8/tripplite.8.gz
/usr/share/man/man8/tripplite_usb.8.gz
/usr/share/man/man8/tripplitesu.8.gz
/usr/share/man/man8/upsc.8.gz
/usr/share/man/man8/upscmd.8.gz
/usr/share/man/man8/upscode2.8.gz
/usr/share/man/man8/upsd.8.gz
/usr/share/man/man8/upsdrvctl.8.gz
/usr/share/man/man8/upsimage.cgi.8.gz
/usr/share/man/man8/upslog.8.gz
/usr/share/man/man8/upsmon.8.gz
/usr/share/man/man8/upsrw.8.gz
/usr/share/man/man8/upssched.8.gz
/usr/share/man/man8/upsset.cgi.8.gz
/usr/share/man/man8/upsstats.cgi.8.gz
/usr/share/man/man8/usbhid-ups.8.gz
/usr/share/man/man8/victronups.8.gz
/usr/share/nut
/usr/share/nut/cmdvartab
/usr/share/nut/driver.list
/var/lib/ups

I had it plugged in when I installed. YAST sees it as a UPS but doesn’t take any notice of it. I tried looking for a Linux version of powerchute but can only find windows ones for this unit. ; For the first time in well over 15 years I am dual booting with windows just to allow me to update some items firmware. All is ok in that.

The atraction of nut was that KnutClient is still available. It installs ok but can’t connect.

John

The kernel recognises it


linux-63yo:/home/john/Documents/Software/KnutSettings/knutsetting-0.2/build # usb-devices
  snip
T:  Bus=01 Lev=01 Prnt=01 Port=04 Cnt=04 Dev#=  5 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=051d ProdID=0002 Rev=01.06
S:  Manufacturer=APC
S:  Product=Back-UPS ES 700G FW:871.O4 .I USB FW:O4 
S:  SerialNumber=5B1708T43072  
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=2mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
  snip

A little further. Found a suggestion on the web


john@linux-63yo:~/Documents/Software/KnutSettings/knutsetting-0.2/build> sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
Using subdriver: APC HID 0.96
 

The driver in the nut conf file needs to be the usbhid-ups one. I changed the description to desc= “UPS ES 700G”. Copied from the kernel output. :wink: 2 changes at once so that one may not matter.

Next problem is a ups address for knutclient. Usual suggestion is tty## but don’t think that is appropriate for true usb.

John

This may be a better guide

http://rogerprice.org/NUT/ConfigExamples.A5.pdf

One thing I have noticed is that just as CUPS was for a while it **looks **like NUT uses it’s own passwords system so su and sudo etc may not gain access to it other than to set it up and get it running.

John

Hi
If you check in /dev it should be /dev/ttyUSBn (where n=0,1…)

This seems to be the dreaded error that can crop up how ever it’s used

Error: Connection failure: Network is unreachable

Getting to run seems to be ok. The error crops up when any of it’s utilities are used.

John

Hi
The other thought is udev rules for your device (it may need the id’s added), if you run (as root user) udevadm monitor then connect the device and check the output.

NUT looks interesting, particularly its claim to support numerous power related devices and systems, not just UPS.
A small FYI is that for any Nagios fans out there, there is a company that sells hardware devices that plugs into building HVAC(Nagios and its derivative can be used to monitor just about anything).

Regarding PowerChute and Linux,

With various supporting documentation

if you use the more generic apcupsd,
Although written in the era of SysVinit, the guide looks pretty clear and easy to follow, you’d only need to replace systemd commands for init commands but everything else looks applicable today despite its age (2012).
https://www.cyberciti.biz/faq/debian-ubuntu-centos-rhel-install-apcups/

TSU

It looks like it’s not a good idea to try and get knutclient working. It launches software every time kde is run. This may have been causing problems with the NUT code. It’s available on kde extra and brings a lot of kde4 code in.

:wink: So I used yast repository view to remove it all. Looked ok until I rebooted and came to log back in. :slight_smile: I was presented with a massive keyboard to log in with using the mouse. That worked but suspect it came up with an X desktop variant. Certainly not kde.

So I reinstalled importing my partitioning and instructing install to use the same partition for /home and another I call spare without formatting.

When I logged in this time the desktop was restored to how I left it. Knotes too.

John