NSClient++ Help (#1) - Problem with CheckFile2 [SOLVED] (#514) - Message List
Hi,
could someone pls point me into the right direction: I try to check for files older then 1 day:
NSClient++.cpp:1073: Injecting: checkFile2: debug, path=C:\Data\FTPROOT\IBolt_Test, filter+creation=>:1d, MaxWarn=1, MaxCrit=1, syntax=%filename%: %creation% debug:modules\CheckDisk\CheckDisk.cpp:1127: NOW: 2010-02-19 07:27:46 debug:modules\CheckDisk\CheckDisk.cpp:118: Input is: C:\Data\FTPROOT\IBolt_Test / 10 debug:modules\CheckDisk\CheckDisk.cpp:133: File pattern: C:\Data\FTPROOT\IBolt_Test\*.* debug:modules\CheckDisk\CheckDisk.cpp:867: Matched (missed): + creation: for: 3000ACTI20100216152107.DAT: Tuesday, February 16, 2010 14:21:10 debug:modules\CheckDisk\CheckDisk.cpp:867: Matched (missed): + creation: for: 3000ACTI20100216152107.SYN: Tuesday, February 16, 2010 14:21:10
=> why are the files skipped?
thanks in advance
-
Message #1585
I am not sure, but: Please post what version you are using. I find it a bit hard to read the log, therefore it is also useful to post the command line you insert.
I am not sure of filter+creation=>:1d works, try =gt:1d or =>1d
vikjon002/19/10 09:49:01 (2 years ago)-
Message #1588
Sorry, the :>1d was a copy/paste Error - i tried gt:1d and =>1d
checkFile2 debug path=C:\Data\FTPROOT\IBolt_Test filter+creation=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename%: %creation%"
ulimper02/19/10 14:57:36 (2 years ago)
-
-
Message #1620
Which version is this I recently fixed "negative dates" so try the latest nightly and let me know if it works out.
Michael Medin
mickem02/26/10 07:37:58 (2 years ago)-
Message #1621
I am using NSClient++ 0.3.8.11 2010-01-26 Which seem to still be the latest.
Posted logs and test case here http://nsclient.org/nscp/discussion/topic/505#-1
vikjon002/26/10 08:54:19 (2 years ago)-
Message #1623
(part of the) Problem was your syntax actually (when I changed that it seems to work for me).
I have changed the code so a warning when incorrect syntax is given will trigger:
checkFile2 debug path=C:\test pattern=*.txt filter+creation=>:1d MaxWarn=1 MaxCrit=1 "syntax=%filename%: %creation%" d \NSClient++.cpp(1073) Injecting: checkFile2: debug, path=C:\test, pattern=*.txt, filter+creation=>:1d, MaxWarn=1, MaxCrit=1, syntax=%filename%: %creation% l \checkHelpers.hpp(371) Maybe this is not what you want: :1d = 0 d \CheckDisk.cpp(1150) NOW: 2010-02-28 12:42:46 d \CheckDisk.cpp(122) Input is: C:\test / 10 d \CheckDisk.cpp(139) File pattern: C:\test\*.txt d \CheckDisk.cpp(896) Matched: . (contiunue): creation: for: test001.txt: Friday, February 26, 2010 11:36:06 d \CheckDisk.cpp(891) Matched (missed): + creation: for: test002.txt: Tuesday, March 02, 2010 11:36:11 d \CheckDisk.cpp(149) File pattern: C:\test\*.* d \NSClient++.cpp(1109) Injected Result: CRITICAL test001.txt: Friday, February 26, 2010 11:36:06, found files: 1 > critical' d \NSClient++.cpp(1110) Injected Performance Result: ''found files'=1;1;1; ' CRITICAL:test001.txt: Friday, February 26, 2010 11:36:06, found files: 1 > critical|'found files'=1;1;1;
Check out the:
l \checkHelpers.hpp(371) Maybe this is not what you want: :1d = 0
Hopefully this will make it simpler to find such issue. The syntax in this case was a missmatch between the gt: and > (which does not need a :). Though it took me forever to figure it out myself so it is an easy mistake to do.
The correct syntax is:
checkFile2 debug path=C:\test pattern=*.txt filter+creation=gt:1d MaxWarn=1 MaxCrit=1 "syntax=%filename%: %creation%" or checkFile2 debug path=C:\test pattern=*.txt filter+creation=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename%: %creation%"
Next nightly will have the wanrning included so hopefully this will improve things a bit.
THOUGH looking through this I found another issue (also fixed in next nightly) which makes the date matching not have the prooper now (infact it was never set). So next nightly... and the correct syntax.. .and hopefully everything is good to go :)
Michael Medin
mickem02/28/10 13:45:09 (2 years ago)
-
-







