File check plugin

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.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: File check plugin

Post 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
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: File check plugin

Post by yancy »

uncomment CheckExternalScripts.dll

Code: Select all

;CheckExternalScripts.dll
So it sould be

Code: Select all

CheckExternalScripts.dll
-Yancy
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: File check plugin

Post by ofadl »

Perfect! worked like a charm! Now i just need some help setting up a command and service check for this :D
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: File check plugin

Post 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
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: File check plugin

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: File check plugin

Post by abrist »

Are you sure the file:

Code: Select all

C:\ip\hugco
Exists? Does it have an extension?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: File check plugin

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: File check plugin

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
ofadl
Posts: 201
Joined: Mon Jun 03, 2013 8:57 am

Re: File check plugin

Post by ofadl »

i would, but its in a weird language
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: File check plugin

Post by lmiltchev »

Let's take a look at it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked