Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Have just installed the MegaCLI application on my Nagios server to see what information I could pull off the RAID controller. Just be running a single command you can find out loads of information that would be really useful:
Enclosure Device ID: 252
Slot Number: 0
Drive's postion: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: 0
Device Id: 10
WWN: 500000E116D88251
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 68.365 GB [0x88bb6b0 Sectors]
Non Coerced Size: 67.865 GB [0x87bb6b0 Sectors]
Coerced Size: 67.054 GB [0x861c000 Sectors]
Firmware state: Online, Spun Up
Device Firmware Level: SC17
Shield Counter: 0
Successful diagnostics completion on : N/A
SAS Address(0): 0x500000e116d88252
SAS Address(1): 0x0
Connected Port Number: 1(path0)
Inquiry Data: IBM-ESXSMBE2073RC SC17D3A04KYDSC17SC17SC17
IBM FRU/CRU: 43X0847
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None
Device Speed: 6.0Gb/s
Link Speed: 6.0Gb/s
Media Type: Hard Disk Device
Drive Temperature :35C (95.00 F)
PI Eligibility: No
Drive is formatted for PI information: No
PI: No PI
Drive's write cache : Disabled
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s
Port-1 :
Port status: Active
Port's Linkspeed: Unknown
Drive has flagged a S.M.A.R.T alert : No
The command run is "./MegaCli64 -PDList -aALL" to bring back the above information on all the disks. The info I would have thought was most interesting would be:
Slot Number
Media Error Count
Other Error Count
Predictive Failure Count
Drive Temperature
Could anyone point me in the right direction of where to start writing a plugin for this??
Nagios plugins are just executables that print text and exit with specific exit codes. The developer guidelines will give you some more detail. In this case your plugin will probably just run MegaCli64 and parse its output. Depending on what language you will be writing your plugin in, there may be a library available to help you (I know there's one for perl and one for python).
I have created a check command and service and added the service to the local host but get the following which is, I assume, because of the format of the output:
check_serveraid.png (9.26 KiB) Viewed 9707 times
So, a couple of questions:
1) Could anyone give me an example of how I could just output the 35C value of the script output?
2) I can run this script locally but obviously won't be able to run on remote machines. How could I change this?
You could give the nagios user permission to run MegaCLI64 as root. First of all, if you're not familiar with how to use the vi text editor, you'll want to run 'export VISUAL=nano'. Then run 'visudo' and add the following line to the file that comes up: