OPNsense Forum

Archive => 19.1 Legacy Series => Topic started by: bdario on July 02, 2019, 06:12:32 pm

Title: shutdown Opnsese 19 from UPS [SOLVED]
Post by: bdario on July 02, 2019, 06:12:32 pm
Hello there,
is there a way to graceful shutdown Opnsense 19 in case of blackout?
I mean something similar as a command coming from an UPS
Can someone drive me to an appropriate documentation?
Thank so much
Best regards
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: bartjsmit on July 02, 2019, 06:29:05 pm
Hi Dario,

Install the os-nut plugin and get NUT to manage your UPS, either directly or through the network.

Bart...
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 03, 2019, 03:21:31 pm
dear bartjsmit,
thanks for the quick response.
I'll try your suggestion asap.
Best regards
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 05, 2019, 02:47:39 pm
Hi Bart,
I'm trying to apply your suggestion:
I installed nut plugin into the OpnSense appliance
the UPS is a RIELLO ADG400 connected via USB to the appliance
I tried to configure the nut plugin with USBHID-driver and BlazerUSB-driver but no one works.
The UPS doesn't have LAN port, just USB
Is there a solution to this issue?
Thanks so much for your precious suggestion
with regards
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: mimugmail on July 05, 2019, 04:29:53 pm
When you connect USB cable any news in system.log?
Title: Re: shutdown Opnsese 19 from UPS
Post by: bartjsmit on July 05, 2019, 07:09:42 pm
Hi Dario,

Do you mean the Riello IDG 400? That is supported: https://networkupstools.org/stable-hcl.html but doesn't use the HID or Blaze driver: https://networkupstools.org/docs/man/riello_usb.html

I use a Raspberry Pi as the NUT server since it is cheap, silent and low-power. It may also support a later version of the software.

Bart...
Title: Re: shutdown Opnsese 19 from UPS
Post by: mimugmail on July 05, 2019, 09:55:12 pm
I can add the driver if you are willing to test it :)
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 06, 2019, 02:36:37 pm
Hello everyone,
I am willing to try the riello_usb driver on my appliance (OpnSense 19.1.4-amd64) starting next week.
I only ask for explanations about the installation of the driver
Please remember that my goal is to have a graceful shutdown in case of blackout
Note: the Riello IDG400 UPS is working fine with XigmaNAs (the shutdow is ok)
I thank you all and I wish you a pleasant weekend
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 06, 2019, 02:46:25 pm
Hello,
just an update:
taking a look inside the appliance I found the riello_usb driver:
# ll /usr/local/libexec/nut/riello_usb
-r-xr-xr-x  1 root  wheel  87848 Jul  2 04:08 /usr/local/libexec/nut/riello_usb*

Now I'm a bit confused, why I don't find the riello_usb driver in the Services: Nut: Configuration page of OpnSense?

With Regards
Dario


Title: Re: shutdown Opnsese 19 from UPS
Post by: mimugmail on July 06, 2019, 08:21:29 pm
Already build a PR, will come with 19.7
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 07, 2019, 03:30:06 pm
Hi mimugmail,
when the 19.7 rel will be ready for dowbload ?
Thaks
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: mimugmail on July 07, 2019, 03:32:06 pm
End of July :)
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 07, 2019, 04:03:48 pm
great job
see you
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 24, 2019, 12:06:09 pm
Hello mimugmail,
I just installed the 19.7 rel and enabled the os-nut plugin but still don't find a driver for Riello IDG400 UPS
where am I wrong?
Regards
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: mimugmail on July 24, 2019, 02:00:46 pm
Hi can you remove the plugin and do via console:

pkg install os-nut-devel

If it's working I'd push it to stable, ok?
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 24, 2019, 03:34:15 pm
Hello mimugmail,
I made a clear installation of rel 19.7
then via console I wrote the command "pkg install os-nut-devel" (it ended fine)
after this in Lobby -> Dashboard -> widget Services I find as follow:
service "nut_upsmon" description "Network UPS Monitor" seems started (it's marked in green color)
service "nut_daemon" description "Network UPS Tools" doesn't start (it remains marked in red colour)
obviously the UPS doesn't shutdown the appliance
any suggestion?
feel free to ask me for any test
Thank so much
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: mimugmail on July 24, 2019, 03:35:37 pm
Did you enable the driver via dropdown list?
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 24, 2019, 03:41:17 pm
yep of course
Riello-driver
enable
Extra Arguments: "port=Auto"
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 24, 2019, 03:56:57 pm
after a reboot it seems to work
now in Services -> Nut -> Diagnostics I find data
but disconnecting the UPS from the line th appliance doesn't shut down
Perhaps the UPS needs to reach the end of the battery charge before send the shutdown command to the appliance?
In this case is there a way to force the graceful shutdown?
Thank you
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: mimugmail on July 24, 2019, 03:57:41 pm
Can you have a look at system.log and then disconnect cable and connect again?
Title: Re: shutdown Opnsese 19 from UPS
Post by: mimugmail on July 24, 2019, 03:58:12 pm
after a reboot it seems to work
now in Services -> Nut -> Diagnostics I find data
but disconnecting the UPS from the line th appliance doesn't shut down
Perhaps the UPS needs to reach the end of the battery charge before send the shutdown command to the appliance?
In this case is there a way to force the graceful shutdown?
Thank you
Dario

It shuts firewall down when battey is below 10%
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 24, 2019, 03:59:09 pm
Thank you
I'll wait for it
Best regards
Dario
Title: Re: shutdown Opnsese 19 from UPS
Post by: bdario on July 24, 2019, 04:34:09 pm
ok
now it seems to work fine
Great job
Thank you so much
Dario
Title: Re: shutdown Opnsese 19 from UPS [SOLVED]
Post by: franco on July 25, 2019, 08:08:13 pm
Hi Dario et al,

This be part of the upcoming 19.7.2 release.

Thanks for testing! ;D


Cheers,
Franco