Bug 1788874

Summary: [RFE] Please,add information regarding collectd plugins to the SOS report.
Product: Red Hat Enterprise Linux 8 Reporter: Leonid Natapov <lnatapov>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Maros Kopec <makopec>
Severity: medium Docs Contact:
Priority: high    
Version: 8.1CC: agk, bmr, mhradile, mrunge, oblaut, pkilambi, plambri, sbradley
Target Milestone: rcKeywords: FutureFeature
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sos-3.9.1-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:57:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leonid Natapov 2020-01-08 09:41:27 UTC
[RFE] Please,add information regarding collectd plugins to the SOS report.


Collectd plugins are set of plugins that responsible for metrics and statistics.
They are installed as part of Openstack Service Assurance Framework.
We need to collect information regarding collectd plugins in the SOS report.

CloudOps DFG added. Not sure what DFG is related to SOS.

Comment 1 Matthias Runge 2020-01-08 16:24:39 UTC
collectd config is located in /etc/collectd.d/ and /etc/collectd.conf. 
Not sure if we need a plugin for this.

Comment 2 Pavel Moravec 2020-01-10 06:53:08 UTC
We already have collectd plugin:

https://github.com/sosreport/sos/blob/master/sos/plugins/collectd.py

that should collect the config file and dir. Why it does not work in OpenStack?

Could you try:

sosreport -o collectd

?

Further, what package (or file or kernel module) should trigger automatic enabling of the plugin? Currently the plugin is automatically enabled iff collectd package is present - is the package named differently on OSP?

Comment 3 Leonid Natapov 2020-01-12 05:13:31 UTC
(In reply to Pavel Moravec from comment #2)
> We already have collectd plugin:
> 
> https://github.com/sosreport/sos/blob/master/sos/plugins/collectd.py
> 
> that should collect the config file and dir. Why it does not work in
> OpenStack?
> 
> Could you try:
> 
> sosreport -o collectd
> 
> ?
> 
> Further, what package (or file or kernel module) should trigger automatic
> enabling of the plugin? Currently the plugin is automatically enabled iff
> collectd package is present - is the package named differently on OSP?

Hey Pavel,
thanks for reply.
Does it collect also collectd.log file?

COllectd enabled by enabling specific template in overcloud deploy. The name of the template varies between different OSP versions.

Comment 4 Pavel Moravec 2020-01-12 11:40:24 UTC
(In reply to Leonid Natapov from comment #3)
> (In reply to Pavel Moravec from comment #2)
> > We already have collectd plugin:
> > 
> > https://github.com/sosreport/sos/blob/master/sos/plugins/collectd.py
> > 
> > that should collect the config file and dir. Why it does not work in
> > OpenStack?
> > 
> > Could you try:
> > 
> > sosreport -o collectd
> > 
> > ?
> > 
> > Further, what package (or file or kernel module) should trigger automatic
> > enabling of the plugin? Currently the plugin is automatically enabled iff
> > collectd package is present - is the package named differently on OSP?
> 
> Hey Pavel,
> thanks for reply.
> Does it collect also collectd.log file?

Hello,
no, just config file and dir are collected, see

https://github.com/sosreport/sos/blob/master/sos/plugins/collectd.py#L24-L27

> COllectd enabled by enabling specific template in overcloud deploy. The name
> of the template varies between different OSP versions.

So how can sosreport identify it should collect collectd-related data? By presence of some package? Or some file? Or some kernel module loaded? Or some service running? Or some path is an executable file?

Comment 5 Leonid Natapov 2020-01-12 11:48:22 UTC
collectd container should be running. if collectd container is running there will be /var/log/containers/collectd/collectd.log on overcloud nodes.

Comment 6 Leonid Natapov 2020-01-12 11:49:13 UTC
(In reply to Pavel Moravec from comment #4)
> (In reply to Leonid Natapov from comment #3)
> > (In reply to Pavel Moravec from comment #2)
> > > We already have collectd plugin:
> > > 
> > > https://github.com/sosreport/sos/blob/master/sos/plugins/collectd.py
> > > 
> > > that should collect the config file and dir. Why it does not work in
> > > OpenStack?
> > > 
> > > Could you try:
> > > 
> > > sosreport -o collectd
> > > 
> > > ?
> > > 
> > > Further, what package (or file or kernel module) should trigger automatic
> > > enabling of the plugin? Currently the plugin is automatically enabled iff
> > > collectd package is present - is the package named differently on OSP?
> > 
> > Hey Pavel,
> > thanks for reply.
> > Does it collect also collectd.log file?
> 
> Hello,
> no, just config file and dir are collected, see
> 
> https://github.com/sosreport/sos/blob/master/sos/plugins/collectd.py#L24-L27
> 
> > COllectd enabled by enabling specific template in overcloud deploy. The name
> > of the template varies between different OSP versions.
> 
> So how can sosreport identify it should collect collectd-related data? By
> presence of some package? Or some file? Or some kernel module loaded? Or
> some service running? Or some path is an executable file?

collectd container should be running. if collectd container is running there will be /var/log/containers/collectd/collectd.log on overcloud nodes.

Comment 7 Pavel Moravec 2020-01-12 12:05:04 UTC
OK, so when /var/log/containers/collectd/collectd.log file will be present (with this hardcoded path, or with a sysroot prefix as in container?), sosreport will enable collectd plugin that will collect configs and this logfile. Am I right?

Comment 8 Matthias Runge 2020-01-13 07:07:46 UTC
on the baremetal machine, logs are located in /var/log/containers/collectd, the config is under /var/lib/config-data/collectd (and then ./etc/collectd.conf and ./etc/collectd.d/*)
That is true for all openstack nodes, if collectd is enabled.

Comment 9 Pavel Moravec 2020-01-13 16:56:22 UTC
Ah I misunderstood something: collectd runs on a bare metal or VM, but not in a container (I thought the other way). And one can detect so by either presence of the log file, or that collectd container is running - something we can somehow check as well, but not in such a straightforward way.

So does this change help?

# diff -rup /usr/lib/python3.6/site-packages/sos/plugins/collectd.py.orig /usr/lib/python3.6/site-packages/sos/plugins/collectd.py
--- /usr/lib/python3.6/site-packages/sos/plugins/collectd.py.orig	2020-01-13 17:53:59.221893418 +0100
+++ /usr/lib/python3.6/site-packages/sos/plugins/collectd.py	2020-01-13 17:55:01.391310765 +0100
@@ -19,11 +19,13 @@ class Collectd(Plugin, RedHatPlugin, Deb
     profiles = ('services', 'webserver')
 
     packages = ('collectd',)
+    files = ('/var/log/containers/collectd/collectd.log')
 
     def setup(self):
         self.add_copy_spec([
             '/etc/collectd.conf',
             '/etc/collectd.d/*.conf',
+            '/var/log/containers/collectd/collectd.log'
         ])
 
         p = re.compile('^LoadPlugin.*')
#

?

Comment 10 Matthias Runge 2020-01-13 17:40:44 UTC
collectd runs inside a container, but you can access the files from outside, as described above.

Comment 17 errata-xmlrpc 2020-11-04 01:57:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (sos bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:4534