<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Telnet login timing in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4442644#M2310</link>
    <description>&lt;P&gt;Hi how can I improve my skills due to it&lt;/P&gt;</description>
    <pubDate>Mon, 02 Aug 2021 05:23:48 GMT</pubDate>
    <dc:creator>__Babygirl__09</dc:creator>
    <dc:date>2021-08-02T05:23:48Z</dc:date>
    <item>
      <title>Telnet login timing</title>
      <link>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4414771#M2305</link>
      <description>&lt;P&gt;Dear colleagues&lt;/P&gt;&lt;P&gt;I'm running a script to automate bulk commands across devices and some of them I can only access via telnet.&lt;/P&gt;&lt;P&gt;However it seems like the connect() functions sometimes misses the login time and ends up failing:&lt;/P&gt;&lt;PRE&gt;aix@N10-ACASTRO:~/pyats2$ /usr/bin/python3 /home/aix/pyats2/main.py

2021-06-08 14:54:38,901: %UNICON-INFO: +++ RT-BIOCOM-TRANSBRAS logfile /tmp/RT-1-cli-20210608T145438895.log +++

2021-06-08 14:54:38,902: %UNICON-INFO: +++ Unicon plugin ios +++
Trying 10.9.248.1...


2021-06-08 14:54:38,943: %UNICON-INFO: +++ connection to spawn: telnet 10.9.248.1, id: 140453737108536 +++

2021-06-08 14:54:38,944: %UNICON-INFO: connection to RT-1
Connected to 10.9.248.1.
Escape character is '^]'.



User Access Verification

Username: Um erro ocorreu ao conectar ao dispositivo Device RT-BIOCOM-TRANSBRAS, type ios
Conectando ao dispositivo Device RT-1, type ios
Trying 10.9.248.1...


2021-06-08 14:54:50,871: %UNICON-INFO: +++ connection to spawn: telnet 10.9.248.1, id: 140453703976160 +++

2021-06-08 14:54:50,872: %UNICON-INFO: connection to RT-1
Connected to 10.9.248.1.
Escape character is '^]'.&lt;/PRE&gt;&lt;P&gt;Is there any way to fix or adjust the timing properly?&lt;/P&gt;&lt;P&gt;Below a python snippet&lt;/P&gt;&lt;PRE&gt;from genie.conf import Genie
testbed = Genie.init("my-testbed-2.yaml")
for device in testbed:
     device.connect()&lt;/PRE&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 15:22:10 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4414771#M2305</guid>
      <dc:creator>Andre Castro</dc:creator>
      <dc:date>2021-06-08T15:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Telnet login timing</title>
      <link>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4421244#M2306</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/313963"&gt;@Andre Castro&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a specific orchestration or management software you're using? I'd like to know which technology and which release version you're running before I make any suggestions. I think other user could benefit from that as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 15:53:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4421244#M2306</guid>
      <dc:creator>Alexander Stevenson</dc:creator>
      <dc:date>2021-06-21T15:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Telnet login timing</title>
      <link>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4429369#M2307</link>
      <description>&lt;P&gt;Hello Andre,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like Alex mentioned above, we need more information before we can make suggestions. However, if you're still facing the issue, I'd recommend you to test the telnetlib in a separated environment so you can learn how to use it and the outputs you'll receive while using it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Telnetlib comes with Python and it supports timeout, here's the docs: &lt;A href="https://docs.python.org/3/library/telnetlib.html" target="_blank" rel="noopener"&gt;https://docs.python.org/3/library/telnetlib.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple code snippet with telnet and send a command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import socket
import telnetlib
import time

device = ""
user = ""
password = ""

try:
    client = telnetlib.Telnet(host=device,port=23, timeout=100)
    client.read_until(b"username: ")
    client.write(user.encode('ascii') + b"\n")
    if password:
        client.read_until(b"password: ")
        client.write(password.encode('ascii') + b"\n")
    client.write(b"show ip int brief\n")
    time.sleep(2)
    client.write(b"exit\n"))
    print(client.read_all().decode('ascii'))

except socket.timeout:
    print("Socket timed out while connecting to " + device)&lt;/PRE&gt;&lt;P&gt;Hope that can shed some light, let us know if you solved the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Renan&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 16:23:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4429369#M2307</guid>
      <dc:creator>renanhingel</dc:creator>
      <dc:date>2021-07-07T16:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Telnet login timing</title>
      <link>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4429375#M2308</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/976325"&gt;@Alexander Stevenson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No, I'm just using my own script to run batch commands.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 16:35:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4429375#M2308</guid>
      <dc:creator>Andre Castro</dc:creator>
      <dc:date>2021-07-07T16:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Telnet login timing</title>
      <link>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4429378#M2309</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/886778"&gt;@renanhingel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the suggestion.&lt;/P&gt;&lt;P&gt;Surely I can use this method but I'm still curious about the pyATS library, as opposed to Ansible for instance which runs flawlessly, there is a lot of additional overhead in it though.&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 16:38:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4429378#M2309</guid>
      <dc:creator>Andre Castro</dc:creator>
      <dc:date>2021-07-07T16:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Telnet login timing</title>
      <link>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4442644#M2310</link>
      <description>&lt;P&gt;Hi how can I improve my skills due to it&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 05:23:48 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/telnet-login-timing/m-p/4442644#M2310</guid>
      <dc:creator>__Babygirl__09</dc:creator>
      <dc:date>2021-08-02T05:23:48Z</dc:date>
    </item>
  </channel>
</rss>

