File check plugin
File check plugin
Hello,
So i am trying to find a check for nagios, that would basically check files or files in a directory that have been sitting there for more than 5 minutes. Any help?
So i am trying to find a check for nagios, that would basically check files or files in a directory that have been sitting there for more than 5 minutes. Any help?
Re: File check plugin
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: File check plugin
interesting, i rather not install python though. I found this plugin:
https://www.itefix.no/i2/check_winfile
I got it working on the command prompt from the remote server itself, but i am having difficulty getting it to work on the nagios. I am trying to set it up with a service check and a check command. Any help is appreciated.
For example, on the command prompt on the remote server inside C:\nrpe_nt, i ran
and got an output this:
i tried doing similar on the nagios machine with :
but im getting this:
https://www.itefix.no/i2/check_winfile
I got it working on the command prompt from the remote server itself, but i am having difficulty getting it to work on the nagios. I am trying to set it up with a service check and a check command. Any help is appreciated.
For example, on the command prompt on the remote server inside C:\nrpe_nt, i ran
Code: Select all
check_winfile --target C:\nrpe_nt --filter "age gt -5 minutes" --critical 0
Code: Select all
FILE OK - 0 files out of 72 to consider |'selected files'=0;;0; 'all files'=72 '
deleted files'=0
Code: Select all
./check_nrpe -H 10.100.50.18 -p 5666 -c check_winfile -a --target C:\nrpe_nt --filter "age gt -5 minutes" --critical 0
but im getting this:
Code: Select all
./check_nrpe: unrecognized option '--filter'
./check_nrpe: unrecognized option '--critical'
Re: File check plugin
What are you using as your nrpe client on the remote host?
Additionally, you need to wrap nrpe's command argument with single quotes:
You will also have to configure the command on the remote side in nsclient, etc.
Additionally, you need to wrap nrpe's command argument with single quotes:
Code: Select all
./check_nrpe -H 10.100.50.18 -p 5666 -c check_winfile -a '--target C:\nrpe_nt --filter "age gt -5 minutes" --critical 0'
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.
"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.
Re: File check plugin
i am using NSClient. I wrapped the command as you said, and now i get :
Any suggestions on how to configure a command to be put in the nsc.ini file?
Code: Select all
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
Re: File check plugin
What version of nsclient are you using? Could you by chance post your nsclient config in code wraps? (obfuscate password, etc)
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.
"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.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: File check plugin
Copy check_winfile to your scripts directory, then add the following to your nsclient.ini under the [External Scripts] header
restart NSClient++ and try again from nagios server
Code: Select all
check_winfile=scripts\check_winfile.exe $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$ $ARG9$
restart NSClient++ and try again from nagios server
Re: File check plugin
so i copied it exactly as you put it, under the external scripts section, and reset nsclient. Went on the nagios machine, ran :
and got the output :
Code: Select all
./check_nrpe -H 10.100.50.18 -p 5666 -c check_winfile -a '--target C:\nrpe_nt --filter "age gt -5 minutes" --critical 0'
Code: Select all
UNKNOWN: No handler for that command
Re: File check plugin
Did you also restart NSClient? Also verify the plugin is in the Scripts directory of NSClient.
-Yancy
-Yancy