]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Add -m to smart.pl that prints output for humans 128/head
authorDan Mick <dan.mick@redhat.com>
Tue, 8 Sep 2015 18:36:19 +0000 (11:36 -0700)
committerDan Mick <dan.mick@redhat.com>
Tue, 8 Sep 2015 20:15:03 +0000 (13:15 -0700)
Signed-off-by: Dan Mick <dan.mick@redhat.com>
roles/testnode/files/libexec/smart.pl

index f55870ee267dc1fb3c1cc7ce93f35a8106b1a460..7a826864800ee03b821dd429dad69fc10dca7e0d 100644 (file)
@@ -213,10 +213,20 @@ $result = 2 if $crit;
 my $out = "No real disks found on machine";
 $out = "All $drives drives happy as clams" if $drives;
 
-if (@out)
-{
-    $out = join(';     ', @out);  
-}
+if ($ARGV[0] =~ /-m/) {
+       if (@out) {
+               foreach my $line (@out) {
+                       print $line, "\n";
+               }
+       } else {
+               print "$out\n";
+       }
+} else {
+       if (@out)
+       {
+               $out = join(';     ', @out);
+       }
 
-print "$out\n";
+       print "$out\n";
+}
 exit $result;