From 55cb01870b11f0afa03c94b73354fb0f39c1f273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 23 Aug 2012 08:16:50 -0700 Subject: [PATCH 1/2] snmp__apc: have a static title for the graph. Instead of adding model and serial number to the graph itself, use a static title for it and instead provide the model and serial number as part of graph_info. This change makes it much easier to forward the warning/critical statuses back to Icinga (or Nagios), where you have to match the graph title. --- plugins/snmp/snmp__apc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/snmp/snmp__apc b/plugins/snmp/snmp__apc index 0e9cca13..36185d67 100755 --- a/plugins/snmp/snmp__apc +++ b/plugins/snmp/snmp__apc @@ -81,9 +81,10 @@ if ($ARGV[0] and $ARGV[0] eq "config") { my $modelNo = $session->get_single($oidModelNo); my $serialNo = $session->get_single($oidSerialNo); - print "graph_title PDU $modelNo ($serialNo)\n"; - print "graph_vlabel Current drained (A)\n"; + print "graph_title PDU Current Drain\n"; + print "graph_vlabel Ampere\n"; print "graph_category Sensors\n"; + print "graph_info This graph is for $modelNo PDU serial $serialNo\n" for( my $phaseIndex = 1; $phaseIndex <= $numPhases; $phaseIndex++ ) { my $nearOverloadThreshold = $session->get_single($oidNearOverloadThreshold . $phaseIndex); From c8148539761b74112a236bb1659182be6812d463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 23 Aug 2012 08:56:01 -0700 Subject: [PATCH 2/2] plugins: make all of them use graph_vlabel instead of graph_vtitle. --- plugins/disk/megaraid-controller-information | 10 +++++----- plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog | 2 +- plugins/network/netstat_bsd_m_/netstat_bsd_m_ | 2 +- plugins/network/netstat_bsd_s_/netstat_bsd_s_ | 2 +- plugins/sensors/w1-therm | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/disk/megaraid-controller-information b/plugins/disk/megaraid-controller-information index 971c3f4b..fd83fbac 100755 --- a/plugins/disk/megaraid-controller-information +++ b/plugins/disk/megaraid-controller-information @@ -80,7 +80,7 @@ my %config = ( lookfor => 'Drive Temperature :', label => 'Temp', title => "MegaRAID Adapter $Adapter: Drive Temperatures", - vtitle => 'Celsius', + vlabel => 'Celsius', graph_args => '--base 1000 -l 0', warning => '55', critical => '65', @@ -91,7 +91,7 @@ my %config = ( lookfor => 'Media Error Count: ', label => 'Media Err', title => "MegaRAID Adapter $Adapter: Media Errors (SMART)", - vtitle => 'Number of Errors', + vlabel => 'Number of Errors', graph_args => '--base 1000 -l 0', warning => '', critical => '', @@ -102,7 +102,7 @@ my %config = ( lookfor => 'Other Error Count: ', label => 'Other Err', title => "MegaRAID Adapter $Adapter: Others Errors (SMART)", - vtitle => 'Number of Errors', + vlabel => 'Number of Errors', graph_args => '--base 1000 -l 0', warning => '', critical => '', @@ -113,7 +113,7 @@ my %config = ( lookfor => 'Predictive Failure Count: ', label => 'Predictive Err', title => "MegaRAID Adapter $Adapter: Predictive Errors (SMART)", - vtitle => 'Number of Errors', + vlabel => 'Number of Errors', graph_args => '--base 1000 -l 0', warning => '', critical => '', @@ -140,7 +140,7 @@ my @Output=qx($Command); #Munin Config Options if ($ARGV[0] and $ARGV[0] eq "config"){ print "graph_title $config{$Type}->{title}\n"; - print "graph_vtitle $config{$Type}->{vtitle}\n"; + print "graph_vlabel $config{$Type}->{vlabel}\n"; print "graph_args $config{$Type}->{graph_args}\n"; print "graph_scale yes\n"; print "graph_category disk\n"; diff --git a/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog b/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog index 396bd890..8dee790a 100755 --- a/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog +++ b/plugins/ejabberd/ejabberd_scanlog/ejabberd_scanlog @@ -157,7 +157,7 @@ File.open(CACHE_FILE, 'w') { |f| f.write log_info.to_yaml } unless $debug_mode if ARGV.first == 'config' puts < 1}", "graph_category netstat", - "graph_vtitle per second", + "graph_vlabel per second", "graph_order #{labels.map(&:escape).join(' ')}" ] diff --git a/plugins/sensors/w1-therm b/plugins/sensors/w1-therm index dbee0e4f..25b78c48 100755 --- a/plugins/sensors/w1-therm +++ b/plugins/sensors/w1-therm @@ -13,7 +13,7 @@ case "$1" in config) cat << EOF graph_title $TITLE -graph_vtitle Celsius +graph_vlabel Celsius graph_args --base 1000 -l 0 graph_category sensors temp.label $NAME