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!
Check_winfile only works locally
Re: Check_winfile only works locally
Can you post the output in your nsclient.log for us to take a look at?
Former Nagios Employee
-
ILoveNagios
- Posts: 5
- Joined: Wed Nov 04, 2015 9:30 am
Re: Check_winfile only works locally
Thanks for replying!rkennedy wrote:Can you post the output in your nsclient.log for us to take a look at?
Here's what I'm getting:
2015-11-04 16:12:34: l:d:\source\nscp\trunk\modules\checkexternalscripts\commands.hpp
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
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Check_winfile only works locally
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:
I have a bunch of examples here:
http://sites.box293.com/nagios/guides/c ... es-folders
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;0http://sites.box293.com/nagios/guides/c ... es-folders
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
ILoveNagios
- Posts: 5
- Joined: Wed Nov 04, 2015 9:30 am
Re: Check_winfile only works locally
This was a new install of NSClient++ version 0.4.1.73. I uninstalled as you described and installed 4.3.143.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.
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!
-
ILoveNagios
- Posts: 5
- Joined: Wed Nov 04, 2015 9:30 am
Re: Check_winfile only works locally
Nevermind! I added
[/settings/NRPE/server]
insecure = true
to my nsclient.ini and now it works.
Thanks again for your help!
[/settings/NRPE/server]
insecure = true
to my nsclient.ini and now it works.
Thanks again for your help!
Re: Check_winfile only works locally
Glad to hear it is working!
Are we all right to mark this thread resolved and close it?
Are we all right to mark this thread resolved and close it?
Former Nagios Employee.
me.
me.
-
ILoveNagios
- Posts: 5
- Joined: Wed Nov 04, 2015 9:30 am
Re: Check_winfile only works locally
Absolutely. Thanks!hsmith wrote:Are we all right to mark this thread resolved and close it?