[CentOS] using NUT on centos 5

Fri Sep 17 14:01:47 UTC 2010
Pat and Lori Boyer <pboyer at gmail.com>

I have NUT configured on a few of my CentOS servers. I compiled and
installed from source (2.4.3), so all of my nut-related files sit under
/usr/local/ups. I am using a Liebert UPS. Here's how I have it working:

Connect a serial cable from your server to the UPS (if available; USB is an
option on some models, I think). The nut software can communicate with the
UPS via serial on a ttyS (mine is /dev/ttyS0). This server (directly
attached) must run upsd. Other servers that use the same UPS can communicate
with upsd running on the first server via upsmon. All servers must run
upsmon (this is what actually monitors the UPS).

Configure ups.conf with information about your UPS (mine is liebert). The
nut docs have a list of supported hardware and the drivers that you use for
them (I use the driver 'liebert'):

[liebert]
        driver = liebert
        port = /dev/ttyS0

At least one server attached to each UPS must run upsd. Here's my upsd.conf
(comments removed). Note that the second line uses the IP address of the LAN
interface on your server, so that other machines on the same subnet can
communicate with upsd:

LISTEN 127.0.0.1 3493
LISTEN 172.21.97.1 3493

You have to configure upsd.users to allow access to certain users (one for
each upsmon process that will communicate with upsd). This information will
be used to configure upsmon on the clients. For example, I have two servers
listed here: the local server (server1) and another server attached to the
same UPS (server2):

[server1-ups]
  password  = server1-ups-pass
  upsmon master
[server2-ups]
  password  = server2-ups-pass
  upsmon slave

Configure upsmon.conf on each client. Based on the example above, here's the
upsmon.conf for server1:

FINALDELAY 5
MONITOR liebert at localhost 1 server1-ups server1-ups-pass master

... and the upsmon.conf for server2:

FINALDELAY 5
MONITOR liebert at server1 1 server2-ups server2-ups-pass master

Once you have ups.conf, upsd.conf, upsd.users, and upsmon.conf configured,
you can test you connections like the following:

[root at server1 ~]# /usr/local/ups/bin/upsc liebert at localhost
device.mfr: Liebert
device.model: MultiLink
device.type: ups
driver.name: liebert
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ttyS0
driver.version: 2.4.3
driver.version.internal: 1.02
ups.mfr: Liebert
ups.model: MultiLink
ups.status: OL LB

[root at server2 ~]# /usr/local/ups/bin/upsc liebert at server1
device.mfr: Liebert
device.model: MultiLink
device.type: ups
driver.name: liebert
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ttyS0
driver.version: 2.4.3
driver.version.internal: 1.02
ups.mfr: Liebert
ups.model: MultiLink
ups.status: OL LB

Don't forget to add the nut software to your startup scripts and appropriate
runlevels. Hope this helps.

Pat Boyer


On Tue, Sep 14, 2010 at 11:18 AM, fred smith
<fredex at fcshome.stoneham.ma.us>wrote:

> Hi!
>
> Trying to set up NUT on Centos 5 to monitor a CyberPower 1500AVR UPS.
>
> There seem to be many documents, all of which seem to be not fully
> consistent
> with each other, and most of them aren't up to date.
>
> I'm guessing I should be using udev rather than hal, but I'm somewhat
> stumped on how to figure out what device it should be monitoring. there
> are a bunch of udev rules installed (in
> /lib/udev/rules.d/52-nut-usbups.rules)
> but it's not at all clear to me what, if anything, I'm supposed to do with
> them, or how I cause udev to see them there and do its thing.
>
> there's a document at
> http://fedoranews.org/contributors/kazutoshi_morioka/nut/
> but it doesn't show how to do it with a USB device, only serial.
>
> so I decided to move on and see if it could be made to work without
> that understanding, using whatever I could figure out using the INSTALL
> file that comes with NUT.
>
> And that isn't geting me anywhere, so far.
>
> If anyone out there has had success at setting up NUT on Centos 5 (or RHEL)
> and can offer any advice, I'd appreciate hearing from you.
>
> Thanks in advance!
>
> --
> ---- Fred Smith -- fredex at fcshome.stoneham.ma.us-----------------------------
>  "For him who is able to keep you from falling and to present you before
> his
>            glorious presence without fault and with great joy--
>     to the only God our Savior be glory, majesty, power and authority,
>  through Jesus Christ our Lord, before all ages, now and forevermore!
> Amen."
> ----------------------------- Jude 1:24,25 (niv)
> -----------------------------
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20100917/9c2ff4f6/attachment-0005.html>