CheckFile2 – ShowAll

Forums NSClient++ support CheckFile2 – ShowAll

This topic contains 2 replies, has 2 voices, and was last updated by  Legacy Forum User 3 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2045

    Hi !

    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
    or
    => 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)

    #8492

    Michael Medin
    Keymaster

    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 Medin

    #8493

    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)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.