From f69b396c48652d7781c45020a14efbfdf51febcf Mon Sep 17 00:00:00 2001 From: Munzy Date: Tue, 16 Apr 2019 13:50:16 -0700 Subject: [PATCH 1/3] Added Wrapper for SAS drives. --- snmp/smart | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/snmp/smart b/snmp/smart index 1f68ccb..31afbdc 100755 --- a/snmp/smart +++ b/snmp/smart @@ -339,8 +339,42 @@ foreach my $line ( @disks ){ $IDs{$id}=$temp; } + + + } + # SAS Wrapping + # Section by Cameron Munroe (munroenet[at]gmail.com) + + # Elements in Grown Defect List. + # Marking as 5 Reallocated_Sector_Ct + + if ($line =~ "Elements in grown defect list:"){ + + my @lineA=split(/\ /, $line, 10); + my $raw=$lineA[5]; + + # Reallocated Sector Count ID + $IDs{5}=$raw; + + } + + # Current Drive Temperature + # Marking as 194 Temperature_Celsius + + if ($line =~ "Current Drive Temperature:"){ + + my @lineA=split(/\ /, $line, 10); + my $raw=$lineA[3]; + + # Temperature C ID + $IDs{194}=$raw; + + } + + # End of SAS Wrapper + $outputAint++; } From 935373ee3c53be5005bf1f9c27d41fab4024f409 Mon Sep 17 00:00:00 2001 From: Munzy Date: Tue, 16 Apr 2019 13:55:34 -0700 Subject: [PATCH 2/3] Removed Excess Spacing --- snmp/smart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/snmp/smart b/snmp/smart index 31afbdc..6fde052 100755 --- a/snmp/smart +++ b/snmp/smart @@ -338,10 +338,7 @@ foreach my $line ( @disks ){ my ( $temp )=split(/\ /, $raw); $IDs{$id}=$temp; } - - - - + } # SAS Wrapping From 59938039cb08fe60e8f0272178597ea2a6909802 Mon Sep 17 00:00:00 2001 From: Munzy Date: Tue, 16 Apr 2019 13:57:30 -0700 Subject: [PATCH 3/3] Spacing Fixes --- snmp/smart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snmp/smart b/snmp/smart index 6fde052..e31fd88 100755 --- a/snmp/smart +++ b/snmp/smart @@ -338,7 +338,7 @@ foreach my $line ( @disks ){ my ( $temp )=split(/\ /, $raw); $IDs{$id}=$temp; } - + } # SAS Wrapping