ESXI上安裝MegaCli磁碟檢測工具

2021-07-12 02:06:26 字數 3438 閱讀 9865

esxi上安裝megacli

wget  

esxcli software vib install -v /tmp/vmware-esx-megacli-8.07.07.vib --no-sig-check

mkdir -p /opt/megaraid/megacli

cd  /opt/megaraid/megacli

ln  -s /opt/lsi/megacli/megacli megacli64

ln  -s /opt/lsi/megacli/libstorelib.so  libstorelib.so

/opt/megaraid/megacli/megacli64        -ldinfo -lall -aall   檢視raid狀態

/opt/megaraid/megacli/megacli64         -pdlist -aall    檢視每塊物理磁碟資訊(可以看到具體哪塊磁碟出問題)

/opt/megaraid/megacli/megacli64         -pdlist -aall  |  grep  "firmware state:" 

/opt/megaraid/megacli/megacli64          -pdlist -aall  |  grep  "raw size:"

/opt/megaraid/megacli/megacli64          -pdlist -aall  |  grep  "slot number:"

/opt/megaraid/megacli/megacli64          -adpallinfo -aall     查raid卡資訊            

/opt/megaraid/megacli/megacli64           -adpbbucmd -aall      檢視電池資訊

/opt/megaraid/megacli/megacli64           -fwtermlog -dsply -aall 檢視raid卡日誌

/opt/megaraid/megacli/megacli64            -adpcount             顯示介面卡個數

/opt/megaraid/megacli/megacli64           -adpgettime –aall    顯示介面卡時間

/opt/megaraid/megacli/megacli64            -adpallinfo -aall     顯示所有介面卡資訊

/opt/megaraid/megacli/megacli64           -adpbbucmd -getbbustatus -aall |grep 『charger status』 檢視充電狀態

/opt/megaraid/megacli/megacli64           -adpbbucmd -getbbustatus -aall 顯示bbu狀態資訊

/opt/megaraid/megacli/megacli64           -adpbbucmd -getbbucapacityinfo -aall  顯示bbu容量資訊 

/opt/megaraid/megacli/megacli64           -adpbbucmd -getbbudesigninfo -aall    顯示bbu設計引數

/opt/megaraid/megacli/megacli64           -adpbbucmd -getbbuproperties -aall    顯示當前bbu屬性

/opt/megaraid/megacli/megacli64           -cfgdsply -aall       顯示raid卡型號,raid設定,disk相關資訊

使用crontab定時監控硬碟狀態的小指令碼,該指令碼實現在監控到硬碟故障時發出報警郵件,並關聯到手機簡訊,以便通知運維人員及時處理。

#!/bin/sh

log_dir=/backup/autobackup/logsum/

log_name=_raid_disk_monitor

logtime=$(date +%y%m%d --date='1 days ago')

fix=.log

host=_`hostname`

status=0

echo  "checking raid status on $host" >$log_dir$logtime$log_name$host$fix

raid_contrller=`megacli -adpallinfo -aall |grep "product name" | cut -d: -f2`

echo "controller : $raid_contrller" >>$log_dir$logtime$log_name$host$fix

online_disk_num=`megacli  -pdlist -aall | grep online | wc -l`

echo "totall number of physical disks online : $online_disk_num" >>$log_dir$logtime$log_name$host$fix

degrade_disk=`megacli -adpallinfo -a0 |grep "degrade"`

echo $degrade_disk >>$log_dir$logtime$log_name$host$fix

degrade_disk_num=`echo $degrade_disk |cut -d" " -f3`

failed_disk=`megacli -adpallinfo -a0 |grep "failed disks"`

echo $failed_disk >>$log_dir$logtime$log_name$host$fix

failed_disk_num=`echo $failed_disk |cut -d" " -f4`

##將raid_disk_monitor.log scp到mail上

scp -p120 $log_dir$logtime$log_name$host$fix lai@60.*.*.*:/data/autobackup/logsum

ssh -p120 [email protected]  "cat /data/autobackup/logsum//$(date +%y%m%d --date='1 days ago')_raid*| mail -s "`echo "

/$(date +%y'年'%m'月'%d'日' --date='1 days ago')error:tv233_raid卡硬碟報警"|iconv -f utf-8 -t gbk`" [email protected]

m,1860531****@wo.com.cn  -- -f [email protected]"

[ "$degrade_disk_num" -ne 0 ] && status=1

[ "$failed_disk_num" -ne 0 ] && status=1

exit $status

MegaCli安裝及使用

megacli安裝及使用雜記 這裡會找到2個版本的megacli wget 然後解開 unzip 1.01.39 linux cli.zip 會解出1個readme檔案和乙個rpm包。老規矩 rpm vh megacli 1.01.39 0.i386.rpm 安裝結束後,執行命令將被安裝到 opt ...

MegaCli 安裝過程

首先說下自己遇到的坑 root web 01 zw 119 install opt megaraid megacli megacli64 v megacli sas raid management tool ver 1.01.39 aug 01,2007 由於在做 cmdb 需要統計伺服器的硬碟ra...

檢視RAID硬碟資訊MegaCli安裝

選擇相應版本的安裝包 unzip csa1.5 megacli rel80571.zip cd megacli megacli linux rpm ivh megacli 8.05.71 1.noarch.rpm 安裝完成 ln s opt megaraid megacli megacli64 us...