Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
lmiltchev
Former Nagios Staff
Posts: 13589 Joined: Mon May 23, 2011 12:15 pm
Post
by lmiltchev » Wed Sep 11, 2013 4:11 pm
I tried it on my test box and it seems it's working fine. In the "NSC.ini" file, I have:
Code: Select all
check_winfile=scripts\check_winfile.exe //T:30 //NoLogo $ARG1$
I tested it from the nagios server, by running:
Code: Select all
./check_nrpe -H <windows_client_ip> -c check_winfile -a '-t c:\tmp --filter "age ge -24 hours" --critical 0'
FILE OK - 0 files out of 7 to consider|'selected files'=0;;0; 'all files'=7 'deleted files'=0
Be sure to check out our
Knowledgebase for helpful articles and solutions!
csward
Posts: 46 Joined: Fri Mar 08, 2013 4:37 pm
Post
by csward » Wed Sep 11, 2013 4:25 pm
Yes, i can get this working locally, just not through nagios. I keep getting the:
(No output returned from plugin)
csward
Posts: 46 Joined: Fri Mar 08, 2013 4:37 pm
Post
by csward » Wed Sep 11, 2013 5:01 pm
Ran from the nagios command line and get:
administrator@CSP-NAG-P01:/usr/local/src/nagios-plugins-1.4.16/plugins$ ./check_nrpe -H CSITFPSP01A -c check_winfile -a '-target c:\test --filter "age ge -24 hours" --critical 0'
FILE UNKNOWN - No targets are specified.
lmiltchev
Former Nagios Staff
Posts: 13589 Joined: Mon May 23, 2011 12:15 pm
Post
by lmiltchev » Wed Sep 11, 2013 5:02 pm
Did you add $ARG2$ to the check_nrpe command definition? Did you set up the "check_winfile" command definition in the "NSC.ini" (nsclient.ini) file in a similar way?
Code: Select all
check_winfile=scripts\check_winfile.exe //T:30 //NoLogo $ARG1$
What happens, when you run a check from the nagios server?
Code: Select all
./check_nrpe -H <windows_client_ip> -c check_winfile -a '-t <path to your file> --filter "age ge -24 hours" --critical 0'
Be sure to check out our
Knowledgebase for helpful articles and solutions!
csward
Posts: 46 Joined: Fri Mar 08, 2013 4:37 pm
Post
by csward » Wed Sep 11, 2013 5:20 pm
Tried with IP also:
administrator@CSP-NAG-P01:/usr/local/src/nagios-plugins-1.4.16/plugins$ ./check_nrpe -H 10.64.3.157 -c check_winfile -a '-t "c:\Test" --filter "age ge -24 hours" --critical 0'
FILE UNKNOWN - No targets are specified.
Yes, i added the $ARG2$
Not sure why this isn't working. Seems to work from the host.
lmiltchev
Former Nagios Staff
Posts: 13589 Joined: Mon May 23, 2011 12:15 pm
Post
by lmiltchev » Thu Sep 12, 2013 9:06 am
Hm-m, do you have the following two lines in the NSC.ini (nsclient.ini) under the NRPE and External Scripts sections?
Code: Select all
allow arguments = true
allow nasty characters = true
Be sure to check out our
Knowledgebase for helpful articles and solutions!
csward
Posts: 46 Joined: Fri Mar 08, 2013 4:37 pm
Post
by csward » Thu Sep 12, 2013 9:36 am
That was it. At least it worked for my test folder. I thought I had this set, apparently there is more than one place to do this.
I have a lot of files in the production folder and I'm getting this error:
CHECK_NRPE: Socket timeout after 10 seconds.
Is there a way to extend this? I have this set to -t 120
so not sure why it's timing out at 10 seconds.
Thanks
slansing
Posts: 7698 Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...
Post
by slansing » Thu Sep 12, 2013 9:47 am
Do you have a "-t 10" hard coded in your commands anywhere? On the check command, service definition, or the nsclient command? If not run the following, you may find you must increase the timeout in the nagios.cfg:
Code: Select all
cat /usr/local/nagios/etc/nagios.cfg | grep timeout
csward
Posts: 46 Joined: Fri Mar 08, 2013 4:37 pm
Post
by csward » Thu Sep 12, 2013 9:47 am
actually, after running this from the nagios command prompt:
./check_nrpe -H 10.64.3.157 -t 120 -c check_winfile -a '-t j:\AWIIProxy\ProcessedMessages'
I get this:
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
Since it works with my c:\test folder could this just be a permission issue?
csward
Posts: 46 Joined: Fri Mar 08, 2013 4:37 pm
Post
by csward » Thu Sep 12, 2013 9:49 am
service_check_timeout=60
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
perfdata_timeout=5
# service_check_timeout seconds. This can be useful if a
service_check_timeout_state=c