forked from jrossi/snmp-swraid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
146 lines (107 loc) · 5.24 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
swRaidMIB
Net-SNMP-Plugin for monitoring
Linux RAID devices
(c) Copyright G. Kuhlmann, 2007
This is free software. See COPYING for license.
INTRODUCTION:
============
This software is a loadable plugin module for the Net-SNMP agent to
monitor the software RAID functions of a Linux system. It works by
reading the file /proc/mdstat and providing the information read under
the ucdExperimental OID with sub-ID 18. This sub-ID hasn't been regis-
tered with anyone yet, but it was free at the time this software was
written. The plugin module provides the following read-only variable tree:
+--swRaidMIB(18)
|
+--swRaidTable(1)
| |
| +--swRaidEntry(1)
| | Index: swRaidIndex
| |
| +-- -R-- Integer32 swRaidIndex(1)
| | Range: 0..65535
| +-- -R-- String swRaidDevice(2)
| | Textual Convention: DisplayString
| | Size: 0..255
| +-- -R-- String swRaidPersonality(3)
| | Textual Convention: DisplayString
| | Size: 0..255
| +-- -R-- String swRaidUnits(4)
| | Textual Convention: DisplayString
| | Size: 0..255
| +-- -R-- Integer32 swRaidUnitCount(5)
| +-- -R-- EnumVal swRaidStatus(6)
| Textual Convention: RaidStatusTC
| Values: inactive(1), active(2), faulty(3)
|
+-- -R-- Integer32 swRaidErrorFlag(100)
+-- -R-- String swRaidErrMessage(101)
Textual Convention: DisplayString
Size: 0..255
swRaidTable - Contains Information about every RAID device in the system.
It consists of the following elements:
swRaidIndex - Internal index number for each device
swRaidDevice - Device name (for example "/dev/md1")
swRaidPersonality - RAID personality of this device (for
example "Raid1")
swRaidUnits - Units within this RAID device encoded
as a blank-seperated string (for exam-
ple "/dev/sda1 /dev/sdb1")
swRaidUnitCount - Number of units in the RAID device
swRaidStatus - Status of the RAID device. This can be
one of: inactive, active, faulty
swRaidErrorFlag - Contains a non-zero value if any of the RAID devices on the
system is faulty
swRaidErrMessage - Contains the names of all faulty RAID devices in case the
swRaidErrorFlag is non-zero
The swRaidErrorFlag and swRaidErrMessage variables are primarily provided to
get a quick overview of the RAID system, for example by the use of an auto-
mated monitoring script. They can also be used to generate SNMP trap or inform
messages in case one or more of the RAID devices failed.
REQUIREMENTS:
============
To use this plugin module you obviously need a somewhat current Net-SNMP
agent. It has been tested with Net-SNMP version 5.4. I don't know if it
works with any older version. The agent has to be compiled with support
for loadable modules (which is the default). In addition the Net-SNMP
runtime libraries and include files have to be installed in order to
compile the module.
INSTALLATION:
============
The swRaidMIB plugin module is not a huge software project, so
no configure script has been written. Since this module only makes
sense on a Linux system, and gcc is usually installed on such a
system, the Makefile has been written to only support the GNU
development tools. To compile on other Unix-like systems you would
probably need to modify the Makefile. Therefore, to install this
module, first run "make" in the source directory. Then copy the
resulting file swRaidPlugin.so to a place where the SNMP agent
can find it, for example /usr/lib/snmp/dlmod. Also copy the MIB
file named SWRAID-MIB.txt to the place where all your other MIB
files are stored, usually something like /usr/local/share/netsnmp/mibs
or /usr/share/snmp/mibs.
In order for the SNMP agent to find the module you need a line in
the snmpd configuration file telling it to load the module:
dlmod swRaidMIB /usr/lib/snmp/dlmod/swRaidPlugin.so
Now modify the snmpd startup script (depending on your distribution)
to start the agent with the additional command line option
-m+SWRAID-MIB
which causes the agent to load the SWRAID-MIB in addition to all the
other internal MIBs, and restart snmpd. You can now view the RAID data
using your preferred SNMP client program, like mbrowse or snmpwalk.
Depending on your security policies you can try the following command:
snmpwalk -v1 -c public -m+SWRAID-MIB localhost swRaidMIB
This should show you the same information you can get from the /proc/mdstat
file. The plugin module will re-read /proc/mdstat at most once every 60
seconds. If you want to test the module, set one of the RAID drives to a
faulty state (for example using the mdadm program) and wait a minute until
you can see the result through SNMP.
SUPPORT:
=======
If you need any help using this module, or you find a bug please let me
know. Also, if you can think of any improvement or even have implemented
any improvement yourself please send me an E-Mail to:
gero@gkminix.han.de
Please note that I wrote this program in my spare time, so answers may
sometimes take a bit longer. I will not offer any commercial support for
this program.