check_files plugin in Nagios XI
Posted: Tue Mar 03, 2020 8:13 am
Hi Team,
I want to monitor a log file/text file on a Windows server and if that particular file is not updated in last 15 minutes, Nagios should send alert.
We are using NSCP-0.5.2.35-x64 version of Nagios Xi.
I referred to File modified (NSClient++ via check_nrpe) section from below:
https://support.nagios.com/kb/article.p ... e_modified
The plugin that I am using is :
check_files.vbs - external script to be used with nsclient
Below steps I performed:
1. I am attaching the nsclient config file here, please let me know what all changes needs to be done there. I have made below changes after referring to different articles:
[/settings/external scripts/wrappings]
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
vbs=cscript.exe //T:30 //NoLogo %SCRIPT% %ARGS%
[/settings/external scripts/wrapped scripts]
missing = missing.ps1
ok = check_test.ps1
check_files = scripts\check_files.exe -l 'F:\\Nagios_logs_testing' pattern=*.* 'filter= written < -10n' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
[/settings/external scripts/scripts]
restart_service = scripts\restart_service.bat "$ARG1$"
check_files=scripts\check_files.vbs
2. The check_files plugin is already there in C:\Program Files\NSClient++\scripts path on target server.
3. I downloaded the same plugin on Nagios server as well.
After implementing it in GUI, I am getting below error:
Failed to execute check_files seems more like a script maybe you need a script executable first: failed to lookup error code: 193 (reason: 126)
I am attaching the config file, the service definition and command definition screenshot from Nagios.
Please let me know what additional changes I need to do in config file , in command definition, in service definition.
Thanks in advance!!
I want to monitor a log file/text file on a Windows server and if that particular file is not updated in last 15 minutes, Nagios should send alert.
We are using NSCP-0.5.2.35-x64 version of Nagios Xi.
I referred to File modified (NSClient++ via check_nrpe) section from below:
https://support.nagios.com/kb/article.p ... e_modified
The plugin that I am using is :
check_files.vbs - external script to be used with nsclient
Below steps I performed:
1. I am attaching the nsclient config file here, please let me know what all changes needs to be done there. I have made below changes after referring to different articles:
[/settings/external scripts/wrappings]
ps1 = cmd /c echo scripts\\%SCRIPT% %ARGS%; exit($lastexitcode) | powershell.exe -command -
vbs=cscript.exe //T:30 //NoLogo %SCRIPT% %ARGS%
[/settings/external scripts/wrapped scripts]
missing = missing.ps1
ok = check_test.ps1
check_files = scripts\check_files.exe -l 'F:\\Nagios_logs_testing' pattern=*.* 'filter= written < -10n' 'crit= count > 0' 'empty-state=ok' 'empty-syntax=${status}: No files found' 'top-syntax=${status}: ${count} files found'
[/settings/external scripts/scripts]
restart_service = scripts\restart_service.bat "$ARG1$"
check_files=scripts\check_files.vbs
2. The check_files plugin is already there in C:\Program Files\NSClient++\scripts path on target server.
3. I downloaded the same plugin on Nagios server as well.
After implementing it in GUI, I am getting below error:
Failed to execute check_files seems more like a script maybe you need a script executable first: failed to lookup error code: 193 (reason: 126)
I am attaching the config file, the service definition and command definition screenshot from Nagios.
Please let me know what additional changes I need to do in config file , in command definition, in service definition.
Thanks in advance!!