{"id":3802,"date":"2013-09-25T15:19:14","date_gmt":"2013-09-25T12:19:14","guid":{"rendered":"http:\/\/skeletor.org.ua\/?p=3802"},"modified":"2016-09-20T21:00:54","modified_gmt":"2016-09-20T18:00:54","slug":"%d0%bc%d0%be%d0%bd%d0%b8%d1%82%d0%be%d1%80%d0%b8%d0%bd%d0%b3-%d0%b6%d1%91%d1%81%d1%82%d0%ba%d0%b8%d1%85-%d0%b4%d0%b8%d1%81%d0%ba%d0%be%d0%b2-%d0%b2-solaris-%d0%b1%d0%b5%d0%b7-smarta","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=3802","title":{"rendered":"\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0436\u0451\u0441\u0442\u043a\u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432 \u0432 Solaris \u0431\u0435\u0437 SMART&#8217;a"},"content":{"rendered":"<p>\u041d\u0430\u0448\u0451\u043b \u0432 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0436\u0451\u0441\u0442\u043a\u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438. \u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0434\u0430\u0451\u0442 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b<\/p>\n<p><code>$ kstat -pm sderr<\/code><\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043d\u0438\u0436\u0435.<\/p>\n<p><!--more--><\/p>\n<pre>#!\/bin\/bash\r\n# check disk in all pools for errors.\r\n# partially failing (or slow) disks\r\n# may result in horribly degradded \r\n# performance of zpools despite the fact\r\n# the pool is still healthy\r\n\r\n# exit codes\r\n# 0 OK\r\n# 1 WARNING\r\n# 2 CRITICAL\r\n# 3 UNKONOWN\r\n\r\nOUTPUT=\"\"\r\nWARNING=\"0\"\r\nCRITICAL=\"0\"\r\nSOFTLIMIT=\"5\"\r\nHARDLIMIT=\"20\"\r\n\r\nLIST=$(zpool status | grep \"c[0-9].*d0 \" | awk '{print $1}')\r\n    for DISK in $LIST \r\n    do  \r\n        ERROR=$(iostat -enr $DISK | cut -d \",\" -f 4 | grep \"^[0-9]\")\r\n        if [[ $ERROR -gt $SOFTLIMIT ]]\r\n        then\r\n            OUTPUT=\"$OUTPUT, $DISK:$ERROR\"\r\n            WARNING=\"1\"\r\n        fi\r\n        if [[ $ERROR -gt $HARDLIMIT ]]\r\n        then\r\n            OUTPUT=\"$OUTPUT, $DISK:$ERROR\"\r\n            CRITICAL=\"1\"\r\n        fi\r\n    done\r\n\r\nif [[ $CRITICAL -gt 0 ]]\r\nthen\r\n    echo \"CRITICAL: Disks with error count &gt;= $HARDLIMIT found: $OUTPUT\"\r\n    exit 2\r\nfi\r\nif [[ $WARNING -gt 0 ]]\r\nthen\r\n    echo \"WARNING: Disks with error count &gt;= $SOFTLIMIT found: $OUTPUT\"\r\n    exit 1\r\nfi\r\n\r\necho \"OK: No significant disk errors found\"\r\nexit 0<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u041d\u0430\u0448\u0451\u043b \u0432 \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0436\u0451\u0441\u0442\u043a\u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438. \u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0434\u0430\u0451\u0442 \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0438\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u044b $ kstat -pm sderr \u0421\u043a\u0440\u0438\u043f\u0442 \u043d\u0438\u0436\u0435.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-3802","post","type-post","status-publish","format-standard","hentry","category-solaris"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/3802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3802"}],"version-history":[{"count":2,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/3802\/revisions"}],"predecessor-version":[{"id":5018,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/3802\/revisions\/5018"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}