私はperlスクリプトにくっついています。それは私にこの(ヘッダだけFYI)のように見える少なくとも5000行を返す必要があります。Perl Net :: SSH2出力制限?
Interface ----- CMTS Measurements ----- --------- CM Measurements ---------
(DS-US) USPwr USSNR uReflec Timing USPwr DSPwr DSSNR uReflec Timing Last
S/C/CH-S/CG/CH (dBmV) (db) (dBc) Offset (dBmV) (dBmV) (db) (dBc) Offset Polled MAC address
----------------- ------- ------ ------- ------ ------ ------ ------ ------- ------- ------ --------------
12/0/8-1/0/0 -0.4 28.3 0 312832 47.0 -2.4 37.2 24 1222.00 00:23 0000.cfbe.9151 (Arris)
12/0/15-1/0/0 0.0 29.8 0 353280 44.0 -14.4 32.4 30 1380.00 00:22 0017.9635.19b4 (Arris)
12/0/12-1/0/0 0.4 30.3 0 353024 48.0 -4.5 34.9 30 1380.00 00:22 0017.9795.5d3c (Arris)
12/0/15-1/0/0 -0.6 28.7 0 357120 44.0 0.2 38.0 30 1396.00 00:20 0017.a6uz.c781 (Arris)
12/0/14-1/0/0 0.0 28.5 0 354048 45.0 0.2 37.4 25 1383.00 00:20 0017.a289.96ef (Arris)
を何とかスクリプトがライン1500で停止... スクリプトは次のようになります。
#!/usr/bin/perl -w
use warnings;
use strict;
use Net::SSH2;
my $cmtsip="x.x.x.x";
my $password='somepassword';
my $username="someuser";
# login to cmts and get the table
my $ssh2=Net::SSH2->new();
$ssh2->connect($cmtsip) or die "Unable to connect Host [email protected] \n";
$ssh2->auth_password($username,$password) or die "Unable to login [email protected] \n";
my $chan = $ssh2->channel();
$chan->blocking(0);
$chan->shell();
print $chan "show cable modem phy\n";
sleep (40);
while (<$chan>)
{
print $_;
}
$chan->close;
誰でも私のスクリプトが失敗する部分を教えてください。
現在、あなたのスクリプトはコンパイル中に既に失敗しています。 – dgw
他の部分は関係ないので、スクリプト全体をアップロードしませんでした。私はすでに私のcliに出力を持っていますが、私はすべての代わりにラインの一部だけがあると言っています。 –
問題を表示するには、[最小限の、完全で検証可能な例](https://stackoverflow.com/help/mcve)を提供する必要があります。だから、コンパイルされないコードは役に立たない。 – dgw