check_service.bat

echo remote : %1 
echo service : %2
echo state : %3
echo sc %1 query %2 | find "%3"
set error_chk=0
sc %1 query %2 | find "%3"
set error_chk=%errorlevel%
if %error_chk% equ 0 goto :end
:suite
set var=%date% a %time%
echo sc %1 start "%2"
sc %1 start "%2"
%ABM_BIN%/tmail -c %ABM_BIN%/tmail.ini -to eric.fougere@faiveleytransport.com -sub "Service : %2 is not %3 on %1 server. Restarted by Vtom." -msg "The service %2 is now %3 on %1 server, at %var% ."
:end

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *