carnac 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/carnac +2 -2
- data/lib/carnac/check.rb +3 -3
- data/lib/carnac/version.rb +1 -1
- metadata +1 -1
data/bin/carnac
CHANGED
@@ -20,8 +20,8 @@ OptionParser.new do |opts|
|
|
20
20
|
options[:notify] = v
|
21
21
|
end
|
22
22
|
|
23
|
-
opts.on("-
|
24
|
-
options[:
|
23
|
+
opts.on("-t", "--type TYPE", String, "The type of device (auto/test/ata/scsi) to check") do |v|
|
24
|
+
options[:type] = v
|
25
25
|
end
|
26
26
|
end.parse!
|
27
27
|
|
data/lib/carnac/check.rb
CHANGED
@@ -36,10 +36,10 @@ END_OF_MESSAGE
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def run!
|
39
|
-
if @
|
40
|
-
lines = `smartctl -a #{@device}`.split("\n")
|
39
|
+
if @type.empty?
|
40
|
+
lines = `smartctl -a -d #{@device}`.split("\n")
|
41
41
|
else
|
42
|
-
lines = `smartctl -a #{@
|
42
|
+
lines = `smartctl -a #{@type} #{@device}`.split("\n")
|
43
43
|
end
|
44
44
|
|
45
45
|
header = lines.grep(/^ID#/).first
|
data/lib/carnac/version.rb
CHANGED