Automation

 View Only

IMPORTANT MODERATION NOTICE

This community is currently under full moderation, meaning  all posts will be reviewed before appearing in the community. Please expect a brief delay—there is no need to post multiple times. If your post is rejected, you'll receive an email outlining the reason(s). We've implemented full moderation to control spam. Thank you for your patience and participation.



  • 1.  PYEZ subsystem not found

    This message was posted by a user wishing to remain anonymous
    Posted 02-16-2022 09:33
    This message was posted by a user wishing to remain anonymous

    Hi,

    I have a working script getting info with RPC calls, although on the Device (Juniper ACX5096) I am getting this log message when connecting  NETCONF over SSH with PYEZ 

    sshd[95789]: Accepted password for basicconfig from 10.230.11.60 port 52306 ssh2
    subsystem request for netconf by user remote failed, subsystem not found
    inetd[1748]: /usr/sbin/sshd[95789]: exited, status 255

    Not sure why, is there someone who can explain why i am getting this?

    Kr, Jeroen


  • 2.  RE: PYEZ subsystem not found

     
    Posted 02-25-2022 11:16
    Could you help us out by sharing the "system / services" configuration on your device, and the snippet of your code that uses PyEZ?

    Obviously this isn't an error that you should be receiving, so we need to check the basics before digging in deeper.

    ------------------------------
    Calvin Remsburg
    ------------------------------



  • 3.  RE: PYEZ subsystem not found

    This message was posted by a user wishing to remain anonymous
    Posted 02-28-2022 06:14
    This message was posted by a user wishing to remain anonymous

    Hi Calvin,

    system/services

    ssh {
        root-login allow;
        protocol-version v2;
        max-sessions-per-connection 32;
        connection-limit 7;
        rate-limit 10;
    }
    ​


    pyez code

    try:
        # NETCONF session over SSH
        print('Starting: ',hostname)
        with Device(host=hostname, user=junos_username, passwd=junos_password, port=22, huge_tree=True) as dev:
    
            print('Fetching route summary')
            route = dev.rpc.get_route_summary_information({'format':'json'})
    
            print('Fetching vpls connections')
            d1 = dev.rpc.get_vpls_connection_information({'format':'json'})
    
            print('Fetching ospf neighbor information')
            ospf_info = dev.rpc.get_ospf_neighbor_information({'format':'json'})
    
            print('Fetching mpls interface information')
            mpls_interfaces = dev.rpc.get_mpls_interface_information({'format':'json'})
    
            print('Fetching ldp neighbor information')
            ldp_neighbors = dev.rpc.get_ldp_neighbor_information({'format':'json'})
    
            print('Fetching ldp interface information')
            ldp_interfaces = dev.rpc.get_ldp_interface_information({'format':'json'})
    
            print('Fetching interface information')
            interfaces_terse = dev.rpc.get_interface_information({'format':'json'}, terse=True)
    
            print('Fetching vpls mac-table information')
            vpls_mac_tables = dev.rpc.get_vpls_mac_table({'format':'json'})
    
            print('Fetching BGP neighbor infromation')
            bgp_neigbors = dev.rpc.get_bgp_neighbor_information({'format':'json'})
    
            print('Fetching ARP table for interface irb.4001')
            arp = dev.rpc.get_arp_table_information({'format':'json'}, interface = "irb.4001")
    
            print('Fetching optical information')
            optical = dev.rpc.get_interface_optics_diagnostics_information({'format':'json'})
    
            
    
    
    except Exception as err:
        print (err)
        sys.exit(1)


    I only get these logging on ACX devices, on MX series it does not occur. 


    Kind regards, 

    Jeroen


  • 4.  RE: PYEZ subsystem not found

     
    Posted 02-28-2022 08:53
    I see you're trying to run NETCONF over SSH's port 22, this is acceptable but you still need to enable the NETCONF protocol.

    set system services netconf ssh port 22​


    Your script's error code reports that you're trying to use the NETCONF protocol but there is no listening service (subsystem) enabled.

    If you weren't using port 22 and instead relying on the default port 830, you would get a different error code back.

    Try my suggestion and let us know if it works.



    ------------------------------
    Calvin Remsburg | Global Enterprise Architect | Juniper Networks
    ------------------------------