[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: UPS monitoring with nut



On Fri, Aug 16, 2013 at 07:03:10PM +0930, Ash Narayanan wrote:
> >> A bit of information regarding the setup I'm after:
> >> One Wheezy server connected to UPS via usb (master)
> >> One Wheezy server connected to the first server via ethernet (slave)
> >> Both servers being supplied power by the UPS
> >
> > That's a common situation. On the master you'd want something like:
> >   nut.conf:
> >     MODE=netmaster
> >         [your-ups]
> >           driver = foo
> >           port   = auto (probably, see the driver documentation for more
> >                     options)
> >   upsd.conf:
> >     LISTEN = 127.0.0.1
> >         LISTEN = ::1
> >         LISTEN = A.LAN.IP
> >   upsmon.conf:
> >     MONITOR your-ups@your-host 1 ... (set up a user in upsd.users)
> >
> > And on the slave:
> >   nut.conf:
> >     MODE=netclient
> >   upsmon.conf:
> >     MONITOR your-ups@your-host 1 ... (IOW, the same as on master)
> 
> Thanks Darac. I've got a few questions:
> 1) What do you mean by `A.LAN.IP`? Is that some sort of keyword?

Ah, no. I was just indicating that you'd need to set the master to
listen on an IP to which the slave can talk. That could be a reserved IP
(192.168.x.y) or a public IP. I suspect it could even be a link-local
IPv6 address if you fancy, but I've not tried that.

> 2) I see you've set MONITOR on the slave to the same value as that of
> the master. Could you explain how exactly this directive is used
> (since I can't find a reasonable explanation of it in the docs
> anywhere). Am I right in assuming that it specifies which ups you want
> to monitor?....since you might want to monitor multiple UPSs.

Certainly. UPSMon is, as I understand it, the client part of NUT. UPSd
connects to the UPS itself and listens to the network, UPSMon then
connects to UPSd and is informed of power changes (I *think* it's a push
mechanism. There might be some regular polling going on, too). UPSMon is
the part that tells the computer to begin shutdown.

So, basically, you put UPSd on the computer that's connected to the data
line of the UPS and UPSMon on the computer(s) that are connected to the
power lines of the UPS. For your master, that means you have both UPSd
and UPSMon running.

The syntax of the MONITOR line is "MONITOR <system> <powervalue>
<username> <password> <master|slave>". OK, looks like I missed that last
keyword earlier :) "<system>" refers to the UPS. If you have multiple
UPSes on the same master, you'd put each in a [square bracket] block and
refer to them as upsname@hostname (I have imaginatively titled my APC
SMT750I as smt750i@darac.org.uk). The "<powervalue>" says how many UPSes
are needed to power the system. For most people, that's 1.

The master/slave keyword is used to indicate shutdown timing. Slaves are
shutdown as soon as the battery level becomes critical, then masters.

> 3) The documentation also suggests a syntax for the MONITOR statement
> which requires a username, a password and a master/slave flag. I've
> set the user on the master to be a domain user. Since this user is
> accessible on the slave as well, can the MONITOR statement on the
> slave use the same user?

The username/password for NUT needn't be a system user. NUT doesn't talk
to PAM or anything, it just uses its own authentication, so having a
completely fictitious username/password pair is perfectly acceptable
(and might be desirable).

It all depends on how you want to manage access to the UPS, really. If
you want a user to be able to send a command to the UPS (such as
self-test or power off) using their normal username/password, then yes
you'd put that in upsd.users (but remember to change it when they change
their password etc).

> 
> > I have found that the config files for NUT are well commented and just
> > editing every file in /etc/nut should get you most of the way there.
> > However, if you want to do some reading first, there's the "nut-doc"
> > package which will put a whole load of files into
> > /usr/share/doc/nut-doc. If you find that THAT is out of date, then file
> > a bug report.
> 
> I will have a look at the nut-doc files and see if they help. Thank
> you for that.
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] CAFvbn=Yu8=96O=E=vVNyegO8Ac_=rT9vqQ1m-vK9+p9sPBVRHg@mail.gmail.com">http://lists.debian.org/[🔎] CAFvbn=Yu8=96O=E=vVNyegO8Ac_=rT9vqQ1m-vK9+p9sPBVRHg@mail.gmail.com
> 

Attachment: signature.asc
Description: Digital signature


Reply to: