{"id":514,"date":"2017-12-13T15:23:26","date_gmt":"2017-12-13T15:23:26","guid":{"rendered":"https:\/\/pandorafms.com\/library\/?p=514"},"modified":"2017-12-13T15:31:57","modified_gmt":"2017-12-13T15:31:57","slug":"software-raid-status","status":"publish","type":"post","link":"https:\/\/pandorafms.com\/library\/software-raid-status\/","title":{"rendered":"Software RAID status"},"content":{"rendered":"<p class=\"description_pui\">Check any problem on a Software RAID.<\/p>\n<p>To use it, save it with name &#8220;check_raid&#8221; on plugins folder on pandora agent, and add the following line on the configuration file:<\/p>\n<pre>module_plugin check_raid<\/pre>\n<p>Author: Manuel Angel Fernandez<br \/>\nHis blog: <a href=\"http:\/\/rastreador.com.es\/\" target=\"_blank\" rel=\"noopener\">http:\/\/rastreador.com.es\/<\/a><\/p>\n<h2>Module data<\/h2>\n<pre>#!\/bin\/bash\u00a0 for i in $(mdadm --detail --scan | cut -d\" \" -f2)\u00a0 do\u00a0 RAIDSTATUS=$(mdadm --query --detail $i | grep \"State :\" | tr -d \" \")<\/pre>\n<pre>CHECK=$(echo $RAIDSTATUS | egrep -c \"State:clean,checking|State:active|State:clean\")<\/pre>\n<pre>if [ $CHECK -eq 0 ]\u00a0\r\nthen\u00a0\r\nOUT=\"1\"\u00a0\r\n# DESC=\"Array $i status\"\u00a0\r\nDESC=$RAIDSTATUS\u00a0\r\nelse\u00a0\r\nOUT=\"0\"\u00a0\r\nDESC=\"Check OK of Raid $i errors with mdadm\"\u00a0\r\nfi\u00a0\r\necho \"&lt;module&gt;\";\u00a0\r\necho \"&lt;name&gt;&lt; ![CDATA[Check_raid $i]]&gt;&lt;\/name&gt;\";\u00a0\r\necho \"&lt;type&gt;&lt; ![CDATA[generic_data]]&gt;&lt;\/type&gt;\";\u00a0\r\necho \"&lt;data&gt;&lt; ![CDATA[$OUT]]&gt;&lt;\/data&gt;\";\u00a0\r\necho \"&lt;description&gt;&lt; ![CDATA[$DESC]]&gt;&lt;\/description&gt;\";\u00a0\r\necho \"&lt;min_critical&gt;1&lt;\/min_critical&gt;\";\u00a0\r\necho \"&lt;\/module&gt;\";\u00a0\r\n\r\ndone\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Check any problem on a Software RAID. To use it, save it with name &#8220;check_raid&#8221; on plugins folder on pandora agent, and add the following line on the configuration file: module_plugin check_raid Author: Manuel Angel Fernandez His blog: http:\/\/rastreador.com.es\/ Module data #!\/bin\/bash\u00a0 for i in $(mdadm &#8211;detail &#8211;scan | cut -d&#8221; &#8221; -f2)\u00a0 do\u00a0 RAIDSTATUS=$(mdadm [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[4],"tags":[103],"_links":{"self":[{"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/posts\/514"}],"collection":[{"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/comments?post=514"}],"version-history":[{"count":0,"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/posts\/514\/revisions"}],"wp:attachment":[{"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/media?parent=514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/categories?post=514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/tags?post=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}