[BACK]Return to check_bioctl CVS log [TXT][DIR] Up to [local] / nagios / check_bioctl

Diff for /nagios/check_bioctl/check_bioctl between version 1.17 and 1.18

version 1.17, 2011/12/27 01:32:01 version 1.18, 2011/12/27 02:12:38
Line 154 
Line 154 
     my $controller;      my $controller;
   
     sub parse_bioctl_line {      sub parse_bioctl_line {
         my ($line) = @_;          ($_) = @_;
         chomp $line;          chomp;
   
         # Do these by columns cuZ that is the easiest for now          my @o = map { s/^\s+|\s+$//g; $_ } split;
         my @o = unpack( "A10 A1 A11 A15 A7 A9 A*", $line );  
         return if $o[0] eq 'Volume';          return if $o[0] eq 'Volume';
   
         foreach (@o) {          $vid ||= '';
             s/^\s+//xms;  
             s/\s+$//xms;  
         }  
   
         my ( $c, $id, $status, $size, $dev, $details, $name ) = @o;          my $index = "$vid.$o[0]";
         my $index = $id;          if ( $o[0] !~ /^\d+$/ ) {
         if ($c) {              $controller = shift @o;
             $vid        = $id;              $vid        = $o[0];
             $controller = $c;              $index      = $vid;
         }          }
         else {  
             $index = "$vid.$id";  
         }  
   
         return $index,          return $index,
             {              {
             controller => $controller,              controller  => $controller,
             id         => $id,              volume_id   => $vid,
             status     => $status,              id          => shift @o,
             size       => $size,              status      => shift @o,
             device     => $dev,              size        => shift @o,
             details    => $details,              device      => shift @o,
             name       => $name,              name        => shift @o,
             volume_id  => $vid,              description => join ' ',
               @o,
             };              };
     }      }
 }  }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>