- add libata disks with -d ata if the libata version is new enough
otherwise do not add them (#145859, #174095)
This commit is contained in:
parent
c4cbeb9679
commit
396edfa53f
@ -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
|
||||
|
@ -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 <tmraz@redhat.com> 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 <tmraz@redhat.com> 1:5.33-2
|
||||
- Spec file cleanup by Robert Scheck <redhat@linuxnetz.de> (#170959)
|
||||
- manual release numbering
|
||||
|
Loading…
Reference in New Issue
Block a user