{"id":537,"date":"2017-12-13T15:34:04","date_gmt":"2017-12-13T15:34:04","guid":{"rendered":"https:\/\/pandorafms.com\/library\/?p=537"},"modified":"2017-12-13T15:49:41","modified_gmt":"2017-12-13T15:49:41","slug":"s-m-a-r-t-status","status":"publish","type":"post","link":"https:\/\/pandorafms.com\/library\/s-m-a-r-t-status\/","title":{"rendered":"S.M.A.R.T status"},"content":{"rendered":"<p>Do a S.M.A.R.T status test with smartctl tool on all the system&#8217;s disks and create a module for each.<\/p>\n<p>To use it, save it with name &#8220;smart_status&#8221; on plugins folder on pandora agent, and add the following line on the configuration file:<\/p>\n<pre>module_plugin smart_status<\/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 \r\n\r\nOK=\"PASSED\"\r\n\r\nfor i in $(smartctl --scan | awk {'print $1'})\r\n do\r\n SMART=$(smartctl -H $i | grep \"SMART overall-health self-assessment test result\"|tr -d \" \" |awk '{split($0,a,\":\");print a[2]}')\r\n if [ $SMART != $OK ]\r\n then\r\n OUT=\"1\"\r\n DESC=\"ERROR ON DISK $i\"\r\n else\r\n OUT=\"0\"\r\n DESC=\"Check of HD $i errors with smart\"\r\n fi\r\n echo \"&lt;module&gt;\";\r\n echo \"&lt;name&gt;&lt; ![CDATA[Smart $i]]&gt;&lt;\/name&gt;\";\r\n echo \"&lt;type&gt;&lt; ![CDATA[generic_data]]&gt;&lt;\/type&gt;\";\r\n echo \"&lt;data&gt;&lt; ![CDATA[$OUT]]&gt;&lt;\/data&gt;\";\r\n echo \"&lt;description&gt;&lt; ![CDATA[$DESC]]&gt;&lt;\/description&gt;\";\r\n echo \"&lt;min_critical&gt;1&lt;\/min_critical&gt;\";\r\n echo \"&lt;\/module&gt;\";\u00a0 done<code><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Do a S.M.A.R.T status test with smartctl tool on all the system&#8217;s disks and create a module for each. To use it, save it with name &#8220;smart_status&#8221; on plugins folder on pandora agent, and add the following line on the configuration file: module_plugin smart_status Author: Manuel Angel Fernandez His blog: http:\/\/rastreador.com.es\/ Module data #!\/bin\/bash OK=&#8221;PASSED&#8221; [&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":[107],"_links":{"self":[{"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/posts\/537"}],"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=537"}],"version-history":[{"count":0,"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/posts\/537\/revisions"}],"wp:attachment":[{"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/media?parent=537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/categories?post=537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pandorafms.com\/library\/wp-json\/wp\/v2\/tags?post=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}