Skip to content
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

contrib/plugins/disk/du-2 does not work first time until du.cache file is created manually #914

Open
Talkless opened this issue Mar 28, 2018 · 4 comments

Comments

@Talkless
Copy link
Contributor

It seems that I have to create /var/lib/munin-node/plugin-state/root/du.cache file manually, or else plugin does not return anything.

strace show that it fails to open that file and exits:

open("/var/lib/munin-node/plugin-state/root/du.cache", O_RDONLY) = -1 ENOENT (No such file or directory)
rt_sigaction(SIGHUP, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0
...
exit_group(1)                           = ?
+++ exited with 1 +++

I'm guessing it's because of

open (FILE, "<", $CACHEFILE) or munin_exit_fail();
and/or
open (FILE, "<", $CACHEFILE) or munin_exit_fail();
statements.

@Talkless
Copy link
Contributor Author

Talkless commented Mar 28, 2018

Seems that it has another problems, like "No .label provided":
munin-du-2

For this config:

[du]
user root
env.dirs /var/lib/postgresql/10/main/pg_wal/ /var/lib/postgresql/9.6/main/pg_xlog/ /var/lib/postgresql/9.6/secondary/pg_xlog/ 
env.interval 5
timeout 300

Any ides how to quick-fix it?

It's munin-node 2.0.33-1~bpo8+1 on Debian 8 (jessie).

@Talkless
Copy link
Contributor Author

I've provided fix for that "No .label provied":
#915

@sumpfralle
Copy link
Collaborator

Thank you for fixing the first half!

The second half looks reasonable, too:

  • fetch: the "daemonize" function should be called before exiting in case of a missing cache file
    • we probably cannot simply call it before the "fetch" section, since this would cause a race condition between writing the new data and reading the old data
  • config: the "config" section should not use the cache, but just go through the list of environment items instead
    • otherwise the master would receive an empty config and would not bother to ask for the values (which is necessary for triggering the "daemonize" function)

It is a bit mysterious, that all previous users of that plugin seem to have "solved" the problem manually without talking about it :(

mikini added a commit to mikini/contrib that referenced this issue Oct 4, 2018
Don't exit with error if cache file is missing, instead refrain from sending values and daemonize() in an attempt to generate one.
Invocation using 'config' before generation is successful will fail, as mentioned in munin-monitoring#914, but configuration will get picked up as soon as it is present.
@github-actions
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants