Enhancement #3413

collectd - monitor only locally connected ups

Added by Filippo Carletti over 3 years ago. Updated over 3 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-nut
Target version:v6.8
Resolution: NEEDINFO:No

Description

Installing nethserver-nut, collectd is automatically configured to connect to a local ups and record vital data (battery, input, voltage, etc).
The ups could be connected to another system and queried over the network (the so called slave setup). In this case, data collection would be run on two or more systems, duplicating information and wasting disk space.
I'd suggest to collectd data only from local ups.

Associated revisions

Revision 50ccaa70
Added by Filippo Carletti over 3 years ago

collectd: do not collectd data from remote (over the network) UPSs. Refs #3413

Revision 7439fd61
Added by Filippo Carletti over 3 years ago

collectd: do not collectd data from remote (over the network) UPSs. Refs #3413

Revision 35d4fd88
Added by Giacomo Sanchietti over 3 years ago

collectd: enable nut plugin only if collectd-nut is installed. Refs #3413

Revision 5763f9c0
Added by Giacomo Sanchietti over 3 years ago

nethserver-collectd-save event: restart collectd Refs #3413

Revision dab83ef8
Added by Giacomo Sanchietti over 3 years ago

collectd: enable nut plugin only if collectd-nut is installed. Refs #3413

- Reworked to read status prop from nut-server key

History

#1 Updated by Filippo Carletti over 3 years ago

  • Status changed from NEW to TRIAGED
  • Assignee set to Filippo Carletti
  • % Done changed from 0 to 20

#2 Updated by Filippo Carletti over 3 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#3 Updated by Filippo Carletti over 3 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Filippo Carletti)
  • % Done changed from 30 to 60

I've push two commits, please review them and build the package.
Verification should test installation on a new system and updating an already running nut server.

#4 Updated by Davide Principi over 3 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

In nethserver-testing:
nethserver-nut-1.1.0-1.2.gee5ae74.ns6.noarch.rpm

#5 Updated by Giacomo Sanchietti over 3 years ago

  • Assignee set to Giacomo Sanchietti

#6 Updated by Giacomo Sanchietti over 3 years ago

  • Status changed from ON_QA to TRIAGED
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 70 to 20

I found two problems:

1. If collectd-nut is not installed, the following error is raised:

Jul 13 09:46:00 localhost collectd[12134]: plugin_load: Could not find plugin "nut" in /usr/lib64/collectd
Jul 13 09:46:00 localhost collectd[12134]: Found a configuration for the `nut' plugin, but the plugin isn't loaded or didn't register a configuration callback.

2. When /etc/collectd.d/nut_nethserver.conf is expanded, collectd is not restared

#7 Updated by Giacomo Sanchietti over 3 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Giacomo Sanchietti
  • % Done changed from 20 to 30

#8 Updated by Giacomo Sanchietti over 3 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60
Changes:
  • nut_nethserver.conf template: enable the collectd plugin only if collectd-nut is installed
  • restart collectd on nethserver-collectd-save event

#9 Updated by Giacomo Sanchietti over 3 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 60 to 70
In nethserver-testing:
  • nethserver-nut-1.1.0-1.6.g5763f9c.ns6.noarch.rpm
Test case 1
  • Install the updated package but not collectd-nut
  • Enable the UPS
  • Check the collectd plugin is not enabled
Test case 2
  • Install the updated package and collectd-nut
  • Enable the UPS
  • Check the collectd plugin is enabled
Test case 3
  • Install the updated package and collectd-nut
  • Disable the UPS (or put it on slave mode)
  • Check the collectd plugin is not enabled

#10 Updated by Filippo Carletti over 3 years ago

  • Status changed from ON_QA to VERIFIED
  • % Done changed from 70 to 90

1.

root@nsrv64a2 ~]# ls -l /usr/lib64/collectd/nut.so
ls: cannot access /usr/lib64/collectd/nut.so: No such file or directory
[root@nsrv64a2 ~]# tail -1 /etc/collectd.d/nut_nethserver.conf 
# no local ups

2.
[root@nsrv64a2 ~]# ls -l /usr/lib64/collectd/nut.so
-rwxr-xr-x. 1 root root 10352 Sep 21  2015 /usr/lib64/collectd/nut.so
[root@nsrv64a2 ~]# tail -5 /etc/collectd.d/nut_nethserver.conf 
LoadPlugin "nut" 
<Plugin "nut">
  UPS "ups@localhost" 
</Plugin> 

3.
[root@nsrv64a2 ~]# tail -1 /etc/collectd.d/nut_nethserver.conf 
# no local ups

#11 Updated by Giacomo Sanchietti over 3 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Released in nethserver-updates:
  • nethserver-nut-1.1.1-1.ns6.noarch.rpm

Also available in: Atom PDF