thehunmonkgroup / nagios-plugin-newest-file-age

Nagios plugin, pulls the most recently created file in each specified directory, and checks its created time against the current time.
MIT License
11 stars 10 forks source link

Add functionality: check file when "file" modified #9

Open pilot513 opened 6 years ago

pilot513 commented 6 years ago

The default checked when file not in same time: "file is older than" Can you add reverse functional, when check "file is younger than" ?

pilot513 commented 6 years ago

In the https://nagios-plugins.org/doc/guidelines.html recommendation:

Range definition

10 | < 0 or > 10, (outside the range of {0 .. 10}) 10: | < 10, (outside {10 .. ∞}) ~:10 | > 10, (outside the range of {-∞ .. 10}) 10:20 | < 10 or > 20, (outside the range of {10 .. 20}) @10:20 | ≥ 10 and ≤ 20, (inside the range of {10 .. 20})

Command line | Meaning

check_stuff -w10 -c20 | Critical if "stuff" is over 20, else warn if over 10 (will be critical if "stuff" is less than 0) check_stuff -w~:10 -c~:20 | Same as above. Negative "stuff" is OK check_stuff -w10: -c20 | Critical if "stuff" is over 20, else warn if "stuff" is below 10 (will be critical if "stuff" is less than 0) check_stuff -c1: | Critical if "stuff" is less than 1 check_stuff -w~:0 -c10 | Critical if "stuff" is above 10; Warn if "stuff" is above zero (will be critical if "stuff" is less than 0) check_stuff -c5:6 | Critical if "stuff" is less than 5 or more than 6 check_stuff -c@10:20 | OK if stuff is less than 10 or higher than 20, otherwise critical

you can realize this ?

thehunmonkgroup commented 6 years ago

Please don't file separate requests in the same issue. If you'd like a response on the second request, file another issue for it.

Regarding the first request, I have no personal interest in that feature, and will not write it myself. If you submit a pull request for it, I'll consider merging it if it's implemented cleanly. Or you could hire somebody to do that work for you.