Menu

#10 Suppress disk space report if no disks are filling up

Future Release
closed
nobody
None
5
2019-01-24
2019-01-11
No

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.

Discussion

  • Bjorn

    Bjorn - 2019-01-11

    I believe this behaviour is accomplished by setting Detail = 0.

     
  • David Anderson

    David Anderson - 2019-01-12

    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 file services/zz-disk_space.conf for any reference to detail turns up nothing.

     
  • Bjorn

    Bjorn - 2019-01-12

    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.

     
  • David Anderson

    David Anderson - 2019-01-14

    Thank you. For me, with this, setting $suppress_listing = 1 means 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_threshold setting mentions $suppress_disk_cmd_listing rather than $suppress_listing

     
  • Bjorn

    Bjorn - 2019-01-15

    Since it appears to work for me, just wanted to make sure we have the same understanding:

    • When I set (uncomment) $suppress_listing = 1 it does not print the "df" listing of filesystems usage.
    • When a filesystem exceeds the defined $diskfull_threshold (or its default of 90%) it prints out the "Warning: Disk Filling up" message for that filesystem(s)
    • When both variables are set to their default settings (commented out), it produces a full listing of the filesystems, and the warning for those filesystems exceeding the default.

    Is this what you are seeing? Is this the behaviour you were expecting?

    (And I fixed the typo; thanks for the heads-up.)

     
  • David Anderson

    David Anderson - 2019-01-15

    I can confirm that $suppress_listing = 1 does not print the listing of filesystems usage. However, if I (at the same time) set $diskfull_threshold to something (e.g. 2) below my actual disk use (21%), then no "Warning: Disk Filling up" message shows. I am running logwatch from 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.conf and /etc/logwatch/scripts/services/zz-disk_space.

     

    Last edit: David Anderson 2019-01-15
  • Bjorn

    Bjorn - 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.

     
  • David Anderson

    David Anderson - 2019-01-15

    Thank you - that now works as expected for me.

     
  • Bjorn

    Bjorn - 2019-01-24
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB