glensc/nagios-plugin-check_raid — pull request #74 by alkahan (2014-05-27 17:07:21+00:00)
Title: megacli: fixed critical status when no exit code is returned

This patch fix a BUG when megacli does not provide status code, check_raid exit with citical status.

$ /usr/lib64/nagios/plugins/check_raid -d
```
DEBUG EXEC: /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL -NoLog at /usr/lib64/nagios/plugins/check_raid line 382.
DEBUG EXEC: /opt/MegaRAID/MegaCli/MegaCli64 -LdInfo -Lall -aALL -NoLog at /usr/lib64/nagios/plugins/check_raid line 382.
OK: megacli:[Volumes(1): raid10:Optimal; Devices(6): 00,01,02,03,04,05=Online]
```

$ /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL -NoLog
```

Adapter #0

Enclosure Device ID: 32
Slot Number: 0
Device Id: 0
Sequence Number: 2
Media Error Count: 0
Other Error Count: 556475
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 476940MB [0x3a386030 Sectors]
Non Coerced Size: 476428MB [0x3a286030 Sectors]
Coerced Size: 476416MB [0x3a280000 Sectors]
Firmware state: Online
SAS Address(0): 0x1221000000000000
Connected Port Number: 0(path0)
Inquiry Data: ATA ST9500620NS FTA1 9XF1KAGA

Enclosure Device ID: 32
Slot Number: 1
Device Id: 1
Sequence Number: 2
Media Error Count: 0
Other Error Count: 556475
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 476940MB [0x3a386030 Sectors]
Non Coerced Size: 476428MB [0x3a286030 Sectors]
Coerced Size: 476416MB [0x3a280000 Sectors]
Firmware state: Online
SAS Address(0): 0x1221000001000000
Connected Port Number: 1(path0)
Inquiry Data: ATA ST9500620NS FTA1 9XF1L4SC

Enclosure Device ID: 32
Slot Number: 2
Device Id: 2
Sequence Number: 2
Media Error Count: 0
Other Error Count: 556475
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 476940MB [0x3a386030 Sectors]
Non Coerced Size: 476428MB [0x3a286030 Sectors]
Coerced Size: 476416MB [0x3a280000 Sectors]
Firmware state: Online
SAS Address(0): 0x1221000002000000
Connected Port Number: 2(path0)
Inquiry Data: ATA ST9500620NS BE25 9XF1Y8KY

Enclosure Device ID: 32
Slot Number: 3
Device Id: 3
Sequence Number: 2
Media Error Count: 0
Other Error Count: 556475
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 476940MB [0x3a386030 Sectors]
Non Coerced Size: 476428MB [0x3a286030 Sectors]
Coerced Size: 476416MB [0x3a280000 Sectors]
Firmware state: Online
SAS Address(0): 0x1221000003000000
Connected Port Number: 3(path0)
Inquiry Data: ATA ST9500620NS FTA1 9XF1L4SK

Enclosure Device ID: 32
Slot Number: 4
Device Id: 4
Sequence Number: 2
Media Error Count: 0
Other Error Count: 556475
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 476940MB [0x3a386030 Sectors]
Non Coerced Size: 476428MB [0x3a286030 Sectors]
Coerced Size: 476416MB [0x3a280000 Sectors]
Firmware state: Online
SAS Address(0): 0x1221000004000000
Connected Port Number: 4(path0)
Inquiry Data: ATA ST9500620NS BE25 9XF1Y7S7

Enclosure Device ID: 32
Slot Number: 5
Device Id: 5
Sequence Number: 2
Media Error Count: 0
Other Error Count: 556475
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
Raw Size: 476940MB [0x3a386030 Sectors]
Non Coerced Size: 476428MB [0x3a286030 Sectors]
Coerced Size: 476416MB [0x3a280000 Sectors]
Firmware state: Online
SAS Address(0): 0x1221000005000000
Connected Port Number: 5(path0)
Inquiry Data: ATA ST9500620NS BE25 9XF1Y7CQ

```

$ /opt/MegaRAID/MegaCli/MegaCli64 -LdInfo -Lall -aALL -NoLog
```
Adapter 0 -- Virtual Drive Information:
Virtual Disk: 0 (target id: 0)
Name:raid10
RAID Level: Primary-1, Secondary-3, RAID Level Qualifier-0
Size:1429248MB
State: Optimal
Stripe Size: 64kB
Number Of Drives:2
Span Depth:3
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
Access Policy: Read/Write
Disk Cache Policy: Disk's Default
```