Page 1 of 1
Check_winfile only works locally
Posted: Wed Nov 04, 2015 10:47 am
by ILoveNagios
Hi I am able to execute my check_winfile command from my Windows 2008 R2 server successfully. However, running it from my Nagios server on Ubuntu I get an error.
In my nsclient.ini I have: check_DFSConflicts = scripts\check_winfile.exe --target C:\Temp --filter "age ge -15 minutes" --critical 0
Command I successfully run manually on Windows: check_winfile.exe --target C:\Temp --filter "age ge -15 minutes" --critical 0 - returns FILE OK - 0 files out of 2 to consider.
Running command on Nagios server: ./check_nrpe -H 10.1.0.57 -c check_dfsconflicts - returns Unknown option: 15
So it is getting hung up on the "-15 minutes" portion of the command but I'm not sure why.
If I remove the --filter from the nsclient.ini and re-run the command on Nagios then it sees the two files in the directory and reports 2 files to consider.
I'm wondering if the Time::ParseDate portion of nrpe isn't installed. It must have something to do with that but I can't figure it out.
Thanks in advance!
Re: Check_winfile only works locally
Posted: Wed Nov 04, 2015 2:53 pm
by rkennedy
Can you post the output in your nsclient.log for us to take a look at?
Re: Check_winfile only works locally
Posted: Wed Nov 04, 2015 5:14 pm
by ILoveNagios
rkennedy wrote:Can you post the output in your nsclient.log for us to take a look at?
Thanks for replying!
Here's what I'm getting:
2015-11-04 16:12:34: l:d:\source\nscp\trunk\modules\checkexternalscripts\commands.hpp

Failed to parse arguments for command 'check_DFSConflicts', using old split string method: unknown escape sequence: scripts\check_winfile.exe --target C:\Temp --filter "age ge -15 minutes" --critical 0 --verbose
Here's the nsclient.ini info after adding verbose logging:
; A list of scripts available to run from the CheckExternalScripts module. Syntax is: <command>=<script> <arguments>
[/settings/external scripts/scripts]
check_DFSConflicts = scripts\check_winfile.exe --target C:\Temp --filter "age ge -15 minutes" --critical 0 --verbose
Re: Check_winfile only works locally
Posted: Wed Nov 04, 2015 9:38 pm
by Box293
What version of NSClient++ are you using? I was able to sucessfully test this Windows 2008 R2 server running NSClient++ 0.4.3.143.
Also, if you upgraded from an old version, try this:
Take a backup copy of nsclient.ini
Uninstall
Delete the Directory
Install from scratch
Replace nsclient.ini with your copy
Restart service
On a separate note, NSClient++ has built in file checks so you don't need to worry about any external scripts. For example:
Code: Select all
Command:
./check_nrpe -H win2008R2-01 -c check_files -a path='C:\Temp' pattern=*.* 'filter=written > -15m' 'critical=count>0'
Output:
CRITICAL: 1/1 files (test.bat)|'count'=1;0;0
I have a bunch of examples here:
http://sites.box293.com/nagios/guides/c ... es-folders
Re: Check_winfile only works locally
Posted: Fri Nov 06, 2015 11:37 am
by ILoveNagios
Box293 wrote:What version of NSClient++ are you using? I was able to sucessfully test this Windows 2008 R2 server running NSClient++ 0.4.3.143.
This was a new install of NSClient++ version 0.4.1.73. I uninstalled as you described and installed 4.3.143.
I hadn't copied over my ini yet but on the Nagios server I now get "CHECK_NRPE: Error - Could not complete SSL handshake."
After copying the ini back I still get the same error.
I know security is higher in the newer version. I'm pretty sure I had compiled nrpe with SSL as well.
Thanks for your continued help on this!
Re: Check_winfile only works locally
Posted: Fri Nov 06, 2015 11:39 am
by ILoveNagios
Nevermind! I added
[/settings/NRPE/server]
insecure = true
to my nsclient.ini and now it works.
Thanks again for your help!
Re: Check_winfile only works locally
Posted: Fri Nov 06, 2015 11:41 am
by hsmith
Glad to hear it is working!
Are we all right to mark this thread resolved and close it?
Re: Check_winfile only works locally
Posted: Fri Nov 06, 2015 11:43 am
by ILoveNagios
hsmith wrote:Are we all right to mark this thread resolved and close it?
Absolutely. Thanks!