NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
MacManiak
Mar 30, 2015Aspirant
HOWTO | Monitor the attached UPS via SNMP
Hello.
I've done a little (and really simple) modification on my ReadyNAS Pro 6.
I've created a script called "/usr/local/bin/testups.sh" :
I've executed a chmod to set it as executable :
Then, I've added these lines into the "/etc/snmp/snmpd.conf" :
The last step was to restart the SNMP service.
And now, with Cacti, I can graph the time left (seconds) and the battery level (percent).
Here's a sample of the output generated by a snmpwalk request :
Enjoy! 8)
I've done a little (and really simple) modification on my ReadyNAS Pro 6.
I've created a script called "/usr/local/bin/testups.sh" :
#!/bin/bash
RESULT=`/bin/upsc ups@localhost:3493 | grep $1 | awk '{print $2}'`
echo -e $RESULT
I've executed a chmod to set it as executable :
Lusankya:~# chmod +x /usr/local/bin/testups.sh
Lusankya:~#
Then, I've added these lines into the "/etc/snmp/snmpd.conf" :
extend battery.charge /usr/local/bin/testups.sh charge
extend battery.voltage /usr/local/bin/testups.sh voltage
extend battery.runtime /usr/local/bin/testups.sh runtime
extend ups.mfr /usr/local/bin/testups.sh mfr
extend ups.model /usr/local/bin/testups.sh model
extend ups.serial /usr/local/bin/testups.sh serial
extend ups.status /usr/local/bin/testups.sh status
The last step was to restart the SNMP service.
And now, with Cacti, I can graph the time left (seconds) and the battery level (percent).
Here's a sample of the output generated by a snmpwalk request :
[14:15:42] root@MacMini:2 ~ $ snmpwalk -c public -v 2c lusankya nsExtendOutput1Line
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."ups.mfr" = STRING: EATON
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."ups.model" = STRING: Protection
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."ups.serial" = STRING: xxxxxxxxx
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."ups.status" = STRING: OL
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."battery.charge" = STRING: 100
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."battery.runtime" = STRING: 1129
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."battery.voltage" = STRING: 2.3
[14:15:57] root@MacMini:2 ~ $
Enjoy! 8)
Replies have been turned off for this discussion
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!