April 27, 2011 at 11:09 #2045
Legacy Forum UserMember
First, I’m not speaking english fluently so please, tell me if you dont understand something :/
So, here is my problem. I started using NSClient some days ago and today, I have a problem when creating a check on a file.
I want NSClient to send me a critical when a file (test.dmp):
=> have a size <700mo
=> haven’t been updated the day before the check
So, I created this (In the External Alias section):
alias_file=CheckFile2 filter=in path=C:\plop\test.dmp filter-size=<700000k filter-written=>1d MaxWarn=1 MaxCrit=1 “syntax=%filename%: %size% – %write%”
This check is fully operational. I mean, it returns a “critical” when either conditions is not satisfied.
But when everything is “Ok”, well, it only returns me “CheckFile Ok”. The problem is that I would like NSClient returns me more details about the file who is “Ok”.
I would like something like the syntax part (with filename, size…) and the “Ok” state.
With some check_nt commands, there was no problem.I used the command “ShowAll ” to send me information even when everything was “ok”.
But with check_nrpe and the command CheckFile2, I dont find a way to get information about a “Ok” state.
So my question is: is there a way to get information on a status “OK”? (because ShowAll isn’t a valid command)
(Feel free to tell me if part of my message is incomprehensible)April 27, 2011 at 12:28 #8492
You can look a bit into CheckFiles for that it is much improved with syntax options for showing information.
One thing though all of these commands are built to check “multiple files” so you will not get what you want.
The idea is to follow up checkfiles with a checkfile (notice the lack of plural s) which will handle your scenario.
Right now if you need the size for graphing or some such I would write a script…
// Michael MedinApril 27, 2011 at 15:08 #8493
Legacy Forum UserMember
Thanks for the answer.
I checked with ChekFiles, CheckFile too but I got the same problem. I cant find a way to modify the “Ok message” (CheckFile ok| ‘found files’…).
When my command returns an error, NSClient sends me a nice message that uses the option “syntax” (my error message looks like: test.rar: 719M – Sunday, April 11, 2010, found files:1 > critical).
But I do not find a way to get this same message when there is no error. Ideally, a message that looks like “test.rar: 719M – Sunday, April 11, 2010, found files:1 > ok”
I dont want to use the size of the file for graphing.The purpose of this command is to verify that a backup file is created each day and has a normal size (sometimes he dont have)
I read that these commands are built to check more than one file but this is the only way I find to verify that my backup files are created :/
If it is not possible or if I missed something in your answer, do not hesitate to tell me x)
You must be logged in to reply to this topic.