OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • UPS Support
« previous next »
  • Print
Pages: [1]

Author Topic: UPS Support  (Read 28851 times)

smajor

  • Jr. Member
  • **
  • Posts: 77
  • Karma: 10
    • View Profile
UPS Support
« on: June 26, 2015, 01:20:52 am »
I didn't see anything on the roadmap.  I'm curious if we'll eventually see UPS support for graceful shutdowns.

Perhaps when plugin support is added we'll see something like this?:

http://wiki.ipfire.org/en/addons/nut/start
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: UPS Support
« Reply #1 on: June 26, 2015, 07:19:36 am »
apcupsd will be in the next release as an optional package, if somebody steps up and implements the GUI parts that would be awesome.
Logged

guest7876

  • Guest
Re: UPS Support
« Reply #2 on: August 15, 2015, 10:26:52 am »
having apcupsd would be awesome. especially with a GUI to configure it.

Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: UPS Support
« Reply #3 on: August 16, 2015, 05:10:10 pm »
apcupsd package has been available via manual install for a while, a GUI plugin is not currently there.
Logged

guest7876

  • Guest
Re: UPS Support
« Reply #4 on: August 21, 2015, 05:47:16 am »
Quote from: franco on August 16, 2015, 05:10:10 pm
apcupsd package has been available via manual install for a while, a GUI plugin is not currently there.

i dont mind editing the config files by hand for now. and at least it doesnt start twice  and cause all kinds of chaos like it does with the **sense does.
Logged

ezhik

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: UPS Support
« Reply #5 on: October 08, 2016, 01:45:42 am »
Any progress on this? Would be nice to have compatibility with APC/CyberPower UPSs.
Logged

fabian

  • Moderator
  • Hero Member
  • *****
  • Posts: 2769
  • Karma: 200
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: UPS Support
« Reply #6 on: October 08, 2016, 10:18:17 am »
Not that I would be aware of.
Logged

ezhik

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: UPS Support
« Reply #7 on: October 10, 2016, 09:49:21 pm »
Any good guides on how to setup UPS support?

I have CyberPower 850VA. On Linux boxes I've used apcupsd.

Cheers.
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: UPS Support
« Reply #8 on: October 10, 2016, 11:17:10 pm »
Hi there,

We do have packages for apcupsd for amd64/i386:

# pkg install apcupsd

http://www.freebsddiary.org/apcupsd.php

or nut for amd64:

# pkg install nut

https://people.freebsd.org/~thierry/nut_FreeBSD_HowTo.txt

A plugin for these would be nice eventually, but larger construction sites are improving API coverage. If anybody is willing to look into this:

https://docs.opnsense.org/development/examples/helloworld.html


Cheers,
Franco
Logged

ezhik

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: UPS Support
« Reply #9 on: November 06, 2016, 02:51:13 pm »
Thank you.

Going to give this a shot today.

Cheers.
Logged

ezhik

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: UPS Support
« Reply #10 on: December 24, 2016, 06:11:30 pm »
Couldn't get this setup over USB. Always complained that communication was lost. I did setup it up using the "net" driver (over network). However when a shutdown is initiated, instead of shutting down OPNSense reboots... Anybody experienced this issue?
Logged

mw01

  • Newbie
  • *
  • Posts: 31
  • Karma: 4
    • View Profile
Re: UPS Support
« Reply #11 on: December 31, 2016, 03:40:11 pm »
I have it working on an apu2, nano.  Modified the /usr/local/etc/rc.d/apcupsd file to enable and create the "default" lockfile folder on the tmpfs.  The service start file was placed in /etc/rc.conf.d/  To address notifications the apcupsd scripts where changed to provide the Subject: and message piped to a python script, which requires scrutiny.  Looked at the GUI example - will take some time to digest.

#!/usr/local/bin/python2.7

import sys
import smtplib

def prompt(prompt):
    return raw_input(prompt).strip()

fromaddr = 'my@address'
toaddrs  = 'my@address'

email_user = 'myAccount'
email_pwd = 'myPassword'

msg = """\
From: Me<my@address>
To: Me<my@address>
"""

while 1:
    try:
        line = raw_input()
    except EOFError:
        break
    msg = msg + line + "\n"

try:
   server = smtplib.SMTP('smtp.server:587')
   server.ehlo()
   server.starttls()
   server.login(email_user, email_pwd)
   server.sendmail(fromaddr, toaddrs, msg)

except:
    sys.exit( "sendmsg failed:", sys.exc_info()[0] )

finally:
   server.quit()
« Last Edit: January 01, 2017, 05:03:23 pm by mw01 »
Logged

ezhik

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: UPS Support
« Reply #12 on: July 14, 2023, 12:14:09 am »
Has anyone managed to make it work properly? For some reason apcupsd does not shutdown the system, it stays running as if it is waiting for the final manual "power off" by a human...
Logged

vpx23

  • Jr. Member
  • **
  • Posts: 91
  • Karma: 7
    • View Profile
Re: UPS Support
« Reply #13 on: July 15, 2023, 11:57:34 am »
Apcupsd is outdated, did you try NUT?

https://docs.opnsense.org/manual/how-tos/nut.html
Logged

ezhik

  • Newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: UPS Support
« Reply #14 on: July 24, 2023, 11:10:03 pm »
I did not, I will give it a shot. Can it talk to apcupsd master server over the network?

EDIT: It cannot, for obvious compatibility issues.
« Last Edit: July 24, 2023, 11:25:31 pm by ezhik »
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • 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