Short hack to integrate the ouput from hpacucli (the HP tool to query the health of your harddisks and the controller) into some Zabbix checks. Hardware and software in use as following:
"/usr/local/sbin/"
The easy way to install 3rd party software from HP is to use their
SDR. They provide a
bootstrap script to aide you with the setup.
"./bootstrap.sh -r 5 -d CentOS ProLiantSupportPack" or something vaguely
similar - syntax seems to change from time to time.
yum update && yum install hpacucli
Since you need superuser power to execute hpacucli I've decided to go for sudo instead of a suid-root script. So
we need a few modifications to "/etc/sudoers"
## Allow zabbix some limited usage of the hpacucli tool
zabbix ALL=NOPASSWD:/usr/sbin/hpacucli ctrl all show status
zabbix ALL=NOPASSWD:/usr/sbin/hpacucli ctrl slot=0 pd all show
/etc/zabbix/zabbix_agentd.conf:
UserParameter=hp.cont,/usr/local/sbin/hpcheck.sh -c
UserParameter=hp.disk,/usr/local/sbin/hpcheck.sh -d
This is the hpcheck.sh script.
If you maintain a collection of common 3rd party scripts you install as a rpm
package from central repository you might want to include it there. Otherwise just place it
in "/usr/local/sbin/".
The script currently has three options:
Just in case you wonder what the output of hpacucli looked like I based this script on,
here are examples.
If you need some basic cheat sheet for the hpacucli usage take a look at this:
http://www.datadisk.co.uk/html_docs/redhat/hpacucli.htm.
2010-05-13 v0.5:
Move the tempfile creation and cleanup call into the case() selection and only run them where needed.
Thanks to Jose Joaquin Anton Herrerias who noticed that calling hpcheck.sh with -h or unknown options
leaves a spurious tempfile behind.