-
11Restart NUT Services
```bash
sudo service nut-server restart
sudo service nut-client restart
sudo systemctl restart nut-monitor
sudo upsdrvctl stop
sudo upsdrvctl start
```
Should it fail to start properly, ensure that the service has the directory and rights to worksudo mkdir -p /run/nut
sudo chown nut:nut /run/nut
sudo chmod 755 /run/nut -
12Verify USB Devices
```bash
lsusb
``` -
13Query the device by USB bus (replace with the bus number from the previous command)
```bash
lsusb -D /dev/bus/usb/001/057
```You should see device details like:
```
Device Descriptor:
idVendor 0x051d American Power Conversion
idProduct 0x0002 Uninterruptible Power Supply
``` -
14Install NUT CGI Server
```bash
sudo apt install apache2 nut-cgi
``` -
15Configure hosts for NUT - replace the names with yours
```bash
sudo nano /etc/nut/hosts.conf
```Add:
```ini
MONITOR APC1400VA@localhost "APC1400VA UPS - APOLLO"
MONITOR Trust1500VA@localhost "Trust1500VA UPS - HEPHAESTUS"
MONITOR EATON1150VA@localhost "EATON1150VA UPS - ARTEMIS"
``` -
16Enable CGI in Apache
```bash
sudo a2enmod cgi
sudo systemctl restart apache2
``` -
17Configure NUT CGI settings
```bash
sudo nano /etc/nut/upsset.conf
```Add:
```ini
I_HAVE_SECURED_MY_CGI_DIRECTORY
``` -
18Access the NUT CGI Interface to verify that all works
-
19Now, with everything workign, we can create a service that can be accessed by a webpage or service.
-
20Ensure correct permission are set for remote monitoring
Ensure correct permission are set for remote monitoring
/etc/nut/upsd.users
[monuser]
password = yourpassword
allowfrom = 192.168.1.0/24
upsmon slave
Nicola
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.