New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/munin: New options (and some bugfixes) for service configuration #51980
Conversation
5535333
to
e9e90ce
Compare
On further testing, the extraAutoPlugins option doesn't work reliably due to the way Munin searches for plugins. I'll see about fixing that this evening. |
Overall, this gives the munin the necessary portion of care, and shrinks my |
b0c2e64
to
4a263ad
Compare
I've updated tests/munin.nix to use the new disabledPlugins setting, and it seems to work. |
@GrahamcOfBorg build nixosTests.munin |
4a263ad
to
6c5ff52
Compare
Made a small tweak to the CSS commit (so that the example code doesn't look hideous on warning/critical graphs) and added a new commit to bump the Munin version to the latest stable release (and fix a small bug in the build). |
@GrahamcOfBorg build nixosTests.munin |
Is there anything else I need to do here (sync and resolve conflicts?) or is it just waiting for a maintainer to merge it? |
@FRidh do you have time for a review, or can recommend someone else? |
I can agree with everything in this PR, but d2de4ccab1551fc04d206fa1ab967d7e09e4665a is a bit of an oddball. I've never seen an option do such auto-patching in the hopes that it works, but I guess it can't hurt to try it. Are you using those options yourself and have found those patches to be enough for your stuff? |
I am using those options, yes, and I found that to be sufficient. I have a checkout of munin-contrib that I point This quick and dirty patch probably doesn't catch everything, but it's sufficient to get the plugins I wanted working and it doesn't seem to break anything that wasn't already not working. That said, I think the right approach here is to have a separate munin-contrib Nix package and apply these fixes as part of the build process, and/or try to get patches upstreamed to remove hardcoded executable paths from contrib. This was just much faster to do, since I was already working in this file. I don't feel particularly strongly about |
Alright I think it's fine to stay. When my other comment is addressed and the merge conflict fixed this is fine to merge. |
6c5ff52
to
4bdd075
Compare
Since this module was written, Munin has moved their documentation from munin-monitoring.org/wiki to guide.munin-monitoring.org. Most of the links were broken, and the ones that weren't went to "please use the new site" pages.
This lets you specify additional plugin-specific configuration to go in plugin-conf.d, and complements the extraConfig and extraGlobalConfig options.
This is just a set of globs to remove from the active plugins directory after autoconfiguration is complete. I also removed the hard-coded disabling of "diskstats", since it seems to work just fine now.
munin-graph is hardcoded to use DejaVu Mono for the graph legends; if it can't find it, there's no guarantee it finds a monospaced font at all, and if it can't find a monospaced font the legends come out badly misformatted.
extraAutoPlugins lets you list plugins and plugin directories to be autoconfigured, and extraPlugins lets you enable plugins on a one-by-one basis. This can be used to enable plugins from contrib (although you'll need to download and check out contrib yourself, then point these options at it), or plugins you've written yourself.
This permits custom styling of the generated HTML without needing to build your own Munin package from source. Also comes with an example that works as a passable dark theme for Munin.
Some options were missing their types.
munin_update relies on a stats file that exists, but isn't found in the default location on NixOS; the appropriate plugin configuration is added. munin_stats relies on munin-cron writing a logfile, which the NixOS build of munin does not. (This is probably fixable in the munin package, but I don't have time to dig into that right now.)
Also creates the RELEASE file in preBuild so that munin knows its own version number at runtime.
4bdd075
to
85cdd06
Compare
Rebased against latest master, conflicts resolved. |
@GrahamcOfBorg build tests.munin |
@GrahamcOfBorg test munin Edit: Ah that's the same apparently |
Motivation for this change
The old Munin configuration had some outright bugs (wrong fonts used for graph generation, documentation links out of date) and was missing a lot of useful knobs. These changes fix those bugs, and add options for plugin configuration, loading extra plugins, disabling builtin plugins, and applying custom styles to the HTML that Munin generates.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)