#! /usr/local/bin/perl -w # This program is used by HPOV as a pop-up option to see the # show cable modems on a specific ubr port. This information # will provide the user with information such as the receive # power level for each modem on the port. This program will # be available when an interface is highlighted. # INPUT: [1] name of ubr and port [uBR-3C:Ca3/0-upstream2] # OUTPUT: the results of a show cable modems command # AUTHOR: Becki True becki@anv.net use Net::Telnet::Cisco; $file = ''; # the file that contains the CMTS passwords 1 per line while (@ARGV) { $input = (shift @ARGV); } $ubr = $input; $blade = $input; $ubr =~ s/:.*//; $blade =~ s/.*://; #Ca3/0-upstream2 $port = $blade; $blade =~ s/Ca/Cable/; #Cable3/0-upstream2 $blade =~ s/-.*//; #Cable3/0 $port =~ s/.*upstream/\/U/; #/U2 open(FILE, "<$file") or die "Couldn't open $file for reading\n"; while() { @input = split; } $global = $input[0]; my $cs = Net::Telnet::Cisco->new( Host => $ubr ); $cs->login( '' , $global ); # Turn off paging my @cmd_output = $cs->cmd( 'terminal length 0' ); # get cable modem summary table @cmd_output = $cs->cmd( "sh cable modem | inc $blade$port" ); print @cmd_output; $cs->close;