From ee72efe041da0bc4c37064fe4ae67d7f4547aa13 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Mon, 12 Jun 2017 21:01:20 +1000 Subject: [PATCH] [http_load_] Document running from cron with munin-run When running from cron, nothing sets MUNIN_PLUGSTATE as needed. Runnig any of the http_load_ plugins through munin-run with the cron argument fixes the issue, otherwise the plugin cannot find its cache, and no data is output. While at it, we also rope-in MUNIN_DEDUG, so we can use --pidebug from munin-run. Signed-off-by: Olivier Mehani --- plugins/http/http_load_ | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/http/http_load_ b/plugins/http/http_load_ index b7153887..2120a8f9 100755 --- a/plugins/http/http_load_ +++ b/plugins/http/http_load_ @@ -36,10 +36,12 @@ # $ echo "http://www.intrafish.no/" >> /etc/munin/urls.txt # # 3. Add a cron job running the plugin with cron as the argument: -# */15 * * * * /usr/share/munin/plugins/http_load_ cron -# should be the user that has write permission to -# the $cachedir directory set below. Set the intervals to -# whatever you want. +# */15 * * * * /usr/sbin/munin-run http_load__loadtime cron +# should be the user that has write permission to the $cachedir +# directory set below. should be any of the configured sites (all +# sites will get updated), likewise, you should replace loadtime by any +# metric that is enabled for that site (all metrics will get updated). +# Set the intervals to whatever you want. # # For verbose output (for debugging) you can do: # sudo -u /usr/share/munin/plugins/http_load_ cron verbose @@ -241,7 +243,10 @@ if($ARGV[0] and $ARGV[0] eq "autoconf") { # read from my $verbose=0; - if($ARGV[1] and $ARGV[1] eq "verbose") { + if( + $ENV{MUNIN_DEBUG} eq "1" or + $ARGV[1] and $ARGV[1] eq "verbose" + ) { $verbose=1; print "Verbose output\n"; }