ECHO OFF

SET ABS_WEBSERVERHOME=%1
SET UDPPORT=%2
SET SNMP=%3
SET WEBCOMPONENT=%4

setlocal enabledelayedexpansion
for /f "tokens=3*" %%a in ('%ABS_WEBSERVERHOME%custom\snmpwalk\snmpwalk.exe -r:[LOCALHOSTIP] -p:%UDPPORT% -c:public -op:1.3.6.1.4.1.227.%SNMP%') DO SET lastLine=%%a
    SET ABS_SNMPCHEK=%lastLine%
        if "%ABS_SNMPCHEK%"=="Value=1" (
            ECHO %WEBCOMPONENT% Deploy Succesful
        ) else (
            echo Failed %WEBCOMPONENT% is not running. View log in %ABS_WEBSERVERHOME%logs
        )
    )
