{"id":94,"date":"2017-02-07T20:11:36","date_gmt":"2017-02-07T20:11:36","guid":{"rendered":"http:\/\/coherence.co.za\/?p=94"},"modified":"2017-02-07T20:54:43","modified_gmt":"2017-02-07T20:54:43","slug":"monitoring-hp-g5-server-hardware-raid-on-debian","status":"publish","type":"post","link":"http:\/\/coherence.co.za\/?p=94","title":{"rendered":"Monitoring HP G5 server hardware RAID on Debian"},"content":{"rendered":"<p>Personally I prefer to use Linux MDADM software raid because of the following factors<\/p>\n<ul>\n<li>Homogenous set of utilities, always the same, unlike all the different custom utils from all the many hardware vendors.<\/li>\n<li>Long term support for the platform.<\/li>\n<li>Proven performance and stability.<\/li>\n<li>Cheaper RAID cards use the CPU in any case and the MDADM implementation will blow it out the water for features\/performance.<\/li>\n<li>Ability to run any type of RAID level unlike most hardware which\u00a0usually only support 0,1 and 0+1.<\/li>\n<\/ul>\n<p>But some times you get a system with decent dedicated controllers with cache and battery backup and you want to be able to offload to it. This is what was in my G5 system<\/p>\n<pre>\r\nlspci -nn\r\n06:00.0 RAID bus controller [0104]: Hewlett-Packard Company Smart Array Controller [103c:3230] (rev 04)\r\n<\/pre>\n<p>Googling &#8220;pciid 103c:3230&#8221; quickly yielded that I was dealing with a &#8220;HP Smart Array P400i&#8221; card<\/p>\n<p>Now while the card is supported by the OS out of the box an I can see any array that I created in the BIOS, the problem that I sit with is that I need to be able to monitor the disks for failure and issue rebuild commands without taking the system down. Trying to get this right with the vendor provided tools is usually near impossible as the vendor abandoned support and usually only had support for one or 2 commercial linux distros in any case. Enter the good folks at the HWraid project<\/p>\n<p>Just add their repository and install the tools for your card (in this case the HP tools)<\/p>\n<pre>\r\necho deb http:\/\/hwraid.le-vert.net\/debian squeeze main &gt;&gt; \/etc\/apt\/sources.list\r\napt-get update\r\napt-get install hpacucli\r\n<\/pre>\n<p>Now we test the tools.<\/p>\n<pre>hpacucli controller slot=0 physicaldrive all show\r\nSmart Array P400i in Slot 0 (Embedded)\r\n\u00a0\u00a0 \r\n\u00a0 \u00a0 \u00a0 physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SATA, 500 GB, OK)\r\n\u00a0 \u00a0 \u00a0 physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SATA, 500 GB, OK)\r\n<\/pre>\n<p>Success.. now that I have the tools that can interrogate the controller, I need to build some monitoring, so I add a script which I schedule to run every hour in cron.<\/p>\n<pre>\r\n#!\/bin\/bash\r\nMAIL=noc@acme.com\r\nHPACUCLI=`which hpacucli`\r\nHPACUCLI_TMP=\/tmp\/hpacucli.log\r\n\r\nif [ `$HPACUCLI ctrl all show config | grep -E 'Failed|Rebuilding'| wc -l` -gt 0 ]\r\nthen\r\nmsg=\"RAID Controller Errors\"\r\nlogger -p syslog.error -t RAID \"$msg\"\r\n$HPACUCLI ctrl all show config > $HPACUCLI_TMP\r\nmail -s \"$HOSTNAME [ERROR] - $msg\" \"$MAIL\" < $HPACUCLI_TMP\r\necho $msg\r\ncat $HPACUCLI_TMP\r\nrm -f $HPACUCLI_TMP\r\nfi\r\n<\/pre>\n<p>Configure your mail subsystem and ensure your system is actually able to send mail.<\/p>\n<pre>dpkg-reconfigure exim4-config<\/pre>\n<p>The script is very basic but it gets the job done, and yes you will\u00a0generate alerts every hour if there is an issue until its resolved, think of it as a feature. The script sends a mail to the hardcoded email address as well as adds it to your syslog. If you are performing syslog monitoring and alerts with something like Solarwinds, Splunk or Graylog then you could rather depend on those systems for alerts by checking for the alert message in syslog and scrap the emailing bit of the script.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Personally I prefer to use Linux MDADM software raid because of the following factors Homogenous set of utilities, always the same, unlike all the different custom utils from all the many hardware vendors. Long term support for the platform. Proven performance and stability. Cheaper RAID cards use the CPU in any case and the MDADM [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[9,20,12],"_links":{"self":[{"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/posts\/94"}],"collection":[{"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/coherence.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=94"}],"version-history":[{"count":8,"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":102,"href":"http:\/\/coherence.co.za\/index.php?rest_route=\/wp\/v2\/posts\/94\/revisions\/102"}],"wp:attachment":[{"href":"http:\/\/coherence.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/coherence.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/coherence.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}