Projet

Général

Profil

Révision 203f993d

ID203f993d27dcc128e0ef2da586170022c824f0f2
Parent eca3d004
Enfant dd8bf640

Ajouté par Frank il y a presque 14 ans

added graph info, added warning & critical alerts, data info, SMART errors and revised the scaling

Voir les différences:

plugins/other/megaraid-controller-information
2 2
#
3 3
# Munin plugin for MegaRAID 
4 4
# This plugin can graph:- Currently Drive Temperature and Error Count
5
#
5
# 
6 6
#---------------------
7
#
8
# Create a symbolic link to MegaRaid_{AdapterNumber}_{temp|error}
7
# Examples
8
# Create a symbolic link to MegaRaid_<AdapterNumber>_<temp|media|other|predictive>
9 9
#       ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_temp
10
#           graph temperature on adapter 0
11
# 
10 12
#       ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_0_error
13
#           graph media errors on adapter 0
14
# 
11 15
#       ln -s /usr/share/munin/plugins/MegaRaid_ /etc/munin/plugins/MegaRaid_1_temp
12
#
16
#           graph temperature on adapter 1
17
# 
13 18
#---------------------
14
#
15
# $Log$
19
# Log
16 20
# Revision 0.1  2011/04/16  idobson
17 21
# -First version only basic support of the MegaRaid controller
18
#
22
# 
19 23
# Revision 0.2  2011/04/17 fkatzenb
20 24
# -Added bash statement to remove the log file created each time MegaCli64 is ran
21 25
# -Added a few comments and visual changes
22
#
26
# 
23 27
# Revision 1.0 2011/04/17 fkatzenb
24 28
# -Revamped Code to symbolic link for sensor type and future growth
25
#
29
# 
26 30
# Revision 1.1 2011/04/17 fkatzenb
27 31
# -Revised scalling
28
#
32
# 
33
# Revision 1.2 2011/04/28 fkatzenb
34
# -Added support for graph_info support
35
# -Added warning & critical alerts support
36
# -Added data info
37
# 
38
# Revision 2.0 2011/04/29 fkatzenb
39
# -Added remaining support for SMART Errors
40
# 
41
# Revision 2.1 2011/04/29 fkatzenb
42
# -Added version information for in the graph description
43
# 
44
# 
29 45
#---------------------
30
#
46
# 
31 47
# Add the following to your /etc/munin/plugin-conf.d/munin-node:
32
#
48
# 
33 49
#       [MegaRaid_*]
34 50
#       user root
35
#
51
# 
36 52
#---------------------
37
#
38
#
53
# 
54
# 
39 55
# Magic markers (optional - used by munin-config and installation scripts):
40
#
56
# 
41 57
#%# family=auto
42 58
#%# capabilities=autoconf
43
#
59
# 
60
my $DisplayVer=2.1;
44 61

  
45 62
use strict;
46 63
use warnings;
......
61 78
my %config = (
62 79
  temp => {
63 80
    lookfor => 'Drive Temperature :',
64
    label => 'Drive Temp',
81
    label => 'Temp',
65 82
    title => "MegaRAID Adapter $Adapter: Drive Temperatures",
66 83
    vtitle => 'Celsius',
67
    graph_args => '--base 1000 -l 0'
84
    graph_args => '--base 1000 -l 0',
85
    warning => '55',
86
    critical => '65',
87
    info_tag => "Temperature (C)",
88
    description => "Internal Temperatures for drives on Adapter $Adapter."
68 89
  },
69 90
  error => {
70 91
    lookfor => 'Media Error Count: ',
71
    label => 'Drive Media Err',
72
    title => "MegaRAID Adapter $Adapter: Media Errors",
92
    label => 'Media Err',
93
    title => "MegaRAID Adapter $Adapter: Media Errors (SMART)",
94
    vtitle => 'Number of Errors',
95
    graph_args => '--base 1000 -l 0',
96
    warning => '',
97
    critical => '',
98
    info_tag => "Media Errors (SMART)",
99
    description => "Number of SMART errors related to the drive's media on Adapter $Adapter."
100
  },
101
  other => {
102
    lookfor => 'Other Error Count: ',
103
    label => 'Other Err',
104
    title => "MegaRAID Adapter $Adapter: Others Errors (SMART)",
73 105
    vtitle => 'Number of Errors',
74
    graph_args => '--base 1000 -l 0'
106
    graph_args => '--base 1000 -l 0',
107
    warning => '',
108
    critical => '',
109
    info_tag => "Other Errors (SMART)",
110
    description => "Number of SMART errors not related to the drive's media on Adapter $Adapter."
75 111
  },
112
  predictive => {
113
    lookfor => 'Predictive Failure Count: ',
114
    label => 'Predictive Err',
115
    title => "MegaRAID Adapter $Adapter: Predictive Errors (SMART)",
116
    vtitle => 'Number of Errors',
117
    graph_args => '--base 1000 -l 0',
118
    warning => '',
119
    critical => '',
120
    info_tag => "Predictive Errors (SMART)",
121
    description => "Number of SMART errors for each drive on Adapter $Adapter."
122
  }
76 123
);
77 124

  
78 125
#Auto config options
......
97 144
   print "graph_args $config{$Type}->{graph_args}\n";
98 145
   print "graph_scale yes\n";
99 146
   print "graph_category disk\n";
147
   print "graph_info $config{$Type}->{description} <br />Generated by MegaRaid_, Version $DisplayVer<br />\n";
100 148
    
101 149
   foreach my $Line (@Output) {
102 150
      $Line=~ s/\r//g;
......
106 154
      if ( $Line=~ m/Slot Number: /i ) { 
107 155
         $DevID=$Line; 
108 156
         $DevID=~ s/Slot Number: //;
109
         print "A".$Adapter."_D".$DevID."_$Type.label Adapter:$Adapter/Disk:$DevID $config{$Type}->{label}\n";
157
         print "A".$Adapter."_D".$DevID."_$Type.label A$Adapter:D$DevID $config{$Type}->{label}\n";
158
         print "A".$Adapter."_D".$DevID."_$Type.info Adapter: $Adapter / Drive: $DevID - $config{$Type}->{info_tag}\n";
159
         if ($config{$Type}->{warning} ne '' ) {
160
            print "A".$Adapter."_D".$DevID."_$Type.warning $config{$Type}->{warning}\n";
161
            }
162
         if ($config{$Type}->{critical} ne '') {
163
            print "A".$Adapter."_D".$DevID."_$Type.critical $config{$Type}->{critical}\n";
164
            }   
110 165
      }
111 166
   } 
112 167
   exit 0;

Formats disponibles : Unified diff