From: Dan Mick Date: Tue, 8 Sep 2015 18:36:19 +0000 (-0700) Subject: Add -m to smart.pl that prints output for humans X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5fdab86af34c719046b7095cf1c0d1747294f7ea;p=ceph-cm-ansible.git Add -m to smart.pl that prints output for humans Signed-off-by: Dan Mick --- diff --git a/roles/testnode/files/libexec/smart.pl b/roles/testnode/files/libexec/smart.pl index f55870e..7a82686 100644 --- a/roles/testnode/files/libexec/smart.pl +++ b/roles/testnode/files/libexec/smart.pl @@ -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;