| 1 |
check_hpasm Nagios Plugin README |
| 2 |
--------------------- |
| 3 |
|
| 4 |
This plugin checks the hardware health of HP Proliant servers with the |
| 5 |
hpasm software installed. It uses the hpasmcli command to acquire the |
| 6 |
condition of the system's critical components like cpus, power supplies, |
| 7 |
temperatures, fans and memory modules. Newer versions also use SNMP. |
| 8 |
|
| 9 |
* For instructions on installing this plugin for use with Nagios, |
| 10 |
see below. In addition, generic instructions for the GNU toolchain |
| 11 |
can be found in the INSTALL file. |
| 12 |
|
| 13 |
* For major changes between releases, read the CHANGES file. |
| 14 |
|
| 15 |
* For information on detailed changes that have been made, |
| 16 |
read the Changelog file. |
| 17 |
|
| 18 |
* This plugins is self documenting. All plugins that comply with |
| 19 |
the basic guidelines for development will provide detailed help when |
| 20 |
invoked with the '-h' or '--help' options. |
| 21 |
|
| 22 |
You can check for the latest plugin at: |
| 23 |
http://www.consol.de/opensource/nagios/check-hpasm |
| 24 |
|
| 25 |
Send mail to [email protected] for assistance. |
| 26 |
Please include the OS type and version that you are using. |
| 27 |
Also, run the plugin with the '-v' option and provide the resulting |
| 28 |
version information. Of course, there may be additional diagnostic information |
| 29 |
required as well. Use good judgment. |
| 30 |
|
| 31 |
|
| 32 |
How to "compile" the check_hpasm script. |
| 33 |
-------------------------------------------------------- |
| 34 |
|
| 35 |
1) Run the configure script to initialize variables and create a Makefile, etc. |
| 36 |
|
| 37 |
./configure --prefix=BASEDIRECTORY --with-nagios-user=SOMEUSER --with-nagios-group=SOMEGROUP --with-perl=PATH_TO_PERL --with-noinst-level=LEVEL --with-degrees=UNIT --with-perfdata --with-hpacucli |
| 38 |
|
| 39 |
a) Replace BASEDIRECTORY with the path of the directory under which Nagios |
| 40 |
is installed (default is '/usr/local/nagios') |
| 41 |
b) Replace SOMEUSER with the name of a user on your system that will be |
| 42 |
assigned permissions to the installed plugins (default is 'nagios') |
| 43 |
c) Replace SOMEGRP with the name of a group on your system that will be |
| 44 |
assigned permissions to the installed plugins (default is 'nagios') |
| 45 |
d) Replace PATH_TO_PERL with the path where a perl binary can be found. |
| 46 |
Besides the system wide perl you might have installed a private perl |
| 47 |
just for the nagios plugins (default is the perl in your path). |
| 48 |
e) Replace LEVEL with one of ok, warning, critical or unknown. |
| 49 |
If the required hpasm-rpm is not installed, the check_hpasm plugin |
| 50 |
will exit with the level specified. If you chose ok, the message |
| 51 |
will say "ok - .... hpasm is not installed". This is different from |
| 52 |
the "ok - hardware working fine" if hpasm was found. |
| 53 |
The default is to treat a missing hpasm package as ok. |
| 54 |
f) Replace UNIT with one of celsius or fahrenheit. The hpasmcli "show temp" |
| 55 |
prints temperatures both in units of celsius and fahrenheit. With the |
| 56 |
--with-degrees option you can decide which units will be shown in an |
| 57 |
alarm message. |
| 58 |
The default is "celsius". |
| 59 |
g) You can tell check_hpasm to output performance data by default if |
| 60 |
you call configure with the --enable-perfdata option. |
| 61 |
h) You can tell check_hpasm to check the raid status with the hpacucli command |
| 62 |
if you call configure with the --enable-hpacucli option. |
| 63 |
You need the hpacucli rpm. |
| 64 |
|
| 65 |
2) "Compile" the plugin with the following command: |
| 66 |
|
| 67 |
make |
| 68 |
|
| 69 |
This will produce a "check_hpasm" script. You will also find |
| 70 |
a "check_hpasm.pl" which you better ignore. It is the base for |
| 71 |
the compilation filled with placeholders. These will be replaced during |
| 72 |
the make process. |
| 73 |
|
| 74 |
|
| 75 |
3) Install the compiled plugin script with the following command: |
| 76 |
|
| 77 |
make install |
| 78 |
|
| 79 |
The installation procedure will attempt to place the plugin in a |
| 80 |
'libexec/' subdirectory in the base directory you specified with |
| 81 |
the --prefix argument to the configure script. |
| 82 |
|
| 83 |
|
| 84 |
4) Verify that your configuration files for Nagios contains |
| 85 |
the correct paths to the new plugin. |
| 86 |
|
| 87 |
|
| 88 |
5) Add this line to /etc/sudoers: |
| 89 |
nagios ALL=NOPASSWD: /sbin/hpasmcli |
| 90 |
or ths, if you also installed the hpacu package |
| 91 |
nagios ALL=NOPASSWD: /sbin/hpasmcli, /usr/sbin/hpacucli |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
Command line parameters |
| 96 |
----------------------- |
| 97 |
|
| 98 |
-v, --verbose |
| 99 |
Increased verbosity will print how check_hpasm communicates with the |
| 100 |
hpasm daemon and which values were acquired. |
| 101 |
|
| 102 |
-t, --timeout |
| 103 |
The number of seconds after which the plugin will abort. |
| 104 |
|
| 105 |
-b, --blacklist |
| 106 |
If some components of your system are missing (mostly the secondary |
| 107 |
power supply bay is empty) and you tolerate this, then blacklist the |
| 108 |
missing/failed component to avoid false alarms. |
| 109 |
The value for this option is a slash-separated list of components to |
| 110 |
ignore. |
| 111 |
Example: -b p:1,2/f:2/t:3,4/c:1/d:0-1,0-2 |
| 112 |
means: ignore power supplies #1 and #2, fan #2, temperature #3 and #4, |
| 113 |
cpu #1 and dimms #1 and #2 in cartridge #0. |
| 114 |
|
| 115 |
-c, --customthresh |
| 116 |
Override the machine-default temperature thresholds. |
| 117 |
Example: -c 1:60/4:80/5:50 |
| 118 |
Sets limit for temperature 1 to 60 degrees, temperature 4 to 80 degrees |
| 119 |
and temperature 5 to 50 degrees. You get the consecutive numbers by |
| 120 |
calling check_hpasm -v |
| 121 |
... |
| 122 |
checking temperatures |
| 123 |
1 processor_zone temperature is 46 (62 max) |
| 124 |
2 cpu#1 temperature is 43 (73 max) |
| 125 |
3 i/o_zone temperature is 54 (68 max) |
| 126 |
4 cpu#2 temperature is 46 (73 max) |
| 127 |
5 power_supply_bay temperature is 38 (55 max) |
| 128 |
|
| 129 |
-p, --perfdata |
| 130 |
Add performance data to the output even if you did not compile check_hpasm |
| 131 |
with --with-perfdata in step 1. |
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
SNMP and Memory Modules |
| 136 |
----------------------- |
| 137 |
Older hardware does not always show valuable information when queried for |
| 138 |
the health of memory modules. Maybe it's because older modules do not support |
| 139 |
error checking at all. |
| 140 |
|
| 141 |
|
| 142 |
1. no cpqHeResMemModule |
| 143 |
--------------------------------------------------------------------------- |
| 144 |
|
| 145 |
2. collapsed cpqHeResMemModule |
| 146 |
--------------------------------------------------------------------------- |
| 147 |
|
| 148 |
Some (older) systems do not support the cpqHeResMemModuleEntry table. |
| 149 |
Either there is no oid with 1.3.6.1.4.1.232.6.2.14.11.1 at all |
| 150 |
or there is a single oid like |
| 151 |
|
| 152 |
Example: |
| 153 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.1 = INTEGER: 524288 |
| 154 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.2 = INTEGER: 262144 |
| 155 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.3 = INTEGER: 0 |
| 156 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.4 = INTEGER: 524288 |
| 157 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.5 = INTEGER: 262144 |
| 158 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.6 = INTEGER: 0 |
| 159 |
|
| 160 |
^-- module number |
| 161 |
^-- cartridge number (0 = system board) |
| 162 |
^-- size |
| 163 |
|
| 164 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.6 = INTEGER: 0 |
| 165 |
|
| 166 |
I compared 300 systems and found out that with |
| 167 |
1.3.6.1.4.1.232.6.2.14.11.1.<no1>.<no2>.<no3> = <no4> |
| 168 |
no1 is always 1 |
| 169 |
no2 is always 0 |
| 170 |
no3 is the number of memory slots (including the empty ones). |
| 171 |
no4 is always 0. It is probably the health status of the |
| 172 |
overall memory subsystem. I don't know. |
| 173 |
I will implement 0 = ok, not 0 = ask compaq |
| 174 |
|
| 175 |
cpqSiMemECCStatus provides no usable information. All my test systems |
| 176 |
showed 0 which is an undocumented value. |
| 177 |
|
| 178 |
function get_size(cpqHeResMemModuleEntry) will return 1. |
| 179 |
|
| 180 |
3. cpqHeResMemModule containing crap |
| 181 |
--------------------------------------------------------------------------- |
| 182 |
|
| 183 |
grepping for cpqSiMemBoardSize shows 4 modules |
| 184 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.1 = INTEGER: 262144 |
| 185 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.2 = INTEGER: 262144 |
| 186 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.3 = INTEGER: 0 |
| 187 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.4 = INTEGER: 262144 |
| 188 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.5 = INTEGER: 262144 |
| 189 |
iso.3.6.1.4.1.232.2.2.4.5.1.3.0.6 = INTEGER: 0 |
| 190 |
|
| 191 |
grepping for cpqHeResMemEntry shows one module with zero values |
| 192 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.0 = INTEGER: 0 |
| 193 |
iso.3.6.1.4.1.232.6.2.14.11.1.2.0.0 = INTEGER: 0 |
| 194 |
iso.3.6.1.4.1.232.6.2.14.11.1.3.0.0 = "" |
| 195 |
iso.3.6.1.4.1.232.6.2.14.11.1.4.0.0 = INTEGER: 0 |
| 196 |
iso.3.6.1.4.1.232.6.2.14.11.1.5.0.0 = INTEGER: 0 |
| 197 |
iso.3.6.1.4.1.232.6.2.14.11.1.6.0.0 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |
| 198 |
|
| 199 |
|
| 200 |
4. cpqHeResMemModuleEntry and cpqSiMemModuleEntry use different table indexes |
| 201 |
--------------------------------------------------------------------------- |
| 202 |
|
| 203 |
cpqSiMemBoardIndex 1.3.6.1.4.1.232.2.2.4.5.1.1 |
| 204 |
cpqSiMemModuleIndex 1.3.6.1.4.1.232.2.2.4.5.1.2 |
| 205 |
|
| 206 |
cpqHeResMemBoardIndex 1.3.6.1.4.1.232.6.2.14.11.1.1 |
| 207 |
cpqHeResMemModuleIndex 1.3.6.1.4.1.232.6.2.14.11.1.2 |
| 208 |
|
| 209 |
|
| 210 |
cpqSiMemBoardIndex |
| 211 |
SNMPv2-SMI::enterprises.232.2.2.4.5.1.1.0.1 = INTEGER: 0 |
| 212 |
SNMPv2-SMI::enterprises.232.2.2.4.5.1.1.0.2 = INTEGER: 0 |
| 213 |
SNMPv2-SMI::enterprises.232.2.2.4.5.1.1.0.3 = INTEGER: 0 |
| 214 |
SNMPv2-SMI::enterprises.232.2.2.4.5.1.1.0.4 = INTEGER: 0 |
| 215 |
SNMPv2-SMI::enterprises.232.2.2.4.5.1.1.0.5 = INTEGER: 0 |
| 216 |
SNMPv2-SMI::enterprises.232.2.2.4.5.1.1.0.6 = INTEGER: 0 |
| 217 |
|
| 218 |
cpqHeResMemBoardIndex |
| 219 |
SNMPv2-SMI::enterprises.232.6.2.14.11.1.1.1.1 = INTEGER: 0 |
| 220 |
SNMPv2-SMI::enterprises.232.6.2.14.11.1.1.1.2 = INTEGER: 0 |
| 221 |
SNMPv2-SMI::enterprises.232.6.2.14.11.1.1.1.3 = INTEGER: 0 |
| 222 |
SNMPv2-SMI::enterprises.232.6.2.14.11.1.1.1.4 = INTEGER: 0 |
| 223 |
SNMPv2-SMI::enterprises.232.6.2.14.11.1.1.1.5 = INTEGER: 0 |
| 224 |
SNMPv2-SMI::enterprises.232.6.2.14.11.1.1.1.6 = INTEGER: 0 |
| 225 |
|
| 226 |
It is not possible to use the SNMP-table-indices to identify the |
| 227 |
corresponding he-entry. Matching is done with nested loops. |
| 228 |
|
| 229 |
5. even worse: cpqHeResMemBoardIndex and cpqSiMemBoardIndex don't match |
| 230 |
--------------------------------------------------------------------------- |
| 231 |
|
| 232 |
cpqSiMemBoardIndex |
| 233 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.1.1 = INTEGER: 1 |
| 234 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.1.2 = INTEGER: 1 |
| 235 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.1.3 = INTEGER: 1 |
| 236 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.1.4 = INTEGER: 1 |
| 237 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.1.5 = INTEGER: 1 |
| 238 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.1.6 = INTEGER: 1 |
| 239 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.1.7 = INTEGER: 1 |
| 240 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.1.8 = INTEGER: 1 |
| 241 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.2.1 = INTEGER: 2 |
| 242 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.2.2 = INTEGER: 2 |
| 243 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.2.3 = INTEGER: 2 |
| 244 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.2.4 = INTEGER: 2 |
| 245 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.2.5 = INTEGER: 2 |
| 246 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.2.6 = INTEGER: 2 |
| 247 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.2.7 = INTEGER: 2 |
| 248 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.2.8 = INTEGER: 2 |
| 249 |
iso.3.6.1.4.1.232.2.2.4.5.1.1.3.1 = INTEGER: 3 |
| 250 |
|
| 251 |
cpqHeResMemBoardIndex |
| 252 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.1 = INTEGER: 0 |
| 253 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.2 = INTEGER: 0 |
| 254 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.3 = INTEGER: 0 |
| 255 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.4 = INTEGER: 0 |
| 256 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.5 = INTEGER: 0 |
| 257 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.6 = INTEGER: 0 |
| 258 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.7 = INTEGER: 0 |
| 259 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.0.8 = INTEGER: 0 |
| 260 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.1.1 = INTEGER: 1 |
| 261 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.1.2 = INTEGER: 1 |
| 262 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.1.3 = INTEGER: 1 |
| 263 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.1.4 = INTEGER: 1 |
| 264 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.1.5 = INTEGER: 1 |
| 265 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.1.6 = INTEGER: 1 |
| 266 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.1.7 = INTEGER: 1 |
| 267 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.1.8 = INTEGER: 1 |
| 268 |
iso.3.6.1.4.1.232.6.2.14.11.1.1.2.1 = INTEGER: 2 |
| 269 |
|
| 270 |
|
| 271 |
Redundant fans |
| 272 |
----------------------- |
| 273 |
I saw one old server which had only half of the possible fans installed. |
| 274 |
|
| 275 |
Fan# 1 2 3 4 5 6 |
| 276 |
|
| 277 |
cpqHeFltTolFanPresent yes no yes no yes no |
| 278 |
cpqHeFltTolFanRedundant no no no no no no |
| 279 |
cpqHeFltTolFanRedundantPartner 2 1 4 3 6 5 |
| 280 |
cpqHeFltTolFanCondition ok other ok other ok other |
| 281 |
cpqHeFltTolFanLocation cpu cpu cpu cpu io io |
| 282 |
|
| 283 |
Normally this would result in |
| 284 |
... |
| 285 |
fan #1 (cpu) is not redundant |
| 286 |
fan #2 (cpu) is not redundant |
| 287 |
fan #3 (cpu) is not redundant |
| 288 |
fan #4 (cpu) is not redundant |
| 289 |
fan #5 (ioboard) is not redundant |
| 290 |
fan #6 (ioboard) is not redundant |
| 291 |
WARNING - fan #1 (cpu) is not redundant, fan #2 (cpu) is not redundant, fan #3 (cpu) is not redundant, fan #4 (cpu) is not redundant, fan #5 (ioboard) is not redundant, fan #6 (ioboard) is not redundant |
| 292 |
|
| 293 |
However it was the server's owner decision not to install fan pairs but only one fan per location, so for him this is a false alert. |
| 294 |
|
| 295 |
By using --ignore-fan-redundancy check_hpasm only looks at the cpqHeFltTolFanCondition and ignores dependencies between two fans, so the result is: |
| 296 |
|
| 297 |
fan 1 speed is normal, pctmax is 50%, location is cpu, redundance is no, partner is 2 |
| 298 |
fan 3 speed is normal, pctmax is 50%, location is cpu, redundance is no, partner is 4 |
| 299 |
fan 5 speed is normal, pctmax is 50%, location is ioboard, redundance is no, partner is 6 |
| 300 |
OK - System: 'proliant ml370 g3', ... |
| 301 |
|
| 302 |
|
| 303 |
A snmp forwarding trick |
| 304 |
----------------------- |
| 305 |
local - where check_hpasm runs |
| 306 |
remote - where a proliant can be reached |
| 307 |
proliant - where the snmp agent runs |
| 308 |
|
| 309 |
remote: |
| 310 |
ssh -R6667:localhost:6667 local |
| 311 |
socat tcp4-listen:6667,reuseaddr,fork UDP:proliant:161 |
| 312 |
|
| 313 |
local: |
| 314 |
socat udp4-listen:161,reuseaddr,fork tcp:localhost:6667 |
| 315 |
check_hpasm --hostname 127.0.0.1 |
| 316 |
|
| 317 |
|
| 318 |
Sample data from real machines |
| 319 |
------------------------------ |
| 320 |
|
| 321 |
hpasmcli=$(which hpasmcli) |
| 322 |
hpacucli=$(which hpacucli) |
| 323 |
for i in server powersupply fans temp dimm |
| 324 |
do |
| 325 |
$hpasmcli -s "show $i" | while read line |
| 326 |
do |
| 327 |
printf "%s %s\n" $i "$line" |
| 328 |
done |
| 329 |
done |
| 330 |
if [ -x "$hpacucli" ]; then |
| 331 |
for i in config status |
| 332 |
do |
| 333 |
$hpacucli ctrl all show $i | while read line |
| 334 |
do |
| 335 |
printf "%s %s\n" $i "$line" |
| 336 |
done |
| 337 |
done |
| 338 |
fi |
| 339 |
|
| 340 |
If you think check_hpasm is not working correctly, please run the above script |
| 341 |
and send me the output. It's also helpful to see the output of snmpwalk |
| 342 |
snmpwalk .... 1.3.6.1.4.1.232 |
| 343 |
|
| 344 |
|
| 345 |
-- |
| 346 |
Gerhard Lausser <[email protected]> |