Link to home
Start Free TrialLog in
Avatar of VMWARE
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.exe)...

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
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VMWARE
VMWARE

ASKER

Hello Qlemo;

And finally how do i append the hostname to the email?
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

Open in new window