21 February 2013

FreeNAS -8.3.0 UPS control via SNMP

UPS Service configurations to MGE Galaxy 5000 with WEB/SNMP Network Management Card Transverse 66074 - firmware version GG

This card acts as an SNMP agent and as a HTTP/Web server. It enables UPS supervision from the Network Monitoring System using SNMP and traps or simply from a web browser.
FreeNAS communicate with this card by NUT - Network UPS Tool. It would be helpful to read man page for NUT snmp-ups.




- Identifier - name of your UPS

- Driver - From the drop down menu choose the appropriate driver for snmp-ups:
MGE UPS SYSTEMS ups 5 Pulsar / Comet / Galaxy (SNMP) SNMP/Web Transverse card (ref 66074) (snmp-ups) 

Many of the choices listed are in fact the same driver as you can see below
(ups.conf -> driver=snmp-ups). Don’t worry if you select one, save it, and when you come back later to UPS Services menu to discover that a different option is selected - FreeNAS change your choice with the first device driver in drop-down menu with common snmp-ups driver.
- Port is the second most important setting in this configuration - in that case port is IP address of UPS Network Management Card.

- Auxialiary parameters -  All other settings are optional and can be omitted, but beware for correct snmp setting if you use different community and snmp_version. pollfreq is polling frequency in seconds with default value = 30. I made several tests with lower values, but this unnecessarily increase network flow in management VLAN and causes gaps in ups.log data logging.

[root@fnas] ~# cat /etc/local/nut/ups.conf

driver = snmp-ups
port = 192.168.96.41
desc = "UPS1 - MGE Galaxy 5000 60kVA"
community = public
snmp_version = v1
mibs = mge
pollfreq = 30


Freenas message log:


Feb 18 11:10:36 fnas notifier: Detected GALAXY on host 192.168.96.41 (mib: mge 0.5)
Feb 18 11:10:36 fnas notifier: Network UPS Tools - UPS driver controller 2.6.5
Feb 18 11:10:36 fnas notifier: Starting nut.
Feb 18 11:10:36 fnas notifier: fopen /var/db/nut/upsd.pid: No such file or directory
Feb 18 11:10:36 fnas notifier: listening on 127.0.0.1 port 3493
Feb 18 11:10:36 fnas notifier: Connected to UPS [ups]: snmp-ups-ups
Feb 18 11:10:36 fnas notifier: nut_upsmon not running? (check /var/db/nut/upsmon.pid).
Feb 18 11:10:36 fnas notifier: Starting nut_upsmon.
Feb 18 11:10:36 fnas notifier: kill: No such process
Feb 18 11:10:36 fnas notifier: UPS: ups (master) (power value 1)
Feb 18 11:10:36 fnas notifier: nut_upslog not running? (check /var/db/nut/upslog.pid).
Feb 18 11:10:36 fnas notifier: Starting nut_upslog.


Pool the status of UPS

[root@fnas] ~# upsc ups@localhost


ambient.humidity: 0.00
ambient.temperature: 0.0
battery.charge: 100.00
battery.charge.low: 30
battery.runtime: 4860.00
battery.runtime.low: 180.00
battery.voltage: 494.00
device.mfr: Eaton
device.model: GALAXY
device.serial: 1P2J1XXX
device.type: ups
driver.name: snmp-ups
driver.parameter.mibs: mge
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: 192.168.96.41
driver.parameter.snmp_version: v1
driver.version: 2.6.5
driver.version.data: mge MIB 0.5
driver.version.internal: 0.68
input.L1-N.voltage: 400.00
input.L1-N.voltage.maximum: 400.00
input.L1-N.voltage.minimum: 398.00
input.L1.current: 12.00
input.L1.frequency: 50.00
input.L2-N.voltage: 400.00
input.L2-N.voltage.maximum: 400.00
input.L2-N.voltage.minimum: 398.00
input.L2.current: 12.00
input.L2.frequency: 50.00
input.L3-N.voltage: 400.00
input.L3-N.voltage.maximum: 400.00
input.L3-N.voltage.minimum: 398.00
input.L3.current: 12.00
input.L3.frequency: 50.00
input.phases: 3.00
input.transfer.reason:
outlet.desc: Main Outlet
outlet.id: 0
output.L1-N.voltage: 401.00
output.L1.current: 15.60
output.L1.frequency: 50.00
output.L2-N.voltage: 401.00
output.L2.current: 12.70
output.L2.frequency: 50.00
output.L3-N.voltage: 399.00
output.L3.current: 9.50
output.L3.frequency: 50.00
output.phases: 3.00
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.firmware: V1.GDENA7S300IC303
ups.firmware.aux: GG (SN 49EH5XXXX)
ups.L1.load: 13.00
ups.L2.load: 13.00
ups.L3.load: 13.00
ups.mfr: Eaton
ups.model: GALAXY
ups.serial: 1P2J1XXXX
ups.start.auto: no
ups.status: OL
ups.test.result: no test initiated
ups.timer.reboot: -1.00
ups.timer.shutdown: -1.00
ups.timer.start: -1.00


Check ups.log

root@fnas:~cat /var/log/ups.log

20130218 111656 100.00 NA NA [OL] NA NA
20130218 112157 100.00 NA NA [OL] NA NA
20130218 112657 100.00 NA NA [OL] NA NA
20130218 113157 100.00 NA NA [OL] NA NA


Default format of ups.log -
[DATE] [TIME] [battery.charge] [input.voltage] [ups.load] [ups.status] [ups.temperature] [input.frequency]
,i.e. I’ve got info for battery charge (100%) and operational status - OL - (OnLine)

List available commands can be invoked in MGE Galaxy 5000 UPS hardware

[root@fnas] /# upscmd -l ups


Instant commands supported on UPS [ups]:
beeper.disable - Disable the UPS beeper
beeper.enable - Enable the UPS beeper
beeper.mute - Temporarily mute the UPS beeper
load.off - Turn off the load immediately
load.off.delay - Turn off the load with a delay (seconds)
load.on - Turn on the load immediately
load.on.delay - Turn on the load with a delay (seconds)
shutdown.return - Turn off the load and return when power is back
shutdown.stayoff - Turn off the load and remain off
test.battery.start - Start a battery test


View the read/write variables inside mine UPS

[root@fnas] /# upsrw ups
[battery.charge.low]
Remaining battery level when UPS switches to LB (percent)
Type: STRING
Value: 30
[outlet.desc]
Outlet description
Type: STRING
Value: Main Outlet
[ups.delay.shutdown]
Interval to wait after shutdown with delay command (seconds)
Type: STRING
Value: 20
[ups.delay.start]
Interval to wait before (re)starting the load (seconds)
Type: STRING
Value: 30
[ups.start.auto]
UPS starts when mains is (re)applied
Type: UNKNOWN (unrecognized)

Notified applications setup in NMC transverse card via WEB:




Unfortunately my attempts for shutdown test from Notified Applications in WEB interface (picture above) were unsuccessful. General test is when I brake input circuit of the ups:

[root@fnas] /#


Network UPS Tools upsmon 2.6.5
…..
Broadcast Message from root@fnas.hbc
(no tty) at 18:59 EET...
Executing automatic power-fail shutdown

*** FINAL System shutdown message from root@fnas.local ***
System going down IMMEDIATELY


Final e-mail status report:



2 comments:

  1. Good article. I am very happy to see this blog alive :)

    Cheers

    Boyan

    ReplyDelete
  2. Excellent article!

    is it possible to send wake up command when ups comes back to power ?

    Thanks

    ReplyDelete

Note: only a member of this blog may post a comment.