\u67e5\u770blinux raid\u5361\u7f13\u5b58<\/strong>\uff0c\u7528\u4e8e\u4f7f\u7528\u6240\u8ff0\u5de5\u5177\u67e5\u770braid\u5361\u8be6\u5c3d\u4fe1\u606f\uff0c\u6240\u8ff0raid\u5361\u8be6\u5c3d\u4fe1\u606f\u5305\u62ecraid\u5361\u673a\u578b\uff0craid\u8bbe\u7f6e\uff0cdisk\u76f8\u5173\u4fe1\u606f\uff0c\u5f53\u524d\u663e\u5b58\u5927\u5c0f\uff0c\u5f53\u524d\u903b\u8f91c\u76d8\u7ec4\u786c\u789f\u8054\u63a5\u72b6\u6001\uff0c\u5316\u5b66c\u76d8\u4fe1\u606f\u72b6\u6001\uff0craid\u6570\u76ee\u4fe1\u606f\uff0craid\u5361\u5168\u90e8\u4fe1\u606f\uff0c\u6240\u6709\u69fd\u4f4d\u7684\u786c\u789f\u4fe1\u606f\uff0cbbu\u7684\u4fe1\u606f\uff1b<\/p>\n\u6240\u8ff0\u811a\u672c\u5982\u4e0b\uff1a<\/p>\n
#\uff01\/bin\/sh<\/p>\n
hostname\uff1d`\/bin\/hostname`<\/p>\n
hostip\uff1d`ifconfigeth0|grep'inetaddr'|sed's\/.*addr:(.*)bcast.*\/1\/'`<\/p>\n
current_dir\uff1d`pwd`<\/p>\n
#rpm-ivhstorcli-1.17.08-1.noarch.rpm(\u5bf9\u5373\u5c06\u4f7f\u7528\u7684\u5de5\u5177\u624b\u52a8\u5b89\u88c5)<\/p>\n
cp\/opt\/megaraid\/storcli\/storcli*$current_dir(\u5373\u5c06\u4f7f\u7528\u5de5\u5177\u50a8\u5b58\u5230\u901a\u7528\u6587\u4ef6\u5939)<\/p>\n
battery\uff1d`.\/storcli64\/call\/bbushowall|grep\"chargerstatus\"|awk-f:'{print$1\":\"$2}'`<\/p>\n
<\/p>\n
raid\uff1d`.\/storcli64\/call\/dallshowall|grep\"raidlevel\"|tail-1|awk-f:'{print$1\":\"$2}'`(\u663e\u793araid\u5361\u673a\u578b\uff0craid\u8bbe\u7f6e\uff0cdisk\u76f8\u5173\u4fe1\u606f)<\/p>\n
disknum\uff1d`.\/storcli64\/call\/dallshowall|grep-c\"noncoercedsize\"`(\u67e5\u770b\u5f53\u524d\u663e\u5b58\u5927\u5c0f)<\/p>\n
onlinedisk\uff1d`.\/storcli64\/call\/dallshowall|grep\u201conline\u201d|wc-l|sed's\/\u67e5\u770b\u5f53\u524d\u6240\u6709\u903b\u8f91c\u76d8\u7ec4\u786c\u789f\u8054\u63a5\u72b6\u6001\uff0c\u80fd\u591f\u80fd\u88abraid\u5361\u8bbf\u95ee)<\/p>\n
faileddisk\uff1d`.\/storcli64\/call\/showall|grep\"faileddisks\"|awk-f\u201d'{print$4}'`<\/p>\n
(\u663e\u793a\u6240\u6709\u5316\u5b66c\u76d8\u4fe1\u606f\u72b6\u6001\uff0c\u662f\u5426\u6709c\u76d8\u5b58\u5728\u4e0d\u53ef\u6062\u590d\u9519\u8bef)<\/p>\n
memory\uff1d`.\/storcli64\/dall\/showall|grep\"memory<\/p>\n
adpinfonumber\uff1d`.\/storcli\/c0showctrlcount(\u663e\u793araid\u6570\u76ee\u4fe1\u606f)<\/p>\n
adpinfo\uff1d`.\/storcli\/c0showall(\u663e\u793araid\u5361\u5168\u90e8\u4fe1\u606f)<\/p>\n
adpinfo\uff1d`.\/storcli\/c0\/eall\/sallshow(\u663e\u793a\u6240\u6709\u69fd\u4f4d\u7684\u786c\u789f\u4fe1\u606f)<\/p>\n
adpinfo\uff1d`.\/storcli\/c0\/bbuall(\u663e\u793a\u6240\u6709bbu\u7684\u4fe1\u606f)\u3002<\/p>\n
\u663e\u793a\u6a21\u5757203\uff0c\u7528\u4e8e\u663e\u793a\u6240\u8ff0raid\u5361\u8be6\u5c3d\u4fe1\u606f\u3002<\/p>\n
\u6240\u8ff0\u663e\u793a\u8be6\u5c3d\u4fe1\u606f\u5982\u4e0b(\u5c5e\u4e8e\u811a\u672c\u4e00\u90e8\u4efd)\uff1a<\/p>\n
echo\"\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1dhostinformation\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\"<\/p>\n
echo\"hostname:$hostname\"<\/p>\n
echo-e\"hostip:$hostipn\"<\/p>\n
echo\"\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1draidinformation\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\"<\/p>\n
#echo\"$raidmode\"<\/p>\n
case\"$raid\"<\/p>\n
in<\/p>\n
\"raidlevel:primary-1,secondary-0,raidlevelqualifier-0\")echo\"raidlevel:raid1\"\uff1b\uff1b<\/p>\n
\"raidlevel:primary-0,secondary-0,raidlevelqualifier-0\")echo\"raidlevel:raid0\"\uff1b\uff1b<\/p>\n
\"raidlevel:primary-5,secondary-0,raidlevelqualifier-3\")echo\"raidlevel:raid5\"\uff1b\uff1b<\/p>\n
<\/p>\n
\"raidlevel:primary-1,secondary-3,raidlevelqualifier-0\")echo\"raidlevel:raid10\"\uff1b\uff1b<\/p>\n
esac<\/p>\n
if[-z\"$battery\"]\uff1bthen<\/p>\n
echo\"battery:null\"<\/p>\n
else<\/p>\n
echo\"$battery\"<\/p>\n
fi<\/p>\n
echo\"totaldiaknumber:$disknum\"<\/p>\n
echo\"onlinedisknumber:$onlinedisk\"<\/p>\n
echo\"faileddisknumber:$faileddisk\"\u3002<\/p>\n
\u811a\u672c\u6267\u884c\u5b8c\u6210\u4ee5\u540e\uff0c\u6d4b\u8bd5\u7ed3\u679c\u90fd\u4f1a\u663e\u793a\u5728\u684c\u9762\u4e0a\uff0c\u6d4b\u8bd5\u4eba\u5458\u987b\u8981\u67e5\u770b\u684c\u9762\u4fe1\u606f\uff0c\u672c\u53d1\u660e\u8fd8\u53ef\u4ee5\u5305\u62ec\u5bf9\u6bd4\u6a21\u5757\uff0c\u7528\u4e8e\u5bf9\u6bd4lsimegaraid\u5361log\u4fe1\u606f\u4e2d\u5f02\u5e38\u5173\u952e\u5b57\u7b5b\u9009\u67e5\u770b\u6709\u65e0error\u4fe1\u606f\u3002<\/p>\n
\u8be5shell\u811a\u672c\u8f93\u5165\u8fd0\u884c\u547d\u4ee4\u540e\uff0c\u811a\u672c\u5f00\u59cb\u624b\u52a8\u6267\u884c\u3002\u624d\u80fd\u9002\u5e94\u591a\u5e73\u53f0\u3002\u624b\u52a8\u5316\u64cd\u4f5c\uff0c\u4e0d\u987b\u8981\u6d4b\u8bd5\u4eba\u5458\u8bb0\u4f4f\u56e0\u5e73\u53f0\u800c\u5f02\u7684\u3001\u590d\u6742\u7684\u64cd\u4f5c\u6307\u4ee4\uff0c\u53ea\u987b\u8981\u6267\u884c\u5b8c\u6210\u4ee5\u540e\u67e5\u770b\u8f93\u51fa\u4fe1\u606f\u5c31\u53ef\u4ee5\u5b8c\u6210\u76f8\u5173raid\u5361\u68c0\u67e5\u4fe1\u606f\u641c\u96c6\u3002\u64cd\u4f5c\u6b65\u9aa4\u7b80\u4fbf\uff0c\u6025\u5267\u589e\u5f3a\u6d4b\u8bd5\u6548\u7387\u3002<\/p>\n
\u672c\u53d1\u660e\u63d0\u4f9b\u4e86\u4e00\u79cd\u5728\u670d\u52a1\u5668\u4e0b\u67e5\u770braid\u5361\u8be6\u5c3d\u4fe1\u606f\u7684\u7cfb\u7edf\uff0c\u901a\u8fc7\u5728\u5de5\u4f5c\u673a\u4e0a\u6267\u884cshell\u811a\u672c\u8fdb\u884c\u67e5\u770b\u6709\u5173raid\u8be6\u5c3d\u4fe1\u606f\uff0c\u901a\u8fc7\u67e5\u770b\u5bf9\u547d\u4ee4\u8f93\u51fa\u7684\u7ed3\u679c\u548c\u670d\u52a1\u5668\u7cfb\u7edf\u4e0b\u5176\u4ed6\u76ee\u5f55\u6765\u5b8c\u6210\u68c0\u67e5\uff0c\u67e5\u770braid\u5361\u4ea7\u54c1\u662f\u5426\u6b63\u5e38\u8fd0\u884c\uff0c\u4ee5\u8fbe\u5230\u6d4b\u8bd5\u4e4b\u524d\u63d0\u524d\u68c0\u67e5\u4ea7\u54c1\u5065\u5eb7\uff0c\u9632\u6cbb\u4ea7\u54c1\u81ea\u8eab\u7f18\u7531\u9020\u6210\u670d\u52a1\u5668\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u95ee\u9898\uff0c\u540c\u65f6\u8fd8\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u51fa\u73b0\u95ee\u9898\u65f6\u4f7f\u7528\u6b64\u811a\u672c\u67e5\u770b\u662f\u5426\u662fraid\u5361\u7f18\u7531\u9020\u6210\u53d1\u751f\u95ee\u9898\u7f18\u7531\u3002\u672c\u53d1\u660e\u624d\u80fd\u9002\u5e94\u591a\u5e73\u53f0\uff0c\u64cd\u4f5c\u6b65\u9aa4\u7b80\u4fbf\uff0c\u3001\u63d0\u9ad8\u4e86\u6d4b\u8bd5\u6548\u7387\u3002<\/p>\n
\u5bf9\u6240\u516c\u5f00\u7684\u65bd\u884c\u4f8b\u7684\u4e0a\u8ff0\u8bf4\u660e\uff0c\u4f7f\u672c\u9886\u57df\u6280\u672f\u4eba\u5458\u624d\u80fd\u5b9e\u73b0\u6216\u4f7f\u7528\u672c\u53d1\u660e\u3002\u5bf9\u8fd9\u79cd\u65bd\u884c\u4f8b\u7684\u591a\u79cd\u66f4\u6539\u5bf9\u672c\u9886\u57df\u6280\u672f\u4eba\u5458\u6765\u8bf4\u5c06\u662f\u663e\u800c\u6613\u89c1\u7684\uff0c\u672c\u6587\u4e2d\u6240\u5b9a\u4e49\u7684\u901a\u5e38\u539f\u7406\u53ef\u4ee5\u5728\u4e0d\u8131\u79bb\u672c\u53d1\u660e\u7684\u7cbe\u795e\u6216\u8303\u56f4\u7684\u60c5\u51b5\u4e0b\uff0c\u5728\u5176\u4ed6\u65bd\u884c\u4f8b\u4e2d\u5b9e\u73b0\u3002\u56e0\u800c\uff0c\u672c\u53d1\u660e\u5c06\u4e0d\u4f1a\u88ab\u9650\u5236\u4e8e\u672c\u6587\u6240\u793a\u7684\u90a3\u4e9b\u65bd\u884c\u4f8b\uff0c\u800c\u662f\u7b26\u5408\u4e0e\u672c\u6587\u6240\u516c\u5f00\u7684\u539f\u7406\u548c\u65b0\u9896\u7279\u5f81\u76f8\u4e00\u81f4\u7684\u6700\u5bbd\u7684\u8303\u56f4\u3002<\/p>\n
\u5bfc\u822a\uff1aX\u6280\u672f>\u6700\u65b0\u4e13\u5229>\u4f30\u7b97;\u4f30\u7b97;\u8ba1\u6570\u8bbe\u5907\u7684\u5236\u9020\u53ca\u5176\u5e94\u7528\u6280\u672f>\u4e00\u79cd\u5728\u670d\u52a1\u5668\u4e0b\u67e5\u770bRAID\u5361\u8be6\u5c3d\u4fe1\u606f\u7684\u65b9\u5f0f\u53ca\u7cfb\u7edf\u4e0e\u6d41\u7a0b<\/p>\n
\u6280\u672f\u7279\u70b9\uff1a<\/p>\n
\u6280\u672f\u603b\u7ed3<\/p>\n
\u672c\u53d1\u660e\u63d0\u4f9b\u4e86\u4e00\u79cd\u5728\u670d\u52a1\u5668\u4e0b\u67e5\u770bRAID\u5361\u8be6\u5c3d\u4fe1\u606f\u7684\u65b9\u5f0f\u53ca\u7cfb\u7edf\uff0c\u901a\u8fc7\u5728\u5de5\u4f5c\u673a\u4e0a\u6267\u884cshell\u811a\u672c\u8fdb\u884c\u67e5\u770b\u6709\u5173RAID\u8be6\u5c3d\u4fe1\u606f\uff0c\u901a\u8fc7\u67e5\u770b\u5bf9\u547d\u4ee4\u8f93\u51fa\u7684\u7ed3\u679c\u548c\u670d\u52a1\u5668\u7cfb\u7edf\u4e0b\u5176\u4ed6\u76ee\u5f55\u6765\u5b8c\u6210\u68c0\u67e5\uff0c\u67e5\u770bRAID\u5361\u4ea7\u54c1\u662f\u5426\u6b63\u5e38\u8fd0\u884c\uff0c\u4ee5\u8fbe\u5230\u6d4b\u8bd5\u4e4b\u524d\u63d0\u524d\u68c0\u67e5\u4ea7\u54c1\u5065\u5eb7\uff0c\u9632\u6cbb\u4ea7\u54c1\u81ea\u8eab\u7f18\u7531\u9020\u6210\u670d\u52a1\u5668\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u95ee\u9898\uff0c\u540c\u65f6\u8fd8\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u51fa\u73b0\u95ee\u9898\u65f6\u4f7f\u7528\u6b64\u811a\u672c\u67e5\u770b\u662f\u5426\u662fRAID\u5361\u7f18\u7531\u9020\u6210\u53d1\u751f\u95ee\u9898\u7f18\u7531\u3002\u672c\u53d1\u660e\u624d\u80fd\u9002\u5e94\u591a\u5e73\u53f0\uff0c\u64cd\u4f5c\u6b65\u9aa4\u7b80\u4fbf\uff0c\u63d0\u5347\u4e86\u6d4b\u8bd5\u6548\u7387\u3002<\/p>\n
\u6280\u672f\u7814\u5236\u4eba\u5458\uff1a\u5f90\u680b<\/p>\n
\u53d7\u4fdd\u62a4\u7684\u6280\u672f\u4f7f\u7528\u8005\uff1a\u897f\u5b89\u4e91\u6d77\u4fe1\u606f\u6280\u672f\u6709\u9650\u516c\u53f8<\/p>\n
\u6280\u672f\u7814\u5236\u65e5\uff1a2017.11.30<\/p>\n
\u6280\u672f\u516c\u5e03\u65e5\uff1a2018.05.08<\/p>\n
\u5b8c\u6574\u5168\u90e8\u8be6\u5c3d\u6280\u672f\u8d44\u6599\u4e0b\u8f7d<\/p>\n","protected":false},"excerpt":{"rendered":"
\u4e00\u65b9\u9762\uff0c\u672c\u53d1\u660e\u63d0\u4f9b\u4e86\u4e00\u79cd\u5728\u670d\u52a1\u5668\u4e0b\u67e5\u770braid\u5361\u8be6\u7ec6\u4fe1\u606f\u7684\u65b9\u6cd5\uff0c\u5305\u62ec\uff1a<\/p>\n","protected":false},"author":1,"featured_media":282017,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-282016","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/282016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=282016"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/282016\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/282017"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=282016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=282016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=282016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}