Dear Team,
Please help me in using API from node or python scripts. I’m using Win Beta 15.
First, I tried to use nodejs with SSH2 library. It works well with my other SSH servers, but when I use it for connection to ZRCSAPI I get error at command execution.
The second issue - after error ZAAPI.exe takes about 27% CPU for a while, and I can’t connect with Putty/other terminals.
Script example:
var Client = require(‘ssh2’).Client;
var conn = new Client();
conn.on('ready', function() {
console.log('Client :: ready');
conn.exec('zCommand Dial StartPmi Duration: 30', function(err, stream) {
if (err){
throw err;
}
stream.on('close', function(code, signal) {
console.log('Stream :: close :: code: ' + code + ', signal: ' + signal);
conn.end();
}).on('data', function(data) {
console.log('STDOUT: ' + data);
}).stderr.on('data', function(data) {
console.log('STDERR: ' + data);
});
});
}).connect({
host: '127.0.0.1',
port: 2244,
username: 'zoom',
password: 'P@ssword'
});
Error:
index.js:9
throw err;
^Error: Unable to exec
at c:\tssh\node_modules\ssh2\lib\client.js:1387:19
at SSH2Stream. (c:\tssh\node_modules\ssh2\lib\Channel.js:206:24)
at emitNone (events.js:106:13)
at SSH2Stream.emit (events.js:208:7)
at parsePacket (c:\tssh\node_modules\ssh2-streams\lib\ssh.js:3360:10)
at SSH2Stream._transform (c:\tssh\node_modules\ssh2-streams\lib\ssh.js:694:13)
at SSH2Stream.Transform._read (_stream_transform.js:186:10)
at SSH2Stream._read (c:\tssh\node_modules\ssh2-streams\lib\ssh.js:252:15)
at SSH2Stream.Transform._write (_stream_transform.js:174:12)
at doWrite (_stream_writable.js:396:12)
What I should setup in headers/TTY params/etc to make it works?
In python with paramiko it raised with wait_for_event error.