ktbyers / netmiko

Multi-vendor library to simplify Paramiko SSH connections to network devices
MIT License
3.49k stars 1.26k forks source link

issue on gpon isam fx4 model olt nokia #3416

Open ashimgiri000 opened 2 months ago

ashimgiri000 commented 2 months ago

Description of Issue/Question

it was working fine and executing command on my nokia isam fx series gpon olt devices but i don't know how i got these error out of no where. and i've never use these command on my script "environment more false" or "environment console width 512" or "exclusive edit-config exclusive"

Setup

Netmiko version

(Paste verbatim output from pip freeze | grep netmiko between quotes below)

$ pip freeze | grep netmiko
**netmiko==3.0.0**

Netmiko device_type (if relevant to the issue)

(Paste device_type between quotes below)

alcatel_sros

Steps to Reproduce the Issue

Error Traceback

(Paste the complete traceback of the exception between quotes below)

DEBUG:paramiko.transport:userauth is OK
INFO:paramiko.transport:Auth banner: b'\n\n'
INFO:paramiko.transport:Authentication (password) successful!
DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes
DEBUG:paramiko.transport:[chan 0] Max packet out: 4096 bytes
DEBUG:paramiko.transport:Secsh channel 0 opened.
DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
DEBUG:netmiko:read_channel: 

Welcome to ISAM
typ:user@host1>#
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel: 
typ:user@host1>#
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:[find_prompt()]: prompt is typ:user@host1>#
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:In disable_paging
DEBUG:netmiko:Command: environment more false

DEBUG:netmiko:write_channel: b'environment more false\n'
DEBUG:netmiko:Pattern is: environment\ more\ false
DEBUG:netmiko:_read_channel_expect read_data: environment more false
DEBUG:netmiko:Pattern found: environment\ more\ false environment more false
DEBUG:netmiko:environment more false
DEBUG:netmiko:Exiting disable_paging
DEBUG:netmiko:write_channel: b'environment console width 512\n'
DEBUG:netmiko:Pattern is: environment\ console\ width\ 512
DEBUG:netmiko:_read_channel_expect read_data: 
                                    ^
invalid token
typ:user@host1>#
DEBUG:netmiko:_read_channel_expect read_data: environment console width 512
                                  ^
invalid token
typ:user@host1>#
DEBUG:netmiko:Pattern found: environment\ console\ width\ 512 
                                    ^
invalid token
typ:user@host1>#environment console width 512
                                  ^
invalid token
typ:user@host1>#
DEBUG:netmiko:read_channel: 

typ:user@host1>#
DEBUG:netmiko:Clear buffer detects data in the channel
DEBUG:netmiko:read_channel: 
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:Pattern is: @
DEBUG:netmiko:_read_channel_expect read_data: 
typ:user@host1>#
DEBUG:netmiko:Pattern found: @ 
typ:user@host1>#
DEBUG:netmiko:write_channel: b'edit-config exclusive\n'
DEBUG:netmiko:Pattern is: edit\-config\ exclusive
DEBUG:netmiko:_read_channel_expect read_data: edit-config exclusive
DEBUG:netmiko:Pattern found: edit\-config\ exclusive edit-config exclusive
DEBUG:netmiko:Pattern is: \(ex\)\[
DEBUG:netmiko:_read_channel_expect read_data: 
                       ^
invalid token

DEBUG:netmiko:_read_channel_expect read_data: typ:user@host1>#
DEBUG:netmiko:_read_channel_expect read_data: 

DEBUG:netmiko:_read_channel_expect read_data: 

typ:user@host1>#

Relevant Python code

(Please try to essentialize your Python code to the minimum code needed to reproduce the issue) (Paste the code between the quotes below)

import logging
from netmiko import ConnectHandler
ontInt = [
('host1','1/1','serial'),

]

for i in ontInt:
    print(i[0] + ' ' + i[1] + ' ' + i[2])   
    logging.basicConfig(filename='netmiko_global.log', level=logging.DEBUG)
    logger = logging.getLogger("netmiko")
    nokia_isam = {
        'device_type': 'alcatel_sros',
        'host': f'{i[0]}',
        'username': 'user',
        'password': 'password',
        }

    try:
        net_connect = ConnectHandler(**nokia_isam)
        # net_connect.enable_debugging()
        enableDevEnv = ['environment inhibit-alarms', 'exit all']
        out1 = net_connect.send_config_set(enableDevEnv)
        print(out1)
        net_connect.disconnect()

    except Exception as e:
        net_connect.disconnect()