diff --git a/smartd-conf.py b/smartd-conf.py index 9f9efe7..212dc19 100755 --- a/smartd-conf.py +++ b/smartd-conf.py @@ -34,10 +34,24 @@ print """# /etc/smartd.conf # A very silent check. Only report SMART health status if it fails # But send an email in this case""" +def getfile(fname): + try: + fh = open(fname) + line = fh.read().rstrip() + fh.close() + except IOError: + line = '' + return line + for drive in drives: - fh=open("/sys/block/%s/removable" % drive.device) - if fh.read(1) == '0': - print "/dev/%s -H -m root@localhost" % drive.device + if getfile("/sys/block/%s/removable" % drive.device) == '0': + driver = '' + comment = '' + if getfile("/sys/block/%s/device/vendor" % drive.device) == 'ATA': + driver = '-d ata ' + if float(getfile("/sys/module/libata/version")) < 1.20: + comment = "# not yet supported in this kernel version " + print "%s/dev/%s %s-H -m root@localhost" % (comment, drive.device, driver) print """ # First two SCSI disks. This will monitor everything that smartd can diff --git a/smartmontools.spec b/smartmontools.spec index b6b400c..c7e0072 100644 --- a/smartmontools.spec +++ b/smartmontools.spec @@ -1,7 +1,7 @@ Summary: Tools for monitoring SMART capable hard disks Name: smartmontools Version: 5.33 -Release: 2 +Release: 3 Epoch: 1 Group: System Environment/Base License: GPL @@ -69,6 +69,10 @@ exit 0 %changelog +* Fri Nov 25 2005 Tomas Mraz 1:5.33-3 +- add libata disks with -d ata if the libata version + is new enough otherwise do not add them (#145859, #174095) + * Thu Nov 3 2005 Tomas Mraz 1:5.33-2 - Spec file cleanup by Robert Scheck (#170959) - manual release numbering