mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
added graph info, added warning & critical alerts, data info, SMART errors and revised the scaling
This commit is contained in:
parent
eca3d0044a
commit
203f993d27
1 changed files with 78 additions and 23 deletions
|
@ -2,45 +2,62 @@
|
||||||
#
|
#
|
||||||
# Munin plugin for MegaRAID
|
# Munin plugin for MegaRAID
|
||||||
# This plugin can graph:- Currently Drive Temperature and Error Count
|
# This plugin can graph:- Currently Drive Temperature and Error Count
|
||||||
#
|
#
|
||||||
#---------------------
|
#---------------------
|
||||||
#
|
# Examples
|
||||||
# Create a symbolic link to MegaRaid_{AdapterNumber}_{temp|error}
|
# Create a symbolic link to MegaRaid_<AdapterNumber>_<temp|media|other|predictive>
|
||||||
# ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_temp
|
# ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_temp
|
||||||
|
# graph temperature on adapter 0
|
||||||
|
#
|
||||||
# ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_error
|
# ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_error
|
||||||
|
# graph media errors on adapter 0
|
||||||
|
#
|
||||||
# ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_1_temp
|
# ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_1_temp
|
||||||
#
|
# graph temperature on adapter 1
|
||||||
|
#
|
||||||
#---------------------
|
#---------------------
|
||||||
#
|
# Log
|
||||||
# $Log$
|
|
||||||
# Revision 0.1 2011/04/16 idobson
|
# Revision 0.1 2011/04/16 idobson
|
||||||
# -First version only basic support of the MegaRaid controller
|
# -First version only basic support of the MegaRaid controller
|
||||||
#
|
#
|
||||||
# Revision 0.2 2011/04/17 fkatzenb
|
# Revision 0.2 2011/04/17 fkatzenb
|
||||||
# -Added bash statement to remove the log file created each time MegaCli64 is ran
|
# -Added bash statement to remove the log file created each time MegaCli64 is ran
|
||||||
# -Added a few comments and visual changes
|
# -Added a few comments and visual changes
|
||||||
#
|
#
|
||||||
# Revision 1.0 2011/04/17 fkatzenb
|
# Revision 1.0 2011/04/17 fkatzenb
|
||||||
# -Revamped Code to symbolic link for sensor type and future growth
|
# -Revamped Code to symbolic link for sensor type and future growth
|
||||||
#
|
#
|
||||||
# Revision 1.1 2011/04/17 fkatzenb
|
# Revision 1.1 2011/04/17 fkatzenb
|
||||||
# -Revised scalling
|
# -Revised scalling
|
||||||
#
|
#
|
||||||
|
# Revision 1.2 2011/04/28 fkatzenb
|
||||||
|
# -Added support for graph_info support
|
||||||
|
# -Added warning & critical alerts support
|
||||||
|
# -Added data info
|
||||||
|
#
|
||||||
|
# Revision 2.0 2011/04/29 fkatzenb
|
||||||
|
# -Added remaining support for SMART Errors
|
||||||
|
#
|
||||||
|
# Revision 2.1 2011/04/29 fkatzenb
|
||||||
|
# -Added version information for in the graph description
|
||||||
|
#
|
||||||
|
#
|
||||||
#---------------------
|
#---------------------
|
||||||
#
|
#
|
||||||
# Add the following to your /etc/munin/plugin-conf.d/munin-node:
|
# Add the following to your /etc/munin/plugin-conf.d/munin-node:
|
||||||
#
|
#
|
||||||
# [MegaRaid_*]
|
# [MegaRaid_*]
|
||||||
# user root
|
# user root
|
||||||
#
|
#
|
||||||
#---------------------
|
#---------------------
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Magic markers (optional - used by munin-config and installation scripts):
|
# Magic markers (optional - used by munin-config and installation scripts):
|
||||||
#
|
#
|
||||||
#%# family=auto
|
#%# family=auto
|
||||||
#%# capabilities=autoconf
|
#%# capabilities=autoconf
|
||||||
#
|
#
|
||||||
|
my $DisplayVer=2.1;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
@ -61,18 +78,48 @@ chomp $Command;
|
||||||
my %config = (
|
my %config = (
|
||||||
temp => {
|
temp => {
|
||||||
lookfor => 'Drive Temperature :',
|
lookfor => 'Drive Temperature :',
|
||||||
label => 'Drive Temp',
|
label => 'Temp',
|
||||||
title => "MegaRAID Adapter $Adapter: Drive Temperatures",
|
title => "MegaRAID Adapter $Adapter: Drive Temperatures",
|
||||||
vtitle => 'Celsius',
|
vtitle => 'Celsius',
|
||||||
graph_args => '--base 1000 -l 0'
|
graph_args => '--base 1000 -l 0',
|
||||||
|
warning => '55',
|
||||||
|
critical => '65',
|
||||||
|
info_tag => "Temperature (C)",
|
||||||
|
description => "Internal Temperatures for drives on Adapter $Adapter."
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
lookfor => 'Media Error Count: ',
|
lookfor => 'Media Error Count: ',
|
||||||
label => 'Drive Media Err',
|
label => 'Media Err',
|
||||||
title => "MegaRAID Adapter $Adapter: Media Errors",
|
title => "MegaRAID Adapter $Adapter: Media Errors (SMART)",
|
||||||
vtitle => 'Number of Errors',
|
vtitle => 'Number of Errors',
|
||||||
graph_args => '--base 1000 -l 0'
|
graph_args => '--base 1000 -l 0',
|
||||||
|
warning => '',
|
||||||
|
critical => '',
|
||||||
|
info_tag => "Media Errors (SMART)",
|
||||||
|
description => "Number of SMART errors related to the drive's media on Adapter $Adapter."
|
||||||
},
|
},
|
||||||
|
other => {
|
||||||
|
lookfor => 'Other Error Count: ',
|
||||||
|
label => 'Other Err',
|
||||||
|
title => "MegaRAID Adapter $Adapter: Others Errors (SMART)",
|
||||||
|
vtitle => 'Number of Errors',
|
||||||
|
graph_args => '--base 1000 -l 0',
|
||||||
|
warning => '',
|
||||||
|
critical => '',
|
||||||
|
info_tag => "Other Errors (SMART)",
|
||||||
|
description => "Number of SMART errors not related to the drive's media on Adapter $Adapter."
|
||||||
|
},
|
||||||
|
predictive => {
|
||||||
|
lookfor => 'Predictive Failure Count: ',
|
||||||
|
label => 'Predictive Err',
|
||||||
|
title => "MegaRAID Adapter $Adapter: Predictive Errors (SMART)",
|
||||||
|
vtitle => 'Number of Errors',
|
||||||
|
graph_args => '--base 1000 -l 0',
|
||||||
|
warning => '',
|
||||||
|
critical => '',
|
||||||
|
info_tag => "Predictive Errors (SMART)",
|
||||||
|
description => "Number of SMART errors for each drive on Adapter $Adapter."
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
#Auto config options
|
#Auto config options
|
||||||
|
@ -97,6 +144,7 @@ if ($ARGV[0] and $ARGV[0] eq "config"){
|
||||||
print "graph_args $config{$Type}->{graph_args}\n";
|
print "graph_args $config{$Type}->{graph_args}\n";
|
||||||
print "graph_scale yes\n";
|
print "graph_scale yes\n";
|
||||||
print "graph_category disk\n";
|
print "graph_category disk\n";
|
||||||
|
print "graph_info $config{$Type}->{description} <br />Generated by MegaRaid_, Version $DisplayVer<br />\n";
|
||||||
|
|
||||||
foreach my $Line (@Output) {
|
foreach my $Line (@Output) {
|
||||||
$Line=~ s/\r//g;
|
$Line=~ s/\r//g;
|
||||||
|
@ -106,7 +154,14 @@ if ($ARGV[0] and $ARGV[0] eq "config"){
|
||||||
if ( $Line=~ m/Slot Number: /i ) {
|
if ( $Line=~ m/Slot Number: /i ) {
|
||||||
$DevID=$Line;
|
$DevID=$Line;
|
||||||
$DevID=~ s/Slot Number: //;
|
$DevID=~ s/Slot Number: //;
|
||||||
print "A".$Adapter."_D".$DevID."_$Type.label Adapter:$Adapter/Disk:$DevID $config{$Type}->{label}\n";
|
print "A".$Adapter."_D".$DevID."_$Type.label A$Adapter:D$DevID $config{$Type}->{label}\n";
|
||||||
|
print "A".$Adapter."_D".$DevID."_$Type.info Adapter: $Adapter / Drive: $DevID - $config{$Type}->{info_tag}\n";
|
||||||
|
if ($config{$Type}->{warning} ne '' ) {
|
||||||
|
print "A".$Adapter."_D".$DevID."_$Type.warning $config{$Type}->{warning}\n";
|
||||||
|
}
|
||||||
|
if ($config{$Type}->{critical} ne '') {
|
||||||
|
print "A".$Adapter."_D".$DevID."_$Type.critical $config{$Type}->{critical}\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue