Hello, I wondered how folks monitored slaves. In my case, I am using Nagios and the check_ups plugin. It seems to work fine but being new to nut, I'm seeking confirmation that this is a sane approach. The goal: confirm the slaves have contact with the master. The environment: * FreeBSD 12.1 * nut-2.7.4 installed from package Background: I am replacing an APC 2200 UPS (still in use) with an Eaton 5PX (5PX2200RT) and an external battery pack (5PXEBM48RT). I'll be doing that changeover tomorrow morning. That is why you'll see load=0 below. The Eaton is powered on, but not powering anything. That comes tomorrow. This is the command line check: $ /usr/local/libexec/nagios/check_ups -H 10.0.0.18 -u ups02 UPS OK - Status=Online Utility=116.5V Batt=100.0% Load=0.0% Left=157.5min|voltage=116.500000;;;0.000000 battery=100.000000%;;;0.000000;100.000000 load=0.000000%;;;0.000000;100.000000 left=157.466667;;;0.000000 where 10.0.0.18 is the slave I want to check and ups02 is the Eaton connected to bast.example.org On each slave, I have this configuration (see https://github.com/dlangille/nut_config): nut.conf: MODE=netclient ups.conf: # see https://networkupstools.org/docs/man/dummy-ups.html # under repeater mode [ups02] driver = dummy-ups # this is the master port = ups02 at bast.example.org desc = "dummy-ups in repeater mode" upsd.conf: LISTEN 127.0.0.1 LISTEN ::1 LISTEN 10.0.0.18 LISTEN 2001:db8::1 upsmon.conf: # yes, there is no shutdown in there yet, this is just testing so far MONITOR ups02 at bast.example.org 1 slocum abcd slave ups.conf exists so check_ups can connect & verify that this host has comms with the master. I'll also create checks to verify the following processes are running: The pid files are here: $ sudo ls -l /var/db/nut total 6 srw-rw---- 1 uucp uucp 0 Sep 3 20:07 dummy-ups-repeater -rw-r--r-- 1 uucp uucp 6 Sep 3 20:07 dummy-ups-repeater.pid srw-rw---- 1 uucp uucp 0 Sep 3 20:14 dummy-ups-ups02 -rw-r--r-- 1 uucp uucp 6 Sep 3 20:14 dummy-ups-ups02.pid -rw-r--r-- 1 uucp uucp 6 Sep 3 20:14 upsd.pid -rw-r--r-- 1 root uucp 6 Sep 4 19:49 upsmon.pid Later, I'll create checks to verify that ups & upsmon are both running. So far, this seems to work great. But it is sane? Thank you. -- Dan Langille dan at langille.org
On Fri, 4 Sep 2020, Dan Langille wrote:> I wondered how folks monitored slaves.A NUT solution is to use a "heartbeat" generated in each slave and monitored in say the master or elsewhere.> The goal: confirm the slaves have contact with the master.On your Github site: Goal: allow host to shutdown when needed. These are not the same goals In NUT, for the shutdown process, this involves upsmon in the master system setting state FSD in each slave's upsd. It's internal to NUT. What other contact do you want to check?> In my case, I am using Nagios and the check_ups plugin. It seems to work fine > but being new to nut, I'm seeking confirmation that this is a sane approach.On your Github site: Each host is monitored via the Nagios check_ups plugin. Do you want to use NUT to manage system shutdowns on power failure?, or is Nagios sufficient for you?> Running on each host is:> [dan at slocum:~] $ ps auwwx | grep ups > root 46270 0.0 0.0 11332 2868 - Ss 19:49 0:00.00 > /usr/local/sbin/upsmon localhost > uucp 46271 0.0 0.0 11596 2896 - S 19:49 0:00.00 > /usr/local/sbin/upsmon localhost > uucp 56305 0.0 0.0 11668 2952 - Ss 20:07 1:05.11 > /usr/local/libexec/nut/dummy-ups -a repeater > uucp 75564 0.0 0.0 11668 2952 - Ss 20:14 1:02.33 > /usr/local/libexec/nut/dummy-ups -a ups02 > uucp 75566 0.0 0.0 110004 2936 - Ss 20:14 0:02.01 > /usr/local/sbin/upsdRunning NUT as uucp is surprising. Do you have a user "nut"? I suggest you set up a working NUT configuration, and then ask the question "Do I need Nagios for UPS management?" Roger
On Fri, Sep 4, 2020, at 5:19 PM, Roger Price wrote:> On Fri, 4 Sep 2020, Dan Langille wrote: > > > I wondered how folks monitored slaves. > > A NUT solution is to use a "heartbeat" generated in each slave and monitored in > say the master or elsewhere.I did find this earlier today: https://alioth-lists.debian.net/pipermail/nut-upsuser/2017-April/010590.html Is that what you mean? I found no reference to heartbeat on the website.> > The goal: confirm the slaves have contact with the master. > > On your Github site: Goal: allow host to shutdown when needed. > > These are not the same goalsYes, please go by what I have in the email. That repo also says "THIS is not a working configuration. I'm still testing. This won't actually shutdown the host."> In NUT, for the shutdown process, this involves upsmon in the master system > setting state FSD in each slave's upsd.Understood.> It's internal to NUT. What other contact do you want to check?I want to know that the NUT instance on the slave is operational.> > In my case, I am using Nagios and the check_ups plugin. It seems to work fine > > but being new to nut, I'm seeking confirmation that this is a sane approach. > > On your Github site: Each host is monitored via the Nagios check_ups plugin. > > Do you want to use NUT to manage system shutdowns on power failure?, or is > Nagios sufficient for you?Yes, eventually, I'll add SHUTDOWN directives to upsmon.conf on the slaves.> > Running on each host is: > > > [dan at slocum:~] $ ps auwwx | grep ups > > root 46270 0.0 0.0 11332 2868 - Ss 19:49 0:00.00 > > /usr/local/sbin/upsmon localhost > > uucp 46271 0.0 0.0 11596 2896 - S 19:49 0:00.00 > > /usr/local/sbin/upsmon localhost > > uucp 56305 0.0 0.0 11668 2952 - Ss 20:07 1:05.11 > > /usr/local/libexec/nut/dummy-ups -a repeater > > uucp 75564 0.0 0.0 11668 2952 - Ss 20:14 1:02.33 > > /usr/local/libexec/nut/dummy-ups -a ups02 > > uucp 75566 0.0 0.0 110004 2936 - Ss 20:14 0:02.01 > > /usr/local/sbin/upsd > > Running NUT as uucp is surprising. Do you have a user "nut"?That is the practice on FreeBSD, decided 14 years ago it seems. I would prefer a dedicated nut user. I notice I can change this at compile time: https://svnweb.freebsd.org/ports/head/sysutils/nut/Makefile?annotate=533996#l19> I suggest you set up a working NUT configuration, and then ask the question "Do > I need Nagios for UPS management?"That will come tomorrow. Nagios is not intended for UPS management. Only for monitoring the services. Thank you. Very helpful -- Dan Langille dan at langille.org