Skip to content

Commit

Permalink
munin_stats plugin: only graph munin-graph if graph_strategy=cron
Browse files Browse the repository at this point in the history
Closes: D:767032
  • Loading branch information
h01ger authored and steveschnepp committed Oct 1, 2016
1 parent bf4fc35 commit ec3128b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions plugins/node.d/munin_stats.in
Expand Up @@ -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 =
Expand All @@ -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";

This comment has been minimized.

Copy link
@kenyon

kenyon Jan 3, 2017

Member

Typo: thre -> three

}
print "graph_args --base 1000 -l 0\n",
"graph_scale yes\n",
"graph_vlabel seconds\n",
"graph_category munin\n";
Expand All @@ -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;
}

Expand Down

0 comments on commit ec3128b

Please sign in to comment.