Ejemplo n.º 1
0
def snmp_post_config():
    """
    SNMP post config
    """
    snmp_obj.restore_snmp_config(vars.D1)
    if not st.is_community_build():
        ipfeature.configure_loopback(vars.D1,
                                     loopback_name="Loopback0",
                                     config="no")
Ejemplo n.º 2
0
def snmp_config(config='add'):
    global ssh_conn_obj
    if config == 'add':
        ip = ensure_service_params(vars.D1, "snmptrap", "ip")
        username = ensure_service_params(vars.D1, "snmptrap", "username")
        password = ensure_service_params(vars.D1, "snmptrap", "password")
        snmp_obj.set_snmp_config(vars.D1,
                                 snmp_rocommunity=ssh_data.ro_community,
                                 snmp_location=ssh_data.location)
        # Connect to the linux machine and check
        ssh_conn_obj = connect_to_device(ip, username, password)
        if not ssh_conn_obj:
            return False
    else:
        snmp_obj.restore_snmp_config(vars.D1)
    return True
Ejemplo n.º 3
0
def lldp_snmp_post_config():
    """
    LLDP Post Config
    """
    snmp_obj.restore_snmp_config(vars.D1)
Ejemplo n.º 4
0
def mgmt_vrf_epilog():
    restore_snmp_config(vars.D1)
    enable_ssh_in_user_vrf(vars.D1, config='del', vrf_name='mgmt')
    mvrf.config(vars.D1, no_form=True)