REM RAID Status von ESXi-Host ermitteln:
REM c a.l. 2014
C:\Users\Administrator\Desktop\plink.exe 192.168.0.10 -l root -pw passwort -m "putty_comand.txt" | more > putty.txt
find "State :" putty.txt > esxi_raid_state.txt
if [%1] == [send_state] goto :send_state
for /f "usebackq tokens=2 delims=:" %%a in (`find "State :" putty.txt`) do if NOT " %%a" == " Optimal" goto :send_error
goto :ende
:send_error
C:\Users\Administrator\Desktop\blat311\full\blat.exe putty.txt -to al@alanz.ch -subject ESXi-Host-RAID-Error -q
:send_state
C:\Users\Administrator\Desktop\blat311\full\blat.exe esxi_raid_state.txt -to al@alanz.ch -subject ESXi-Host-RAID-State -q
:ende
if [%2]==[nopause] exit
more esxi_raid_state.txt
pause
exit
putty_comand.txt:
cd /opt/lsi/MegaCLI
./MegaCli -AdpAllInfo aAll
./MegaCli -LDPDInfo -aAll
Keine Kommentare:
Kommentar veröffentlichen