NSClient++ Help (#1) - CheckFiles (#863) - Message List
I probably doing something wrong, so if someone can correct me I'd appreciate that but I'm running into an issue here using CheckFiles.
first, let me just explain what I'm trying to accomplish ..
I have a Scheduled Tasks that runs on Windows 2003 that job suppose to produce a file, job runs every day. So I'd like to use CheckFiles to check if files is there and it's been written within last 24 hours period.
my school.sql file right now *is* less then 24 hour old, and for another example i'll take school.sql.1 which is older then 24 hours
[alexus@wcmisdlin02 ~]$ /usr/lib/nagios/plugins/check_nrpe -H appxtend01 -c CheckFiles -a path=e:\school~1 pattern=school.sql "filter=written lt 1d" warn=gt:1 school.sql|'found files'=1;1;0 [alexus@wcmisdlin02 ~]$ echo $? 0 [alexus@wcmisdlin02 ~]$ /usr/lib/nagios/plugins/check_nrpe -H appxtend01 -c CheckFiles -a path=e:\school~1 pattern=school.sql.1 "filter=written lt 1d" warn=gt:1 school.sql.1|'found files'=1;1;0 [alexus@wcmisdlin02 ~]$ echo $? 0 [alexus@wcmisdlin02 ~]$
in both cases it gave me same results which obviously tells me either I'm doing something wrong or maybe there is a bug?
-
Message #2314
I think you are confused about this date comparison tingy...
First off dates are "seconds since <whatever>" and then you need to read it like this: written lt 1d: <file date> is less then <now +> 24 hours. (in other words file is created before "tomorrow".) written lt -1d: <file date> is less then <now> - 24 hours. (in other words file is created before "yesterday".) written gt -1d: <file date> is more then <now> - 24 hours. (in other words file is created after "yesterday".)
Also note that there was a bug affecting this in the initial 0.3.9 release so please update if you have a version before august (check date on the latest version).
Michael Medin
mickem09/20/11 22:12:30 (20 months ago)-
Message #2315
as far as version goes
[alexus@wcmisdlin02 ~]$ /usr/lib/nagios/plugins/check_nrpe -H appxtend01 I (0.3.9.327 2011-08-16) seem to be doing fine... [alexus@wcmisdlin02 ~]$
my biggest problem is actually that i always get 0 (OK) from check_nrpe and never different error code when I use nsclient no matter if I got a match or not...
alexus09/20/11 23:22:59 (20 months ago)-
Message #2316
Now that is strange...
warn=gt:1 will only give you a warning when there are MORE then 1 hit so 0 or 1 will be "ok" where as 2 will not be (you can use gt:0 or ge:1 if what you want is one file == bad)
If you still have issues please paste the debug log from nsclient++ when this command is run (preferably with debug=true option on the nrpe command line)
Michael Medin
mickem09/22/11 06:55:13 (20 months ago)-
Message #2320
I am having a similar issue with checkfiles. What I want to do is use check_nrpe to count files in a directory and to either warn me or send me a critical message when a certain threshold is met. This is what I have so far:
./check_nrpe -H 10.0.1.41 -n -t 30 -c CheckFiles -a filter="line_count >0" path="c:\check_test" filter="line_count >0" MaxWarn=2 MaxCrit=3
CheckFile ok|'found files'=0;2;3
When I run the command at the command line I get an OK every time either with the filter or without, I get the same message. I created a test directory check_test in which I placed in 5 .txt files in. This does not seem to be counting the files in the directory. Am I doing something wrong or is checkfiles unable to count files in a directory, if not, do you know what I can use to make this possible?
Here is my output from NSClient+++ d NSClient++.cpp(1181) Injected Performance Result: d NSClient++.cpp(1144) Injecting: CheckFiles: filter=line_count >0, path=c:\check_test, filter=line_count >0, MaxWarn=2, MaxCrit=3 d NSClient++.cpp(1180) Injected Result: OK 'CheckFile ok' d NSClient++.cpp(1181) Injected Performance Result: found files'=0;2;3'
pbaynard09/27/11 20:26:32 (20 months ago)
-
-
-








