以下列舉一些常用命令:
命令使用:
megacli -ldinfo -lall -aall 查raid級別
megacli -adpallinfo -aall 查raid卡資訊
megacli -pdlist -aall 檢視硬碟資訊
megacli -adpbbucmd -aall 檢視電池資訊
megacli -fwtermlog -dsply -aall 檢視raid卡日誌
megacli常用引數介紹
megacli -adpcount 【顯示介面卡個數】
megacli -adpgettime –aall 【顯示介面卡時間】
megacli -adpallinfo -aall 【顯示所有介面卡資訊】
megacli -ldinfo -lall -aall 【顯示所有邏輯磁碟組資訊】
megacli -pdlist -aall 【顯示所有的物理資訊】
megacli -adpbbucmd -getbbustatus -aall |grep 『charger status』 【檢視充電狀態】
megacli -adpbbucmd -getbbustatus -aall【顯示bbu狀態資訊】
megacli -adpbbucmd -getbbucapacityinfo -aall【顯示bbu容量資訊】
megacli -adpbbucmd -getbbudesigninfo -aall 【顯示bbu設計引數】
megacli -adpbbucmd -getbbuproperties -aall 【顯示當前bbu屬性】
megacli -cfgdsply -aall 【顯示raid卡型號,raid設定,disk相關資訊】
linux下監控戴爾riad卡指令碼:
#!/bin/sh#$id: check_perc5i.sh $
#creater:wangwei
#check
raid card perc 5/i vd
andpd state
#redhat5 32
bituse command megacli
#redhat5 64
bituse command megacli64
hostname=`/bin/hostname`
card=`/opt/megaraid/megacli/megacli64 -adpallinfo -aall |grep
"product name"
| cut -d
':'-f2`
vdstate1=`/opt/megaraid/megacli/megacli64 -cfgdsply -aall | grep
"state"
` vdstate2=`/opt/megaraid/megacli/megacli64 -adpallinfo -aall | grep
"degraded"
` vdstate3=`/opt/megaraid/megacli/megacli64 -adpallinfo -aall | grep
" offline"
` pdstate1=`/opt/megaraid/megacli/megacli64 -cfgdsply -aall | grep
"online"
| wc -l | sed
's/ //'
` pdstate2=`/opt/megaraid/megacli/megacli64 -cfgdsply -aall | grep
"rebuild"
| wc -l | sed
's/ //'
` pdstate3=`/opt/megaraid/megacli/megacli64 -adpallinfo -aall | grep
"critical disks"
` pdstate4=`/opt/megaraid/megacli/megacli64 -adpallinfo -aall | grep
"failed disks"
` pdstate5=`/opt/megaraid/megacli/megacli64 -pdlist -aall|egrep
"error|device id"
` pdstate6=`/opt/megaraid/megacli/megacli64 -cfgdsply -aall|egrep
"device id|firmware state"
|sed
'n;s/\nfirmware state:/ /'
` power1=`/opt/megaraid/megacli/megacli64 -adpbbucmd -getbbustatus -aall|grep
"full charge capacity:"
|awk
''`
power2=`/opt/megaraid/megacli/megacli64 -adpbbucmd -getbbustatus -aall|grep
"remaining capacity:"
|awk
''`
#percent=`echo
'scale=2;'
$'*100/'$''
|bc -l`
percent=`echo $(($*100/$))`
echo
"====host information:"
echo
""echo
"host : $hostname"
echo
"raid card :$card"
echo
""echo
"====power usage:"
echo
""echo
"the remaining power:"
$percent
"%"echo
""echo
"====virtual disk state:"
echo
""echo
"virtual disk $vdstate1"
echo
"$vdstate2"
echo
"$vdstate3"
echo
""echo
"====physical disk state:"
echo
""echo
"$pdstate6"
echo
"online disk : $pdstate1"
echo
"rebuild disk : $pdstate2"
echo
"$pdstate3"
echo
"$pdstate4"
echo
""echo
"====physical disk error:"
echo
""echo
"$pdstate5"
echo
""#查raid卡資訊:
#/opt/megaraid/megacli/megacli64 -adpallinfo -aall
#riad檢視電池的資訊:
#/opt/megaraid/megacli/megacli64 -adpbbucmd -getbbustatus -aall
#電池剩餘:/opt/megaraid/megacli/megacli64 -adpbbucmd -getbbustatus -aall|grep
"remaining capacity:"
|awk
''#電池總量:/opt/megaraid/megacli/megacli64 -adpbbucmd -getbbustatus -aall|grep
"full charge capacity:"
|awk
''#檢視riad卡的日誌:
#/opt/megaraid/megacli/megacli64 -fwtermlog -dsply -a0
#檢視硬碟資訊:
#/opt/megaraid/megacli/megacli64 -pdlist -aall
檢視Linux系統下Raid資訊
軟體raid 只能通過linux系統本身來檢視 cat proc mdstat 可以看到raid級別,狀態等資訊。硬體raid 最佳的辦法是通過已安裝的raid廠商的管理工具來檢視,有cmdline,也有圖形介面。如adaptec公司的硬體卡就可以通過下面的命令進行檢視 usr dpt raidut...
理論 Linux的RAID磁碟陣列與陣列卡
二 陣列卡介紹 磁碟陣列卡分軟陣列和硬陣列,生產環境伺服器用的是硬陣列卡,家用nas儲存用的也是硬陣列卡 高階的伺服器都帶磁碟陣列功能 r0和r1 比較高 硬陣列,外觀 顯示卡 網絡卡長相有點類似,都是插在pci e擴充套件槽位置 華為lsi卡用的多,戴爾h700卡用的多 生產環境中系統盤用raid...
Linux下配置LVM和RAID例項
在我們舉例的系統上,有四塊大小相等的scsi硬碟 fdisk l 檢視系統硬碟 第一塊scsi硬碟上有我們的系統分割槽。其它3塊都沒有分割槽。首先,我們為每塊csci硬碟建立分割槽 fdisk dev sbd command m for help new command action e exten...