-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cisco 2960 / 2960X Telnet error #7
Comments
Hi Thanks for the report - most of the devices I interact with are ssh based, so it's entirely possible that I've broken the telnet socket somewhere along the way! I'll try and grab a spare and test it with telnet and see if I can track it down. What version of PHP are you running, and do you have any code to demonstrate the error and what you're trying? Thanks! |
Hey!
Thanks for the speedy reply!
php --version gives
PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )
The specific code I can narrow it down to is this below:
<?php
/**
* Created by PhpStorm.
* User:
* Date: 3/12/2019
* Time: 2:16 PM
*/
include_once('phprouter/PHPRouter.php');
$r = new CiscoRouter('172.20.0.3', 'jared', 'password', 'telnet');
try {
// Try to connect and log in.
// Get some basic data
$cdpNeighbor = $r->exec('show cdp neighbor detail | inc IP');
//Remove duplicates, empty values and whitespace.
$neighborArray = array_unique(array_map('trim', array_filter(explode(' IP address: ', $cdpNeighbor))));
foreach ($neighborArray as $key => $switch) {
print $switch;
}
$r->disconnect();
} catch (Exception $e) {
echo 'There was an error connecting: ', $e->getMessage(), "\n";
die(1);
}
exit();
I seem to receive the error with both CiscoRouter & CiscoSwitch. The error
seems to be thrown on TelnetSocket.php on line 34 in the write function.
The device im using is connectable with telnet from the same exact machine
jared@testpc:~/Desktop/project$ telnet 172.20.0.3
Trying 172.20.0.3...
Connected to 172.20.0.3.
Escape character is '^]'.
> Warning: Access to this system is restricted to
authorized personnel only. Unauthorized access
will be prosecuted.
>
> User Access Verification
> Username: jared
Password:
ciscosw1>
Thank you for your assistance!
…On Tue, Mar 19, 2019 at 6:33 PM Shane Mc Cormack ***@***.***> wrote:
Hi
Thanks for the report - most of the devices I interact with are ssh based,
so it's entirely possible that I've broken the telnet socket somewhere
along the way! I'll try and grab a spare and test it with telnet and see if
I can track it down.
What version of PHP are you running, and do you have any code to
demonstrate the error and what you're trying?
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVYg19OaypNo4ElvjvHFgfz6UYtXltQyks5vYWXKgaJpZM4b893h>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
During attempts to connect using the class to a cisco device with the current release of net_telnet, the class dies with "There was an error connecting: Socket not connected" Setting the telnet debug to true does not seem to give any useful information on why this is failing.
This happens on cisco devices with and without username prompts for telnet sessions.
The text was updated successfully, but these errors were encountered: