Hi, thank you for your work on logwatch. I use it daily. One feature that would be very useful would be if the disk space could be suppressed entirely if no disks are filling up. I personally don't need - and suspect few people do - information that one's disks are 40% full today; it's noise. It would be useful to be able to suppress it until action is needed.
I believe this behaviour is accomplished by setting Detail = 0.
It's still in the report unaltered when I run with
--detail=0(on a machine with only 21% disk usage). Grepping (case-insensitive) the configuration fileservices/zz-disk_space.conffor any reference todetailturns up nothing.Ah, I see. I had tried the zz-disk_space service by itself, and it does not print out the filesystem listing with --detail=0. But it does if I add another service with output, as the code references the $ENV{PRINTING} variable.
So I added a $suppress_listing variable, which I think does what you want. Let me know if it works for you.
Thank you. For me, with this, setting
$suppress_listing = 1means that the disk space never shows, even if the disk usage is above the threshold. I've set$diskfull_threshold = 10on a server with a disk that is 21% full.(BTW, the comment for the
$diskfull_thresholdsetting mentions$suppress_disk_cmd_listingrather than$suppress_listingSince it appears to work for me, just wanted to make sure we have the same understanding:
$suppress_listing = 1it does not print the "df" listing of filesystems usage.$diskfull_threshold(or its default of 90%) it prints out the "Warning: Disk Filling up" message for that filesystem(s)Is this what you are seeing? Is this the behaviour you were expecting?
(And I fixed the typo; thanks for the heads-up.)
I can confirm that
$suppress_listing = 1does not print the listing of filesystems usage. However, if I (at the same time) set$diskfull_thresholdto something (e.g. 2) below my actual disk use (21%), then no "Warning: Disk Filling up" message shows. I am runninglogwatchfrom the command line with no parameters.This system is Cent OS 7's patched logwatch 1.4.0 in which I've dropped in
/etc/logwatch/conf/services/zz-disk_space.confand/etc/logwatch/scripts/services/zz-disk_space.Last edit: David Anderson 2019-01-15
Looks like there was another bug, unrelated to the $suppress_listing variable. A recent regexp did not account for sizes with decimal points in them. Give it another try, and let us know if it works now.
Thank you - that now works as expected for me.