Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var telnet = require('telnet-client');
- var connection = new telnet();
- var params = {
- host: 'devnetcool.cciops.com',
- port: 22,
- loginPrompt: 'login: ',
- passwordPrompt: 'Password: ',
- username: 'Vanguard',
- password: 'fL@sh3!',
- timeout: 3500,
- // removeEcho: 4
- };
- connection.on('ready', function(prompt) {
- connection.exec(cmd, function(err, response) {
- console.log(response);
- });
- });
- connection.on('timeout', function() {
- console.log('socket timeout!')
- connection.end();
- });
- connection.on('close', function() {
- console.log('connection closed');
- });
- connection.connect(params);
- console.log(response);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement