in reply to Telnet Output
Here is what I would try first:
(The print based on a quick glance at Chapter 11 of the Cacti manual.)# Here be ***UNTESTED*** code my %snr; while ( my $line = shift @lines ) { chomp $line; if ( $line =~ m/SNR:\s+(\d+)\s+(\d+)/ ) { ( $snr{up}, $snr{down} ) = ( $1, $2 ); last; } } print q{Upstream_SNR:}, $snr{up}, q{ }, q{Downstream_SNR:}, $snr{down}, qq{\n};
Hope that helps.
Update: 2013-12-30
Fix typo in code (missing underscore in second field name).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Telnet Output
by jmutton (Initiate) on Jan 01, 2014 at 21:19 UTC | |
by jmutton (Initiate) on Jan 01, 2014 at 22:46 UTC |