ZABBIX Forums  

Go Back   ZABBIX Forums > Zabbix Discussions and Feedback > Zabbix Cookbook

Reply
 
Thread Tools Display Modes
  #1  
Old 18-06-2013, 09:40
ArtemK ArtemK is offline
Senior Member
 
Join Date: May 2013
Posts: 229
Default Monitoring Intel/LSI/Symbios RAID controllers

Hello everyone,

So, based on this thread I created my own script for monitoring RAID controllers on windows systems. Maybe it will be useful for someone else. I don't know which controllers is possible monitor with this, as I have only Intel RAID controllers here, but if it's possible to use megacli, cmdtool for this, script should work (I hope).

Discovery script uses trapper items, so I'm running this script using windows scheduler

LLD Script requirements:
  • Active Zabbix Agent, set paths to zabbix_sender and config in script (script uses zabbix_sender & zabbix agent config to send data to discovery items)
  • CmdTool2 (or MegaCLI, or smth like this. I got this from firmware update package from intel website, set path in script)
  • Powershell on server (With execution policy, which allows local script execution)
Script for checking items.
  • The same CmdTool2. Set path to this tool in script ($CLI variable)
With these scripts and template zabbix monitors physical disks, RAID volumes and BBUs. Triggers are also defined. All items (except discovery) are Zabbix Agent active items. It will be great to monitor also adapter log for critical events, but I just didn't figured out yet, how to do it.

Items, defined in template:

physical disks
  • disk state (unconfigured(good)/optimal/hotspare)
  • media errors
  • raw size
  • inquiry data (disk model and firmware)
  • predictive errors
logical disks
  • vdisk state
  • vdisk size
adapters
  • firmware version
  • model of adapter
BBUs
  • State of charge
  • BBU state
  • BBU Capacity (current & design)

You can download template and scripts from github

p.s. Sorry for my poor English

Last edited by ArtemK; 22-11-2016 at 17:45.
Reply With Quote
  #2  
Old 27-06-2013, 15:12
ArtemK ArtemK is offline
Senior Member
 
Join Date: May 2013
Posts: 229
Default

Surprisingly no comments so far. Useless scripts? No interest? No RAID controllers?

Anyway, I've created also perl version of these scripts for unix systems. Other changes:
Code:
- fixed discovery of physical disks for windows (I thought, that there are always continuous order of drive's IDs on enclosure, i.e. 0-8, that is not true)
- rearranged item's discovery in script for windows
- firmware check for adapter now returns firmware package version
for unix agents, tool for checking controllers should be run as root via sudo
Code:
# sudoers file
Defaults:zabbix !requiretty
zabbix  ALL=NOPASSWD:/opt/MegaRAID/CmdTool2/CmdTool2
Other requirements are the same: active zabbix agent, paths in scripts to sender, config, etc...

I've placed script on my servers to /etc/zabbix/scripts/ folder. Path must be the same in agent config.

Template remains the same (changed name only). Thanks!

It would be great, if someone will review my code. Any comments?

download it from github

Last edited by ArtemK; 03-06-2017 at 22:20.
Reply With Quote
  #3  
Old 03-07-2013, 02:10
linuxsquad linuxsquad is offline
Junior Member
 
Join Date: Jul 2013
Location: chicago il
Posts: 12
Send a message via Skype™ to linuxsquad
Default

There is LSI RAID template for Linux

https://www.zabbix.com/wiki/templates/start

I am almost done with one for MD RAID (software) on LInux
Reply With Quote
  #4  
Old 03-07-2013, 07:34
ArtemK ArtemK is offline
Senior Member
 
Join Date: May 2013
Posts: 229
Default

Quote:
Originally Posted by linuxsquad View Post
There is LSI RAID template for Linux

https://www.zabbix.com/wiki/templates/start

I am almost done with one for MD RAID (software) on LInux
yep, that is template, which I used as a starting point. But it's not really usable, you should always generate new template for each RAID controller and each configuration. If you will add new RAID volume - you will need to generate template for that configuration again. I used low level discovery, which will automatically create items and triggers for every RAID controller.
Reply With Quote
  #5  
Old 03-07-2013, 07:40
linuxsquad linuxsquad is offline
Junior Member
 
Join Date: Jul 2013
Location: chicago il
Posts: 12
Send a message via Skype™ to linuxsquad
Default

- auto-discovery is welcomed. I've just contacted original creator of LSI RAID template and suggested to add LLD to his template.

- Use of /etc/zabbix for binaries or executable is NOT recommended. I would use /usr/local/bin/

- I can review your template on Linux systems, let you know

Last edited by linuxsquad; 03-07-2013 at 07:42.
Reply With Quote
  #6  
Old 03-07-2013, 07:47
ArtemK ArtemK is offline
Senior Member
 
Join Date: May 2013
Posts: 229
Default

Quote:
Originally Posted by linuxsquad View Post
- Use of /etc/zabbix for binaries or executable is NOT recommended. I would use /usr/local/bin/
There is no binaries, it's just a perl script. Feel free to place it wherever you want. File owner is root:root and zabbix user have only read and execute rights, I don't see there any security issue...
Reply With Quote
  #7  
Old 01-10-2013, 14:33
AbsesS AbsesS is offline
Junior Member
 
Join Date: Mar 2012
Posts: 3
Talking

Awsome tool you made ArtemK.
I used it today to monitor some LSI SAS controller on a Debian system. They work perfectly.

THANKS

One question: how often do i need to run the raid_discovery script? so i can put in in cron.
Reply With Quote
  #8  
Old 01-10-2013, 18:28
ArtemK ArtemK is offline
Senior Member
 
Join Date: May 2013
Posts: 229
Default

Quote:
Originally Posted by AbsesS View Post
One question: how often do i need to run the raid_discovery script? so i can put in in cron.
Hi, glad that this is working for someone else Discovery script...there is no any specific schedule, you can run it once an hour, 12 hours, 24 hours, etc. It depends on your environment.

On my servers it's executed by cron every night, if there are some big changes, you can always execute it manually.
Reply With Quote
  #9  
Old 02-10-2013, 10:32
AbsesS AbsesS is offline
Junior Member
 
Join Date: Mar 2012
Posts: 3
Thumbs up

Thanks for the answer and thanks again for the contribution
Reply With Quote
  #10  
Old 13-12-2013, 05:28
neo4is neo4is is offline
Junior Member
 
Join Date: Dec 2013
Posts: 5
Send a message via Skype™ to neo4is
Default

Hi ArtemK,

The tool for windows is run successful. thank you very much

But for linux (debian squeezy) I have problem when I try to run on terminal (for checking)

/usr/bin/perl -w /etc/zabbix/script/raid_check.pl -mode pdisk -item $4 -adapter $1 -enclosure $2 -pdisk $3

the error is: Adapter is not defined. Use --adapter paramater at etc/zabbix/script/raid_check.pl line 21.

And display Not Supported in zabbix server (web)

Which version of zabbix agent/server that your tool need?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:04.