VMWARE
asked on
Needed help for a batch file calling an external command
Hello,
There is a command for monitoring the status of a RAID Hardware called hpacucli.exe (C:\Program Files (x86)\Compaq\Hpacucli\Bin\ hpacucli.e xe)...
The output of that command is
hpacucli.exe ctrl all show status
Smart Array B110i SATA RAID in Slot 0 (Embedded)
Controller Status: OK
I need a batch file that could be added as a scheduled task to check that the array is healthy, and if not, send an email informing of it.
Thanks in advance
There is a command for monitoring the status of a RAID Hardware called hpacucli.exe (C:\Program Files (x86)\Compaq\Hpacucli\Bin\
The output of that command is
hpacucli.exe ctrl all show status
Smart Array B110i SATA RAID in Slot 0 (Embedded)
Controller Status: OK
I need a batch file that could be added as a scheduled task to check that the array is healthy, and if not, send an email informing of it.
Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Something like this. The host name is appended to the subject line.
@echo off
hpacucli.exe ctrl all show status > %temp%\hpstats.txt
find "Controller Status: OK" %temp%\hpstats.txt >nul || blat.exe %temp%\hpstats.txt -server YourSMPTServer -to You@YourDomain.com -f ValidSender@YourDomain.com -s "HP RAID Util error on %Computername%!"
del %temp%\hpstats.txt >nul 2>nul
ASKER
And finally how do i append the hostname to the email?