Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 763090 - app-metrics/collectd[udev]: install disk plugin udev rule
Summary: app-metrics/collectd[udev]: install disk plugin udev rule
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Deutschmann (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-02 12:48 UTC by Maciej S. Szmigiero
Modified: 2021-02-06 18:54 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej S. Szmigiero 2021-01-02 12:48:59 UTC
app-metrics/collectd[udev] should install the udev rule from "contrib/99-storage-collectd.rules" for the disk plugin to have usable udev attribute for this plugin "UdevNameAttr" option.

This option is required to make sure that the same disk always ends in the same RRD file no matter which particular device node it ends being assigned by the OS.

However, using the most fitting ID_SERIAL udev attribute for this purpose results in data about the whole disk and each partition being mixed together incorrectly, since this attribute has exactly the same value for the whole disk device node and its particular partition nodes.

That's why a new ID_COLLECTD udev attribute is needed, which differentiates between the whole disk and its particular partitions.

This is provided by the aforementioned udev rule file, which should be installed.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2021-02-05 17:42:26 UTC
I am a little bit undecided. We have USE=contrib which will allow you to manually install the file when needed.
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2021-02-05 18:05:13 UTC
Why I am undecided:

1) It's just USE=collectd_plugins_disk which can make use of it when compiled with USE=udev.

2) If you have a problem with changing device names, I think your solution to just address the problem for collectd is wrong. I.e. I think the correct solution would be to write an udev rule for all your disks to ensure persistent names. That way you would tackle the problem in general.

3) So this will become a very specific problem. I.e. you don't care about non-persistent disk names in general but in collectd because of wrong stats. So I tend to say, "in this specific case, set USE=contrib and install the rule on your own"

...but in the end we are also just talking about a simple UDEV rule which will add just additional attributes (useless for most users and everyone who will address the problem in general but it's also just an attribute).
Comment 3 Larry the Git Cow gentoo-dev 2021-02-05 18:09:25 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f41c6647286fb4c39a56753b255cc7ce802bb52

commit 2f41c6647286fb4c39a56753b255cc7ce802bb52
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2021-02-05 17:04:17 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2021-02-05 18:09:13 +0000

    app-metrics/collectd: rev bump
    
    - Migrate to EAPI 7.
    
    - Migrate to LUA eclass. [Bug 752558]
    
    - Migrate to acct-* eclass. [Bug 701254]
    
    - Install UDEV rule when USE=collectd_plugins_disk with USE=udev.
      [Bug 763090]
    
    Bug: https://bugs.gentoo.org/701254
    Closes: https://bugs.gentoo.org/752558
    Closes: https://bugs.gentoo.org/763090
    Package-Manager: Portage-3.0.14, Repoman-3.0.2
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 app-metrics/collectd/collectd-5.12.0-r1.ebuild | 568 +++++++++++++++++++++++++
 1 file changed, 568 insertions(+)
Comment 4 Maciej S. Szmigiero 2021-02-06 18:54:11 UTC
Thanks Thomas.

I agree a system-wide solution would be better, however that's the best thing we have at hand at this moment.
This solution also benefits from being documented in collectd.conf(5).
(To be fair I am bit biased here, since it is me who added this ruleset upstream, but based on something that others were already using).

Anyway, it's great that the rule will now be managed by portage so it will update or uninstall automatically together with the app-metrics/collectd package, rather than an user having to remember to do it manually.