Closed djmcd89 closed 6 months ago
Why not use a the standard range thresholds as default? Why translate --check-direction
to check_operator
of get_state
and not expose check_operator
directly as a --check-operator
argument?
Thanks for the suggestion, I hadn't seen the range option since the specific use case was for a check regarding smaller than threshold. Definitely a good idea, I'll take a look at it again and come back with another PR if I manage to get anywhere. :-) The --check-direction translation was actually an effort to make it a little more human readable and user friendly.
The requested use case is that the file size of files within a given directory should not subceed a specified threshold.
Updated file-size plugin with an option to check for file sizes below the given threshold. Added an optional --check-direction argument, which determines whether the file-size should be smaller or larger than the given threshold. Values that can be used are "smaller" and "larger", larger remains the default value if none is set.
Additionally added an error count and edited the output to include the number of files above/below the threshold instead of the number of all files contained in the directory.