Linux 3.10.0-1160.31.1.el7.x86_64
Nagios XI 5.8.4
Host with NCPA plugin: Windows 10 Enterprise 20H2
I deleted my post regarding a somewhat related topic. It turns out Nagios doubles up on backslashes whether they are included in the .bat file (NCPA "plugin") or, as suggested in the previous post, in an argument for a plugin.
Here is the batch file, which works as expected at the Windows command line:
Code: Select all
:: Check for new .zip files
@ECHO OFF
DIR "\\C210EIBSWEBDEV1\e$\##VNO_Web_PDs\*.ZIP" > NUL 2> NUL
if "%ERRORLEVEL%" == "0" (
ECHO NOTIFICATION - NEW ZIP FILES IN \\C210EIBSWEBDEV1\e$\##VNO_Web_PDs & EXIT /B 1
) ELSE (
ECHO OK - NO NEW ZIP FILES IN \\C210EIBSWEBDEV1\e$\##VNO_Web_PDs & ECHO \\C210EIBSWEBDEV1\e$\##VNO_Web_PDs & EXIT /B 0
)
Note that the backslashes are NOT doubled in the status line but after that, they ARE.
Any assistance would be appreciated.
Steve