Page 1 of 3

Check file size windows

Posted: Wed Nov 04, 2015 4:08 am
by brandon
Hello,

when using CheckFiles for monitoring file size:

Code: Select all

check_nrpe -H 192.168.1.10 -c CheckFiles -a file="c:\\test\test.txt" "critical=size>100k" "perf-config=size(unit:M)" "detail-syntax=${status}%(file) = %(size)"
or

check_nrpe -H 192.168.1.10 -c alias_file_size -a file="c:\\test\test.txt" "critical=size>100k" "perf-config=size(unit:M)" "detail-syntax=${status}%(file) = %(size)"

Output:
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option)
.


The same topic: https://support.nagios.com/forum/viewto ... =7&t=31926 , but for me does not work

Re: Check file size windows

Posted: Wed Nov 04, 2015 10:17 am
by hsmith
Can you post your nsc.ini/nsclient.ini with any passwords / sensitive IP addresses excluded?

Re: Check file size windows

Posted: Wed Nov 04, 2015 10:29 am
by rkennedy
You will need to edit your nsclient.ini on your windows machine, and add the following lines -

Code: Select all

[/settings/NRPE/server]
allow arguments=1

Re: Check file size windows

Posted: Wed Nov 04, 2015 11:09 am
by brandon
password and login are OK, as they checked other plugins and running

Only problem I have with this plugin

maybe we should not executes the command?

Re: Check file size windows

Posted: Wed Nov 04, 2015 11:12 am
by rkennedy
Did you make the change to your nsclient.ini, and restart the service after?

Re: Check file size windows

Posted: Thu Nov 05, 2015 4:29 am
by brandon
In nsclient.ini I have:
alias_file_size = CheckFiles "filter=size > $ARG2$" "path=$ARG1$" MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" max-dir-depth=10
the file has not been modified

Re: Check file size windows

Posted: Thu Nov 05, 2015 10:17 am
by rkennedy
Did you add this line to your nsclient.ini? It's needed for certain commands to run.

Code: Select all

[/settings/NRPE/server]
allow arguments=1

Re: Check file size windows

Posted: Fri Nov 06, 2015 3:46 am
by brandon
so maybe I ask:, what should be on the server query:

Code: Select all

define service{
        use                             none         
        host_name                       server
        service_description             Check File Log
        check_command                   check_file_size!path='c:\\test\test.txt' 'critical=size>100k' 'perf-config=size(unit:M)' 'detail-syntax=${status}%(file) = %(size)'
        }
output:

Code: Select all

 	Not a file or directory (or doesn't exist), don't know what to do with file=c: esttest.txt 
and running plugin, for example:

Code: Select all

define service{
        use                             none
        host_name                       server
        service_description             Open Files
        check_command                   check_open_files.pl!-w 30 -c 50!
        }
output

Code: Select all

OK: 1856 open files (0% of max 205045) 
The only problem is check_file_size plugin

Re: Check file size windows

Posted: Fri Nov 06, 2015 11:03 am
by hsmith
What happens when you run check_nrpe -H 192.168.1.10 -c alias_file_size -a file="c:\\test\test.txt" "critical=size>100k" "perf-config=size(unit:M)" "detail-syntax=${status}%(file) = %(size)" from the command line?

Re: Check file size windows

Posted: Mon Nov 09, 2015 1:35 am
by Box293
hsmith wrote:What happens when you run check_nrpe -H 192.168.1.10 -c alias_file_size -a file="c:\\test\test.txt" "critical=size>100k" "perf-config=size(unit:M)" "detail-syntax=${status}%(file) = %(size)" from the command line?
Also, the file path requires double back slashes all the way through it, you have c:\\test\test.txt but it should be c:\\test\\test.txt

I would also try single quotes instead of double quotes.