Checks: Running 'show port | match "Up Yes" | count'
Count: 23 lines
Checks: Running 'show router interface | match "Up " | count'
Count: 4 lines
####
open( INPUT, "$folder/$file" ) or die("Could not open $file file");
while ( my $line = ) {
next if ( $line =~ m/show port/ );
if ( $line =~ m/Count:\s+(\d+)/ ) {
$checks{port}{$stage} = $1;
}
next if ( $line =~ m/show router interface/ );
if ( $line =~ m/Count:\s+(\d+)/ ) {
$checks{l3}{$stage} = $1;
}
}
####
23
4
####
$VAR1 = {
'card' => {
'post' => '28615',
'pre' => '28615'
},
'l3' => {
'post' => '28615',
'pre' => '28615'
},
'subs' => {
'post' => '2',
'pre' => '2'
},
'bfd' => {
'post' => 0,
'pre' => 0
},
'binding' => {
'post' => '28615',
'pre' => '28615'
},
'ospf' => {
'post' => '2',
'pre' => '2'
},
'port' => {
'post' => '28615',
'pre' => '28615'
},
'ldp' => {
'post' => '14',
'pre' => '14'
}
};