I currently have the following script on a Windows Server:
@echo off set path=%PATH%;C:\UnxUtils\usr\local\wbin cd /D Z:\videos forfiles /M *_1.mkv /D +%date% > C:\mkv.txt >NUL 2>&1 FOR /F "tokens=*" %%B IN ('grep -c _1.mkv c:\mkv.txt') DO SET VIDEOS=%%B if %VIDEOS% GEQ 1 ( echo "BAD VIDEOS!" exit /B 0 ) else ( echo "Videos OK" exit /B 1 ) I need Nagios to check if the scripts exit code is 0 or 1 to diplay a critical alert or a ok. Is this possible?