Basic functions from Napalm library
salt.modules.napalm_network.
arp
(interface='', ipaddr='', macaddr='')¶NAPALM returns a list of dictionaries with details of the ARP entries: [{INTERFACE, MAC, IP, AGE}]
CLI example:
salt myminion net.arp
salt myminion net.arp macaddr='5c:5e:ab:da:3c:f0'
参数: |
|
---|
}, {
'interface': 'MgmtEth0/RSP0/CPU0/0', 'mac' : '66:0e:94:96:e0:ff', 'ip' : '172.17.17.2', 'age' : 1435641582.49
}
]
salt.modules.napalm_network.
cli
(*commands)¶NAPALM returns a dictionary with the output of all commands passed as arguments:
CLI example:
salt myminion net.cli "show version" "show route 8.8.8.8"
参数: | commands -- list of raw commands to execute on device |
---|
Model: mx480 Junos: 13.3R6.5
Help me, Obi-Wan I just saw Episode Two You're my only hope
''',
Top Rear Fan OK 3840 Spinning at intermediate-speed Bottom Rear Fan OK 3840 Spinning at intermediate-speed Top Middle Fan OK 3900 Spinning at intermediate-speed Bottom Middle Fan OK 3840 Spinning at intermediate-speed Top Front Fan OK 3810 Spinning at intermediate-speed Bottom Front Fan OK 3840 Spinning at intermediate-speed
'''
}
salt.modules.napalm_network.
ipaddrs
()¶Returns IP addresses on the device
CLI example:
salt myminion net.ipaddrs
salt.modules.napalm_network.
lldp
(interface='')¶returns LLDP neighbors
CLI example:
salt myminion net.lldp
salt myminion net.lldp interface='TenGigE0/0/0/8'
参数: | interface -- interface name to filter on |
---|
'parent_interface': u'Bundle-Ether8', 'interface_description': u'TenGigE0/0/0/8', 'remote_chassis_id': u'8c60.4f69.e96c', 'remote_system_name': u'switch', 'remote_port': u'Eth2/2/1', 'remote_port_description': u'Ethernet2/2/1', 'remote_system_description': u'''Cisco Nexus Operating System (NX-OS) Software 7.1(0)N1(1a)
TAC support: http://www.cisco.com/tac Copyright (c) 2002-2015, Cisco Systems, Inc. All rights reserved.''',
'remote_system_capab': u'B, R', 'remote_system_enable_capab': u'B'
}
]
}
salt.modules.napalm_network.
mac
(address='', interface='', vlan=0)¶returns device MAC address table
CLI example:
salt myminion net.mac
salt myminion net.mac vlan=10
参数: |
|
---|
}, {
'mac' : '8c:60:4f:58:e1:c1', 'interface' : 'xe-1/0/1', 'static' : False, 'active' : True, 'moves' : 2, 'vlan' : 42, 'last_move' : 1453191948.11
}
]
salt.modules.napalm_network.
ping
()¶is the device alive ?
CLI example:
salt myminion net.ping