zabbix trap 监控windows 服务器raid中个磁盘状态脚本

@echo off

e:
cd raid
for /f "usebackq" %%i in (`"@MegaCli64.exe -PDList -a0|find /C "Online""`) do set num=%%i
echo zabbix_sender.exe -z zabbix-server-ip -p 10051 -s "监控主机名"  -k pdnum -o %num% >> zabbix_sender.log
zabbix_sender.exe -z zabbix-server-ip -p 10051 -s "监控主机名"  -k pdnum -o %num% >> zabbix_sender.log
 
for /f "usebackq" %%j in (`"@MegaCli64.exe -LDInfo -Lall -aALL|find /C "Optimal""`) do set state=%%j
echo zabbix_sender.exe -z zabbix-server-ip -p 10051 -s "监控主机名"  -k vdstatus -o %state% >> zabbix_sender.log
zabbix_sender.exe -z zabbix-server-ip -p 10051 -s "监控主机名"  -k vdstatus -o %state% >> zabbix_sender.log
date /T >> zabbix_sender.log
time /T >> zabbix_sender.log
 
echo done
exit

 

你可能感兴趣的:(raid监控)