-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
did not return a complete response when it is too long #195
Labels
Comments
I have kind of a similar problem. When running the following code: const Telnet = require('telnet-client');
const code = `
perl << 'EEOF' | sed 's/^/...OUTPUTBEGIN /'
#!/usr/bin/perl -w
use strict;
use 5.10.0;
my $count = 0;
my $physc = 0;
my $entc = 0;
my $used = -1;
my $smtVal;
my $lcpuVal;
my %config = ();
my %paraIndex = ();
my $vmstat = \`vmstat -t 15 1|tail -1\`;
my @temp = split / +/, $vmstat;
my $idle = $temp[-4];
$used = 100 - $idle;
if ( $used == -1 ) {
print "CPU_Usage: match_error\n";
print \`echo EOF\`;
}
else {
$used = sprintf "%.2f", $used;
print "CPU_Usage: $used\n";
print \`echo EOF\`;
}
EEOF
echo definiteend
exit
`;
const cfg = {
host: '127.0.0.1',
port: 23,
username: 'fakeuser',
password: 'fakepass',
shellPrompt: '$',
removeEcho: 100,
debug: true,
timeout: 5000
};
(async (cfg) => {
const telnet = new TelnetConnection();
await telnet.connect(cfg);
console.log(await telnet.exec(code));
})(cfg); Sometimes it will print out the correct output:
Other times, it will cut off and just display the input I sent it:
It's about 50/50 which happens, and I have no idea what's changing when it works or not and how I can make it always work. |
could try this:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i using a telnet of routeviews.org.
I can connected and send a command to the telnet, but the response comes incomplete.
bellow is my configs and code.
and the response is:
In addition to showing the welcome message on the return, it does not show me the full json that telnet returns.
The json is quite large, but I need it complete for my application
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: