Discussion:
UPS monitoring with nut
(too old to reply)
Ash Narayanan
2013-08-16 03:50:01 UTC
Permalink
I am looking to set up nut (version 2.6.4-2.3) to monitor my ups in
Wheezy but can't seem to find any relevant guides/tutorials. I've
searched through several guides online (including the one pointed to
by http://www.networkupstools.org/documentation.html). For example,
whatever I read seems to suggest existence of these files:
/etc/default/nut
/etc/init.d/nut

My installation does not contain either of those files. On the other
hand, I have:
/etc/init.d/nut-client
/etc/init.d/nut-sever

Also, everything I read seems to require changes to /etc/nut/upsd.conf
with something along the lines of:
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32

My /etc/nut/upsd.conf file only seems to contain LISTEN statements and
reading through some forums, it seems that ACL statements are obsolete
in versions after 2.2.

I can't seem to find any up to date guides. Are there any? Or is one
allowed to upload a package to Debian without any instructions on how
to use it?

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
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/CAFvbn=ZRusr+9tuO2cRaXyRnBZEO82vx+***@mail.gmail.com
Gregory Nowak
2013-08-16 05:00:03 UTC
Permalink
Post by Ash Narayanan
I am looking to set up nut (version 2.6.4-2.3) to monitor my ups in
Wheezy but can't seem to find any relevant guides/tutorials. I've
searched through several guides online (including the one pointed to
by http://www.networkupstools.org/documentation.html). For example,
/etc/default/nut
/etc/init.d/nut
My installation does not contain either of those files. On the other
/etc/init.d/nut-client
/etc/init.d/nut-sever
Also, everything I read seems to require changes to /etc/nut/upsd.conf
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
My /etc/nut/upsd.conf file only seems to contain LISTEN statements and
reading through some forums, it seems that ACL statements are obsolete
in versions after 2.2.
I can't seem to find any up to date guides. Are there any? Or is one
allowed to upload a package to Debian without any instructions on how
to use it?
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
I unfortunately don't use nut, so can't help you with that particular
package. However, you might want to check out apcupsd, and see if it
supports talking to your UPS. I have an APC UPS here connected to a
squeeze server. I do though manually check it once in a while from a
wheezy machine over the network using apcaccess to do so. HTH maybe.

Greg
--
web site: http://www.gregn..net
gpg public key: http://www.gregn..net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

--
Free domains: http://www.eu.org/ or mail dns-***@EU.org
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@gregn.net
Ash Narayanan
2013-08-16 05:20:01 UTC
Permalink
Post by Gregory Nowak
I unfortunately don't use nut, so can't help you with that particular
package. However, you might want to check out apcupsd, and see if it
supports talking to your UPS. I have an APC UPS here connected to a
squeeze server. I do though manually check it once in a while from a
wheezy machine over the network using apcaccess to do so. HTH maybe.
Greg
Thanks Greg. Unfortunately I don't use a APC ups, so that's not an
option for me, which is shame since apcupsd seems so much simpler and
intuitive to set up.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/CAFvbn=aC=2V0a2sPn1rThmaVkbssSNVeo4F4cPHGZor+***@mail.gmail.com
Darac Marjal
2013-08-16 08:50:02 UTC
Permalink
Post by Ash Narayanan
I am looking to set up nut (version 2.6.4-2.3) to monitor my ups in
Wheezy but can't seem to find any relevant guides/tutorials. I've
searched through several guides online (including the one pointed to
by http://www.networkupstools.org/documentation.html). For example,
/etc/default/nut
/etc/init.d/nut
My installation does not contain either of those files. On the other
/etc/init.d/nut-client
/etc/init.d/nut-sever
Also, everything I read seems to require changes to /etc/nut/upsd.conf
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
My /etc/nut/upsd.conf file only seems to contain LISTEN statements and
reading through some forums, it seems that ACL statements are obsolete
in versions after 2.2.
I can't seem to find any up to date guides. Are there any? Or is one
allowed to upload a package to Debian without any instructions on how
to use it?
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.
Post by Ash Narayanan
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-***@your-host 1 ... (set up a user in upsd.users)

And on the slave:
nut.conf:
MODE=netclient
upsmon.conf:
MONITOR your-***@your-host 1 ... (IOW, the same as on master)
Ash Narayanan
2013-08-16 09:40:01 UTC
Permalink
Post by Darac Marjal
Post by Ash Narayanan
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
MODE=netmaster
[your-ups]
driver = foo
port = auto (probably, see the driver documentation for more
options)
LISTEN = 127.0.0.1
LISTEN = ::1
LISTEN = A.LAN.IP
MODE=netclient
Thanks Darac. I've got a few questions:
1) What do you mean by `A.LAN.IP`? Is that some sort of keyword?
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.
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?
Post by Darac Marjal
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-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/CAFvbn=Yu8=96O=E=vVNyegO8Ac_=rT9vqQ1m-vK9+***@mail.gmail.com
Darac Marjal
2013-08-16 10:00:02 UTC
Permalink
Post by Ash Narayanan
Post by Darac Marjal
Post by Ash Narayanan
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
MODE=netmaster
[your-ups]
driver = foo
port = auto (probably, see the driver documentation for more
options)
LISTEN = 127.0.0.1
LISTEN = ::1
LISTEN = A.LAN.IP
MODE=netclient
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.
Post by Ash Narayanan
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 ***@hostname (I have imaginatively titled my APC
SMT750I as ***@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.
Post by Ash Narayanan
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).
Post by Ash Narayanan
Post by Darac Marjal
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.
--
Chris Bannister
2013-08-16 13:10:02 UTC
Permalink
Post by Ash Narayanan
I can't seem to find any up to date guides. Are there any? Or is one
allowed to upload a package to Debian without any instructions on how
to use it?
Unfortunately, yes. OTOH, if you installed a chess playing program,
would you expect it to teach you how to play?

If you brought a tractor, would you expect instructions on how to grow
corn?

In the past I have struck some software which has very good
documentation; a bit too good -- separating the wheat from the chaff has
mean't having a good knowledge about the subject area BEFORE expecting
to understand the software.

I have also struck software where it seems as if everything is just
dumped on your HDD and you are expected to "sort it out" yourself. :(

IOW, it is not unusual to have to scour the Internet figuring out what
to do with it once it is installed. You may have to look elsewhere for
information regarding the subject area which the software encompasses.
--
"If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the
oppressing." --- Malcolm X
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@tal
Ash Narayanan
2013-08-19 01:50:01 UTC
Permalink
Thanks for the explanation Darac. Makes more sense now.

I had a look at the user manual that comes with nut-doc. In the
configuration section, it requires you to access files under
/usr/local/ups. I do not have this directory.
If you find that THAT is out of date, then file a bug report.
Is that what I do now? Or is there something else I can do before
going down that route?


On Fri, Aug 16, 2013 at 10:38 PM, Chris Bannister
Post by Ash Narayanan
I can't seem to find any up to date guides. Are there any? Or is one
allowed to upload a package to Debian without any instructions on how
to use it?
Unfortunately, yes. OTOH, if you installed a chess playing program,
would you expect it to teach you how to play?
If you brought a tractor, would you expect instructions on how to grow
corn?
I wouldn't expect a chess program to teach me how to play chess but I
would expect (a well documented) one to have instructions on how to
start the program, start a new game, playing modes (single player, two
player), setting AI difficulty, etc, etc.....you know.....what I.T
staff get 'paid' to do.

Similarly, if I bought a tractor, I wouldn't expect it to come with
instructions on how to grow corn but rather engine specs, pre-startup
checks, blade width, max speed, etc, etc.

Appreciate your concern Chris, but in the past, I've found (especially
on Debian forums) that threads tend to turn into philosophical
debates.

Let's try and focus our energy on the topic at hand: Nut.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/CAFvbn=aDMsNbeHkbF4R-A6OT1oOjH+JPR=***@mail.gmail.com
Continue reading on narkive:
Loading...