Package: logwatch Version: 7.3.6.cvs20080702-2 Severity: wishlist Tags: patch
By default logwatch always reports the diskspace. I would like it to be configurable. If the Detail variable is greater than something, then report the diskspace. Else alert only about disks filling up. -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable') Architecture: i386 (i686) Kernel: Linux 2.6.30-1-686 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash
--- /usr/share/logwatch/scripts/services/zz-disk_space 2008-12-31 12:31:13.000000000 +0100 +++ /etc/logwatch/scripts/services/zz-disk_space 2009-08-06 18:23:37.392022520 +0200 @@ -132,7 +132,7 @@ } -sub DiskSpace () +sub DiskInit () { if ($OSname eq "Linux") { $df_options = "-h -l -x tmpfs -x udf -x iso9660"; @@ -171,9 +171,11 @@ if ( $ENV{'disk_cmd'} ) { $disk_cmd = $ENV{'disk_cmd'}; }; +} +sub DiskSpace +{ system($disk_cmd); - print "\n"; } @@ -196,8 +198,13 @@ ##################### #Main -#Only show disk space "df" by default -mgt -DiskSpace(); +# Build the disk usage command ("df" by default -mgt) +DiskInit(); + +if ($Detail > 5) { + #Show disk space "df" by default -mgt + DiskSpace(); +} if ( $show_disk_usage == 1 ) { DiskUsage(); }; #Turn on in zz-disk_space.conf