I am in need of help in getting “nut” set up in Rocky 8, trying with pretty much the same config setting that were working with these same UPSs in CentOS 6.
Killer #1: nut-server can’t connect with either UPS. upsd complains,
“Can’t connect to UPS [Cyber-2] (usbhid-ups-Cyber-2): No such file or directory”, and
Can’t connect to UPS [Cyber-1] (usbhid-ups-Cyber-1): No such file or directory".
But, when I run usbhid-ups manually with the same port, vendorid, and productid arguments that are in the /etc/ups/ups.conf file, it finds the devices just fine and sets up the sockets in /run (with the wrong SELinux context since I ran the command from unconfined_t, and nut_ups_t isn’t allowed to connect to it).
Killer #2:
Solved -- needs network-online.target
nut-server cannot listen on my LAN address. It only connects to my loopback address. I get the messages:
“nut-server[1492]: not listening on 192.168.43.1 port 3493”, and
“upsd[1492]: not listening on 192.168.43.1 port 3493”.
I’ve tried copying /usr/lib/systemd/system/nut-server.service to /etc/systemd/system/ and adding “After=network.target” in the [Unit] section, but to no avail.
This can’t be that hard. Lest this message become tl;dr, I’ll post a separate message with all the changes I’ve made in the supplied /etc/ups/ config files.
I just finished up on a Cacti UPS plugin called apcupsd that will monitor and chart various UPS’. Not quite released yet though. Maybe this week. I was looking at adding NUT support, but the new release is not in many distros yet.
After much discussion with the developer, I finally found the answer. It is necessary to run systemctl enable nut-driver-enumerator.service
in addition to enabling nut.target. An alternative is to manually run systemctl start nut-driver-enumerator.service
initially, and whenever there is a change in the set of configured devices.
There is no hint in the supplied documentation that this step is needed. In fact, the documentation indicates that the enumerator is run automatically.
Anyone with masochistic tendencies is invited to review the above-linked bug report.
INFO file edited.
Plug-in installed and Activated.
Template imported.
Issue is missing table apcupsd_ups in to DB
Log
CMDPHP ERROR: A DB Cell Failed!, Error: Table ‘cacti.apcupsd_ups’ doesn’t exist
CMDPHP SQL Backtrace: (/script_server.php[293]:ss_upsd(), /var/lib/cacti/scripts/ss_upsd.php[67]:db_fetch_cell_prepared(), /lib/database.php[568]:db_execute_prepared())
From Configuration → Plugins → Plugin Management
Disable Plugin
Uninstall Plugin
Log => Purge
I’m waiting for the next check
Check Log
All OK !
From Configuration → Plugins → Plugin Management
Install Plugin
Activate Plugin
Iimmediately look Log for error:
CMDPHP ERROR: A DB Exec Failed!, Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘unsigned NOT NULL DEFAULT 2000, status int(10) unsigned NOT NULL DEFAULT 0,…’ at line 1
That all looks right. Can you check your cacti log and verify that the pollers are running? Also you can go to the Consoleband then to Configuration an Plugins and ensure that the plugin is not only installed but it’s enabled.