Hi, see attached.
cheers, Holger
From bf5592a73c4d0352c3b24e52a40d0af729d88677 Mon Sep 17 00:00:00 2001 From: Holger Levsen <hol...@layer-acht.org> Date: Mon, 27 Oct 2014 22:19:38 +0100 Subject: [PATCH] munin_stats plugin: only graph munin-graph if graph_strategy=cron (Closes: #767032) --- plugins/node.d/munin_stats.in | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/plugins/node.d/munin_stats.in b/plugins/node.d/munin_stats.in index d85a2cb..dcc5b23 100644 --- a/plugins/node.d/munin_stats.in +++ b/plugins/node.d/munin_stats.in @@ -27,9 +27,14 @@ use strict; use warnings; use Munin::Plugin; +use Munin::Master::GraphOld; -my @logs = qw/update graph html limits/; +my @logs = qw/update html limits/; my $logdir = ($ENV{'logdir'} || $ENV{'MUNIN_LOGDIR'} || '@@LOGDIR@@'); +my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin.conf"; +if (! graph_check_cron() ) { + push (@logs, "graph"); +} if ($ARGV[0] and $ARGV[0] eq 'autoconf') { my $munin_update_location = @@ -51,9 +56,13 @@ if ($ARGV[0] and $ARGV[0] eq 'autoconf') { } if ($ARGV[0] and $ARGV[0] eq "config") { - print "graph_title Munin processing time\n", - "graph_info This graph shows the run time of the four different processes making up a munin-master run. Munin-master is run from cron every 5 minutes and we want each of the programmes in munin-master to complete before the next instance starts. Especially munin-update and munin-graph are time consuming and their run time bears watching. If munin-update uses too long time to run please see the munin-update graph to determine which host is slowing it down. If munin-graph is running too slow you need to get clever (email the munin-users mailing list) unless you can buy a faster computer with better disks to run munin on.\n", - "graph_args --base 1000 -l 0\n", + print "graph_title Munin processing time\n"; + if (! graph_check_cron() ) { + print "graph_info This graph shows the run time of the four different processes making up a munin-master run. Munin-master is run from cron every 5 minutes and we want each of the programmes in munin-master to complete before the next instance starts. Especially munin-update and munin-graph are time consuming and their run time bears watching. If munin-update uses too long time to run please see the munin-update graph to determine which host is slowing it down. If munin-graph is running too slow you need to get clever (email the munin-users mailing list) unless you can buy a faster computer with better disks to run munin on.\n"; + } else { + print "graph_info This graph shows the run time of the thre different processes making up a munin-master run. Munin-master is run from cron every 5 minutes and we want each of the programmes in munin-master to complete before the next instance starts. Especially munin-update is time consuming and its run time bears watching. If munin-update uses too long time to run please see the munin-update graph to determine which host is slowing it down.\n"; + } + print "graph_args --base 1000 -l 0\n", "graph_scale yes\n", "graph_vlabel seconds\n", "graph_category munin\n"; @@ -63,8 +72,10 @@ if ($ARGV[0] and $ARGV[0] eq "config") { } print "update.warning 240\n"; print "update.critical 285\n"; - print "graph.warning 240\n"; - print "graph.critical 285\n"; + if (! graph_check_cron() ) { + print "graph.warning 240\n"; + print "graph.critical 285\n"; + } exit 0; } -- 1.9.1
signature.asc
Description: This is a digitally signed message part.