OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Uninterruptible Power Supply (UPS) support
« previous next »
  • Print
Pages: [1] 2

Author Topic: Uninterruptible Power Supply (UPS) support  (Read 12358 times)

schnipp

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: 19
    • View Profile
Uninterruptible Power Supply (UPS) support
« on: March 28, 2018, 07:51:00 pm »
This is a follow up topic of UPS (Uninterruptible Power Supply) related discussion from https://forum.opnsense.org/index.php?topic=7480.msg35033#msg35033



Logged
OPNsense 24.7.9_1-amd64

schnipp

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: 19
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #1 on: March 28, 2018, 07:52:26 pm »
Now, NUT is in running in client mode with a synology diskstation as master. After some debugging NUT is communicating with the UPS daemon. I found out that spaces in the name input field (Nut -> UPS Type -> Netclient) breaks config file scheme.

When disrupting power the ups monitor correctly broadcasts its messages on the console (see below)

    Broadcast Message from root@opnsense.fritz.box
            (no tty) at 17:34 CEST...
    UPS ups@x.x.x.x on battery
   
    Broadcast Message from root@opnsense.fritz.box
            (no tty) at 17:34 CEST...
    UPS ups@x.x.x.x on line power


But, where can I configure additional parameters (voltage, timeout etc.) for tiggering events and what kind of events are supported beside powering down the machine?
Logged
OPNsense 24.7.9_1-amd64

schnipp

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: 19
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #2 on: March 28, 2018, 07:58:42 pm »
Quote from: mimugmail on March 28, 2018, 07:48:11 pm
Can you run some commands like upsc to retrieve some values? I need them to build a status tab.

Where did you configure these values in pf?

Of course, during debugging I tested some commands of the NUT protocol in a raw telnet session connected to the ups master daemon. But, I think we should use the middleware. So, what commands may I use to retrieve information?
Logged
OPNsense 24.7.9_1-amd64

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #3 on: March 28, 2018, 08:42:27 pm »
man upsc I'd guess
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

schnipp

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: 19
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #4 on: March 29, 2018, 09:34:24 am »
Here we go…

root@opnsense:~ # upsc ups@10.3.0.2
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 3312
battery.runtime.low: 300
battery.type: PbAcid
battery.voltage: 16.0
battery.voltage.nominal: 24
device.mfr: CP900EPFCLCD
device.model: CRIB101.6M2
device.serial: CPS
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 5
driver.parameter.port: auto
driver.version: SDS6-0-8700-factory-repack-8700-170413
driver.version.data: CyberPower HID 0.3
driver.version.internal: 0.38
input.transfer.high: 260
input.transfer.low: 170
input.voltage: 225.0
input.voltage.nominal: 230
output.voltage: 260.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 8
ups.mfr: CP900EPFCLCD
ups.model: CRIB101.6M2
ups.productid: 0501
ups.realpower.nominal: 540
ups.serial: CPS
ups.status: OL
ups.test.result: No test initiated
ups.timer.shutdown: -60
ups.timer.start: -60
ups.vendorid: 0764


Please consider that variables not supported by my UPS are not displayed. Further information can be found here (esp. appendix A): http://networkupstools.org/docs/developer-guide.chunked/

Logged
OPNsense 24.7.9_1-amd64

schnipp

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: 19
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #5 on: March 29, 2018, 09:40:36 am »
remote commands supported by the ups (for security reasons blocked by the master daemon due to missing permissions):

root@opnsense:~ # upscmd -l ups@10.3.0.2
Instant commands supported on UPS [ups]:

beeper.disable - Description unavailable
beeper.enable - Description unavailable
beeper.mute - Description unavailable
beeper.off - Description unavailable
beeper.on - Description unavailable
load.off - Description unavailable
load.off.delay - Description unavailable
load.on - Description unavailable
load.on.delay - Description unavailable
shutdown.return - Description unavailable
shutdown.stayoff - Description unavailable
shutdown.stop - Description unavailable
test.battery.start.deep - Description unavailable
test.battery.start.quick - Description unavailable
test.battery.stop - Description unavailable
Logged
OPNsense 24.7.9_1-amd64

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #6 on: March 29, 2018, 10:14:13 am »
Cool! I'll build a page for this.

Regarding commands and parameters .. is it possible you join IRC channel? Would be quite easier to exchange.
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

schnipp

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: 19
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #7 on: April 05, 2018, 06:05:31 pm »
Quote from: mimugmail on March 29, 2018, 10:14:13 am
Cool! I'll build a page for this.

Regarding commands and parameters .. is it possible you join IRC channel? Would be quite easier to exchange.

Great idea. Unfortunately, this will be difficult for me the next time due to high work load  :(
Logged
OPNsense 24.7.9_1-amd64

schnipp

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: 19
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #8 on: April 15, 2018, 05:00:03 pm »
@mimugmail: Can you give me an hint, when the next update (> v.0.3) is out and I can perform some tests? Thanks.
Logged
OPNsense 24.7.9_1-amd64

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #9 on: April 15, 2018, 06:26:44 pm »
18.1.7 will include 0.4 .. still without Diagnostics but working Setup for stabdalone and usbhid Driver. Also remote should be stable then.
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #10 on: May 04, 2018, 06:57:33 am »
With latest 18.1.7 there's 0.6, with support for standalone, netserver via NAT and netclient. Also a diagnostics page is included. Please test so this plugin can go stable  8)
« Last Edit: May 04, 2018, 09:51:14 am by mimugmail »
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

schnipp

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: 19
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #11 on: May 06, 2018, 02:48:35 pm »
After update I had re-enter the ups name. Now it runs fine in netclient mode and also the diagnostics page shows the attributes and their values.

But the dashboard says that nut is not running, which is not the case.
Logged
OPNsense 24.7.9_1-amd64

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #12 on: May 06, 2018, 03:31:50 pm »
Nut is indeed not running, only upsmon at the bottom.
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

schnipp

  • Sr. Member
  • ****
  • Posts: 378
  • Karma: 19
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #13 on: May 06, 2018, 04:30:21 pm »
Quote from: mimugmail on May 06, 2018, 03:31:50 pm
Nut is indeed not running, only upsmon at the bottom.

You are right. For me it's a little bit confusing that the services pane shows nut is not running.
Logged
OPNsense 24.7.9_1-amd64

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: Uninterruptible Power Supply (UPS) support
« Reply #14 on: May 06, 2018, 05:10:02 pm »
For me too, but I cant solve it better for now. If it's working for you one reason more to go for 1.0
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

  • Print
Pages: [1] 2
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Uninterruptible Power Supply (UPS) support
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2