Why not use an include for /etc/collectd/collectd.conf.d/ ?

  • I've set up a stack of collectd, graphite and grafana on my OMV system. But every time I update it breaks the configuration because it removes the lines to include the .d directory.


    This is a pretty standard way to configure everything under Linux in general and Debian in particular.


    We would only need to add these lines to the generation of the config file.

    Code
    <Include "/etc/collectd/collectd.conf.d">
            Filter "*.conf"
    </Include>

    Every time there is an update, I have to insert this back into /etc/collectd/collectd.conf so that my other plugins will load.

    • Offizieller Beitrag

    This is a pretty standard way to configure everything under Linux in general and Debian in particular.

    Yep and OMV is pretty much the same. The idea of OMV is for it to totally control the configs. The scripts that create the config files are already in a run parts directory - /usr/share/openmediavault/mkconf/collectd.d/. You should just create scripts in that directory to create your configs and then they will be written correctly every time.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Oh, thank you!


    I didn't think this was a support thing, more of a suggestion, but if it's actually a supported function, then I guess it ended up being that way! Thanks for the quick response. I was going to select this affected both OMV3 and 4 (I upgraded to 4), but couldn't do that. But now that I know it's a legit thing to put them there, I'll do that and mark this solved.

    • Offizieller Beitrag

    Yes, this is a good idea. I think the current solution is historical and i remember that the collectd package does not use the /etc/collectd/collectd.conf.d directory at the time OMV was starting to use it. I need to check that if there is any good reason to do not use /etc/collectd/collectd.conf.d. If it will be implemented, then in OMV4.

    • Offizieller Beitrag

    For a workaround simply put a file into /usr/share/openmediavault/mkconf/collectd.d/ with



    Bash
    #!/bin/sh
    set -e
    
    
    OMV_COLLECTD_CONFIG=${OMV_COLLECTD_CONFIG:-"/etc/collectd/collectd.conf"}
    cat <<EOF >> ${OMV_COLLECTD_CONFIG}
    <Include "/etc/collectd/collectd.conf.d">
            Filter "*.conf"
    </Include>
    EOF

    Thus your custom configuration is always added when OMV rebuilds the config file.

  • Thank you! Of note; run-parts doesn't like when they're named something like collectd.conf.d. It just skipped over it until I named it 'plugins'.


    I wouldn't think it'd be out of scope of the maintenance of what OMV would use, right? Since CollectD is a pretty standard method of gathering statistics. Granted I'm going a bit beyond OMV's purpose and I'm using it as a collector with graphite and Grafana installed.


    Anyhow, thanks again for the quick help. I really didn't want this to turn into a support question.

    • Offizieller Beitrag

    I wouldn't think it'd be out of scope of the maintenance of what OMV would use, right?

    He just means that is better for omv to create all of the config files than just let random files be placed in the /etc/collectd/collectd.conf.d/ directory. People could forget to delete a file or have duplicate settings or some other scenario that doesn't happen when omv is writing all of the config.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!