ShaneMcC / phprouter

PHP Scripts for interacting with network devices.
MIT License
9 stars 6 forks source link

Telnet Acces error in Linux #23

Open CharlyBote opened 3 years ago

CharlyBote commented 3 years ago

Hi.. I try to access to a device via telnet, but I receive the following error

[Sun Sep 05 23:28:54.434233 2021] [php7:warn] [pid 7033] [client 192.168.11.200:49671] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/buscacli/thirdparty/net_telnet/Net/Telnet.php on line 100 [Sun Sep 05 23:28:54.434277 2021] [php7:error] [pid 7033] [client 192.168.11.200:49671] PHP Fatal error: Uncaught Exception: unknown TELNET command: 253 in /var/www/buscacli/thirdparty/net_telnet/Net/Telnet.php:768\nStack trace:\n#0 /var/www/buscacli/thirdparty/net_telnet/Net/Telnet.php(738): Net_Telnet->send_telcmd('\xFD', '\x01')\n#1 /var/www/buscacli/thirdparty/net_telnet/Net/Telnet.php(642): Net_Telnet->initial_options()\n#2 /var/www/buscacli/Sockets/TelnetSocket.php(27): Net_Telnet->connect()\n#3 /var/www/buscacli/Implementations/CiscoTrait.php(33): shanemcc\PhpRouter\Sockets\TelnetSocket->connect()\n#4 /var/www/buscacli/test.php(9): shanemcc\PhpRouter\Implementations\CiscoRouter->connect()\n#5 {main}\n thrown in /var/www/buscacli/thirdparty/net_telnet/Net/Telnet.php on line 768.

iraqhub commented 2 years ago

same error here too bad author reply was too long ago so i think this project is dead.

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!

ShaneMcC commented 2 years ago

Hi,

Project isn't dead, but I've not encountered this error myself as I don't currently use this with any telnet-only devices. If you can provide more information about how to reproduce (ie, what are you actually connecting to device-wise and what are you attempting to do?)

Alternatively, for many reasons, I'd suggest switching to accessing the devices via SSH not Telnet.