Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
HOWTO | Monitor the attached UPS via SNMP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-03-30
05:18 AM
2015-03-30
05:18 AM
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! 😎
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! 😎
Message 1 of 1
Labels: