Page 2 of 5

Re: File check plugin

Posted: Fri Jul 26, 2013 11:31 am
by ofadl
yes like i mentioned before, i saved the plugin the the scripts folder of NSClient, copied the definition that was given into my nsc.ini file under [External Scripts], then finally restart NSClient. Ran the command on the nagios machine :

Code: Select all

./check_nrpe -H 10.100.50.18 -p 5666 -c check_winfile -a  '--target C:\Program Files\NSClient++\scripts --filter "age gt -5 minutes" --critical 0'
with the output:

Code: Select all

UNKNOWN: No handler for that command
checked my nsclient.log file :

Code: Select all

2013-07-26 12:33:39: message:NSClient++.cpp:1157: No handler for command: 'check_winfile'
2013-07-26 12:33:39: message:include\NSCHelper.cpp:238: No handler for command 'check_winfile'.

UPDATE: My apologies, my boss confused me, the destination im going to be checking is C:\ip\hugco. There is nothing in there yet, but the whole focus is to get it working to check that location

Re: File check plugin

Posted: Fri Jul 26, 2013 12:38 pm
by yancy
uncomment CheckExternalScripts.dll

Code: Select all

;CheckExternalScripts.dll
So it sould be

Code: Select all

CheckExternalScripts.dll
-Yancy

Re: File check plugin

Posted: Fri Jul 26, 2013 12:46 pm
by ofadl
Perfect! worked like a charm! Now i just need some help setting up a command and service check for this :D

Re: File check plugin

Posted: Fri Jul 26, 2013 12:49 pm
by yancy
ofadl,

I would encourage you to look through

http://nagios.sourceforge.net/docs/nagioscore-3-en.pdf


if you run into an issue and need help let us know!

-Yancy

Re: File check plugin

Posted: Fri Jul 26, 2013 1:06 pm
by ofadl
ok, so i set up a service check that looks like this:

Code: Select all

define service {
        host_name                       sfftp207
        service_description             Check Win File
        use                             generic-service
        check_command                   check_nrpe!check_winfile!-a '--target C:\ip\hugco --filter "age gt -5 minutes" --critical 0'
        }

reset nagios, and get this as output on the nagios website:

Code: Select all

FILE UNKNOWN - Target does not exist

Re: File check plugin

Posted: Fri Jul 26, 2013 1:08 pm
by abrist
Are you sure the file:

Code: Select all

C:\ip\hugco
Exists? Does it have an extension?

Re: File check plugin

Posted: Fri Jul 26, 2013 1:11 pm
by ofadl
that is indeed the right file, its empty, but it exists. I ran it off the nagios machine like so :

Code: Select all

./check_nrpe -H 10.100.50.18 -p 5666 -c check_winfile -a  '--target C:\ip\hugco --filter "age gt -5 minutes" --critical 0'
with the output :

Code: Select all

FILE OK - 0 files to consider|'selected files'=0;;0; 'all files'=0 'deleted files'=0

Re: File check plugin

Posted: Mon Jul 29, 2013 9:48 am
by sreinhardt
Since it seems to work via cli, can you post what your check_nrpe command definition is please? I didn't see it earlier and we might just be missing something small there.

Re: File check plugin

Posted: Mon Jul 29, 2013 11:26 am
by ofadl
i would, but its in a weird language

Re: File check plugin

Posted: Mon Jul 29, 2013 12:08 pm
by lmiltchev
Let's take a look at it.