UPS-NUT: Getting sats for multiple UPS USB connected on 1 NUT Server

Hi,
I have 3 UPS connected to a Raspberry Pi via USB and have successfully setup NUT to get data from these.
I have setup the SNMP application following the guide below:
https://docs.librenms.org/Extensions/Applications/#ups-nut

I can get data from 1 UPS into LibreNMS
the guide advises multiple UPS can be setup by editing the Variable
*

Optionally if you have multiple UPS or your UPS is not named APCUPS you can specify its name as an argument into /etc/snmp/ups-nut.sh

I’m assuming this is the variable within /etc/snmp/ups-nut.sh
UPS_NAME=“${1:-APCUPS}”
Is there someone who can advise the correct syntax I should use?
Is it UPS_NAME=“${1:-Eaton1,2:-Eaton2,3:-Eaton3}” ?

TIA

I’ve never used this script, but in general, in sh/bash scripts, something like ${1:-APCUPS} would mean read argument 1 from the CLI command and if it isn’t specified the default value is APCUPS. So you shouldn’t need to change this.

That full text of that doc page says…

Optionally if you have multiple UPS or your UPS is not named APCUPS you can specify its name as an argument into /etc/snmp/ups-nut.sh

extend ups-nut /etc/snmp/ups-nut.sh ups1
extend ups-nut /etc/snmp/ups-nut.sh ups2

So it’s saying you need a new extend in your snmpd config for each UPS and you’ll being overriding the default name, APCUPS, with unique arguments.

extend ups-nut /etc/snmp/ups-nut.sh Eaton1
extend ups-nut /etc/snmp/ups-nut.sh Eaton2
extend ups-nut /etc/snmp/ups-nut.sh Eaton3

Thankyou,
This is the line that confused me where it states

I tried adding the ‘extend’ lines and it didn’t bring in the data as required

Do the arguments work? Do you get the right results if you just run…

/etc/snmp/ups-nut.sh Eaton1
/etc/snmp/ups-nut.sh Eaton2
/etc/snmp/ups-nut.sh Eaton3

…on your Pi?

Some other threads are suggesting that the multi-UPS feature might be incomplete.

https://community.librenms.org/t/clarification-question-regarding-ups-nut-application-monitoring/16557

https://community.librenms.org/t/ups-nut-w-multiple-upss/1100

Curious if you’re seeing the same snmpd errors as in the first thread?

I was getting this error, changing the lines as follow resolved the duplicate issue
extend ups-nut …
to
extend ups-nut-eaton1 /etc/snmp/ups-nut.sh Eaton1
extend ups-nut-eaton2 /etc/snmp/ups-nut.sh Eaton2
extend ups-nut-eaton3 /etc/snmp/ups-nut.sh Eaton3

I’m working on the script currently to have work with multiple devices

1 Like