From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461) Description of problem: The diskcheck script is broken, it completely ignores the defaultCutoff setting. The administrator will never get the warning she expects to get from diskcheck. Version-Release number of selected component (if applicable): 1.0-1 How reproducible: Always Steps to Reproduce: 1. Install default configuration 2. Set defaultCutoff=1 in /etc/diskcheck.conf 3. Run /etc/cron.hourly/diskcheck Actual Results: Nothing. Expected Results: Diskcheck was supposed to send an e-mail to root warning for low disk space on the host. Additional info: The diskcheck script is broken. Search for "defaultCutoff" in the python script, and it is mentioned only once. It should clearly be used in the if- elif comparing pct >= cutoff[volume]. It is very easy to patch the problem: Change line 76-77 elif test or cutoff.has_key(volume): if test or pct >= cutoff[volume]: to elif test or pct >= defaultCutoff: high = 1 The disckcheck program is a tool supposed to warn the administrator of a potentially critical condition, so a rpm really should be released on up2date.
Actually, two additional changes has to be made. The diskcheck script makes string comparisons, but should really make integer comparisons. Line 76: if test or pct) >= cutoff[volume]: should to be changed to if test or int(pct) >= int(cutoff[volume]): Line 76 (after the changes I described in my original bug report) elif test or pct >= defaultCutoff: should be changed to elif test or int(pct) >= int(defaultCutoff):
And it reports: >Traceback (innermost last): > File "/etc/cron.hourly/diskcheck", line 65, in ? > (volume, total, used, avail, pct, mountpt) = string.split(line) >ValueError: unpack list of wrong size if my "df" looks like: [root@netzmeister root]# df Dateisystem 1k-Blvcke Benutzt Verf|gbar Ben% montiert auf /dev/hda5 6048320 4130160 1610920 72% / /dev/hda3 54447 14169 37467 28% /boot /dev/hda8 11337564 7041000 3720636 66% /data /dev/hda6 6048320 4395136 1345944 77% /home /dev/hda7 1011928 16428 944096 2% /mnt/test none 127516 0 127516 0% /dev/shm /dev/hdb1 39389776 35348940 2039944 95% /mnt/40gb /dev/hdd1 19228276 15207636 3043892 84% /mnt/20gb //synectic-spock/Raphael_C 9759232 7268352 2490880 75% /mnt/synectic/spock/c //synecticgateway/daten 39077888 15393792 23684096 40% /mnt/synectic/gateway/daten The problem are these lines with the first column too lonk (mounted SMB-Shares) so the following columns gets printed on an extra line. Solution: --------- In /etc/cron.hourly/diskcheck change line 44 & 45 from list = os.popen("df %s" % ignore).readlines() listHuman = os.popen("df -h %s" % ignore).readlines() to list = os.popen("df -P %s" % ignore).readlines() listHuman = os.popen("df -hP %s" % ignore).readlines() as you see, "df -P" forces all infos in one line and all will be fine! Bodo
*** This bug has been marked as a duplicate of 54578 ***