Beispiel #1
0
def vdc_layer_2():
    """Gets layer two information from the device"""

    global vdc

    if vdc == None:
        vdc = request.form.get("vdc")
        GetInfo.switch_vdc(netmiko_session, vdc=request.form.get("vdc"))
    else:
        GetInfo.switch_vdc_back(netmiko_session)

    GetInfo.switch_vdc(netmiko_session, vdc=request.form.get("vdc"))
    vlans = GetInfo.get_vlans(netmiko_session)
    trunks = GetInfo.get_trunks(netmiko_session)
    port_channels = GetInfo.get_port_channels(netmiko_session)
    interfaces = GetInfo.get_interface_names(netmiko_session)
    arp = GetInfo.get_arp(netmiko_session)
    current_vdc = GetInfo.get_vdcs(netmiko_session)
    vpcs = GetInfo.get_vpcs(netmiko_session)

    return render_template('get_layer_two.html',
                           vlans=vlans,
                           trunks=trunks,
                           port_channels=port_channels,
                           interfaces=interfaces,
                           arp=arp,
                           vdcs=vdcs[0],
                           current_vdc=current_vdc[1],
                           vpc=vpcs)
Beispiel #2
0
def get_routing():
    """Gets all things routing, arp, interfaces, routing protocols"""

    global get_interfaces, local_as, netconf_session, management_int, unassigned_ints, interface_nums

    netconf_session = ConnectWith.create_netconf_connection(username, password, device)
    get_interfaces = GetInterfacesInfo.get_ip_interfaces(netconf_session, device)
    management_int = get_interfaces[1]
    unassigned_ints = get_interfaces[2]
    interface_nums = get_interfaces[3]
    bgp_status = GetInfo.get_bgp_status(netmiko_session)
    local_as = bgp_status[1][0]
    ospf_status = GetInfo.get_ospf_status(netmiko_session)
    arp_table = GetInfo.get_arp(netmiko_session)

    return render_template('routing.html', interfaces=get_interfaces[0],
                           bgp=bgp_status[0], ospf=ospf_status, arp=arp_table, intial='yes')
Beispiel #3
0
def layer_2():
    """Gets layer two information from the device"""

    global vdcs

    vlans = GetInfo.get_vlans(netmiko_session)
    trunks = GetInfo.get_trunks(netmiko_session)
    port_channels = GetInfo.get_port_channels(netmiko_session)
    interfaces = GetInfo.get_interface_names(netmiko_session)
    arp = GetInfo.get_arp(netmiko_session)
    vdcs = GetInfo.get_vdcs(netmiko_session)
    vpcs = GetInfo.get_vpcs(netmiko_session)

    return render_template('get_layer_two.html',
                           vlans=vlans,
                           trunks=trunks,
                           port_channels=port_channels,
                           interfaces=interfaces,
                           arp=arp,
                           vdcs=vdcs[0],
                           current_vdc=vdcs[1],
                           vpcs=vpcs)