NSClient++ Help (#1) - Counting a large number of files with CheckFile (#445) - Message List
I need to track the number of files being created in a Windows file system (> 3 million). When I use the CheckFile command it seems to check all the folders (~1,000) but then displays an error at the very end. I am running NSClient++ Win32/Test and enter the following command:
The outputNSClient++.cpp(600) NSCLient++ - 0.3.6.818 2009-06-14 Started!
d \NSCHelper.cpp(73) String (14121998) to long to fit inside buffer(4096) : 'A10 00.1,
e NSClient++.cpp(1062) UNKNOWN: Return buffer to small to handle this command. BAD_CODE:
What is the scenario?
The problkem is the payload length (1024) so question is what would you expect?
Michael Medinmickem08/25/09 08:38:05 (4 years ago)
Thanks for the prompt response Michael! Scenario - We need to track the number of files created in a file system to ensure that it doesn't exceed a threshold. I used the truncate option and set it to a low figure as I don't care about the filenames, I just need to know the number of files. I understood that using the truncate option would keep me below the payload length of 1024. The error message however details a return buffersize of 4096 that is exceeded.
As to what I expect.... I expect it to work first time ! (haha!)
Regards... Fredfkroeger08/25/09 09:57:47 (4 years ago)
humm, not 100% sure truncate is supportd here, know it was not before but think i added it (but might have planned to add it will check tonight).
Anyways, the "size" is the internal one so it is "the same error". it works like this:
Michael medinmickem08/25/09 11:49:23 (4 years ago)
Hi Michael - any update on this?
I have tried the latest 3.7 version and the CheckFile2 command but still not working for folders with a large amount of files
check_nrpe -H ih00001257 -c CheckFile2 -a path=C:
SysLog? filter+size=gt:0 truncate=10
check_nrpe -H ih00001257 -c CheckFile2 -t 5000 -a path=C:
Downloads filter+size=gt:0 truncate=10
UNKNOWN: Return buffer to small to handle this command.fkroeger10/22/09 06:40:05 (4 years ago)
This works for me (in the up-coming 0.3.8 so might have been accidental fixed):
CheckFile2 MinWarn=10 MinCrit=10 path=D:\WINDOWS\system32 filter+size=gt:0 truncate=10 ignore-errors OK:$winnt...|'found files'=7177;10;10;
The ignore-errors flag is just since a lot of the files are "unreadable" in the sys32 folder.
Michael Medinmickem12/13/09 10:57:45 (3 years ago)
Fantastic - thanks Michael[[BR]]
I guess all I'm looking for is a way to return the result (count) rather than all 3 million entries. This would be a lot faster as well.
BTW - the application is a document management system , so this check will allow us to also measure growth and then later on I can do some trend analysis.
Thanks & regards.. Fredfkroeger08/26/09 02:27:12 (4 years ago)