7.7. cisco parser - arp

cisco show arp table command output parser

nettoolkit.facts_finder.generators.cisco._cmd_parse_arp_table.get_arp_table(cmd_op, *args)[source]

parser - show ip arp command output

Parsed Fields:
  • port/interface

  • ip address

  • mac address

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict

7.8. cisco parser - bgp

cisco running-config parser for bgp section output

class nettoolkit.facts_finder.generators.cisco._cmd_parse_bgp.AddressFamily(cmd_op)[source]

Bases: BGP_Papa

object for address-family BGP running config parser

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

bgp_read(func)[source]

directive function to get the various bgp af level output

Parameters:

func (method) – method to be executed on bgp af config line

Returns:

parsed output dictionary

Return type:

dict

class nettoolkit.facts_finder.generators.cisco._cmd_parse_bgp.BGP(cmd_op)[source]

Bases: BGP_Papa

object for native BGP running config parser

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

bgp_read(func)[source]

directive function to get the various bgp native level output

Parameters:

func (method) – method to be executed on bgp native config line

Returns:

parsed output dictionary

Return type:

dict

class nettoolkit.facts_finder.generators.cisco._cmd_parse_bgp.BGP_Papa(cmd_op)[source]

Bases: object

parent object for BGP level running config parser

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

bgp_nbr_attributes()[source]

update the bgp neighbor attribute details

static get_nbr_attributes(op_dict, line, spl)[source]

parser function to update bgp neighbor attribute details

Parameters:
  • port_dict (dict) – dictionary with a bgp neighbour info

  • line (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

nettoolkit.facts_finder.generators.cisco._cmd_parse_bgp.get_bgp_af_running(cmd_op, *args)[source]

defines set of methods executions. to get various bgp address-family parameters. uses AddressFamily in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

nettoolkit.facts_finder.generators.cisco._cmd_parse_bgp.get_bgp_running(cmd_op, *args)[source]

defines set of methods executions. to get various bgp native parameters. uses BGP in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

nettoolkit.facts_finder.generators.cisco._cmd_parse_bgp.merge_vrftype_name_inkey(d)[source]

update vrf and vrf_type in dictionary

Parameters:

d (dict) – dictionary with neighbours attributes

Returns:

updated dict with bgp_vrf and address-family attributes

Return type:

dict

7.9. cisco parser - cdp

cisco show cdp neighbour command output parser

nettoolkit.facts_finder.generators.cisco._cmd_parse_cdp.get_cdp_neighbour(cmd_op, *args, dsr=True)[source]

parser - show cdp neigh command output // Deprycated and removed // use lldp neighbor instead.

Parsed Fields:
  • port/interface

  • neighbor interface

  • neighbor plateform

  • neighbor hostname

Parameters:
  • cmd_op (list, str) – command output in list/multiline string.

  • dsr (bool, optional) – DOMAIN SUFFIX REMOVAL. Defaults to True.

Returns:

output dictionary with parsed fields

Return type:

dict

7.10. cisco parser - if description

cisco show interface description command output parser

nettoolkit.facts_finder.generators.cisco._cmd_parse_int_description.get_interface_description(cmd_op, *args)[source]

parser - show int descript command output

Parsed Fields:
  • port/interface

  • description

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict

7.11. cisco parser - if status

cisco show interface status command output parser

nettoolkit.facts_finder.generators.cisco._cmd_parse_int_status.get_interface_status(cmd_op, *args)[source]

parser - show int status command output

Parsed Fields:
  • port/interface

  • port_type

  • duplex

  • speed

  • port_status

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict

7.12. cisco parser - lldp

cisco show lldp neighbour command output parser

nettoolkit.facts_finder.generators.cisco._cmd_parse_lldp.get_lldp_neighbour(cmd_op, *args, dsr=True)[source]

parser - show lldp neigh command output

Parsed Fields:
  • port/interface

  • neighbor interface

  • neighbor hostname

Parameters:
  • cmd_op (list, str) – command output in list/multiline string.

  • dsr (bool, optional) – DOMAIN SUFFIX REMOVAL. Defaults to True.

Returns:

output dictionary with parsed fields

Return type:

dict

7.13. cisco parser - mac

cisco show mac address-table command output parser

nettoolkit.facts_finder.generators.cisco._cmd_parse_mac_table.get_mac_address_table(cmd_op, *args)[source]

parser - show mac address-table command output

Parsed Fields:
  • port/interface

  • neighbor mac

  • neighbor mac2

  • neighbor mac4

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict

7.14. cisco parser - ospf

cisco show running-config parser for ospf section output

class nettoolkit.facts_finder.generators.cisco._cmd_parse_ospf.OSPF(cmd_op)[source]

Bases: object

parent object for OSPF running config parser

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

active_interfaces()[source]

update the active interfaces

static get_active_interfaces(vrf_op_dict, l, spl)[source]

parser function to get active interfaces

Parameters:
  • vrf_op_dict (dict) – dictionary with a vrf info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_networks(vrf_op_dict, l, spl)[source]

parser function to get networks

Parameters:
  • vrf_op_dict (dict) – dictionary with a vrf info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_router_id(vrf_op_dict, l, spl)[source]

parser function to get router-id details

Parameters:
  • vrf_op_dict (dict) – dictionary with a vrf info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

static get_summaries(vrf_op_dict, l, spl)[source]

parser function to get ospf area range summaries

Parameters:
  • vrf_op_dict (dict) – dictionary with a vrf info

  • l (str) – string line to parse

  • spl (list) – splitted line to parse

Returns:

None

Return type:

None

networks()[source]

update the networks

ospf_read(func)[source]

directive function to get the various ospf level output

Parameters:

func (method) – method to be executed on ospf config line

Returns:

parsed output dictionary

Return type:

dict

router_id()[source]

update the router-id details

summaries()[source]

update the ospf area range summaries

nettoolkit.facts_finder.generators.cisco._cmd_parse_ospf.get_ospf_running(cmd_op, *args)[source]

defines set of methods executions. to get various ospf parameters.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with ospf fields

Return type:

dict

7.15. cisco parser - interfaces

cisco show running-config parser for interface section outputs

class nettoolkit.facts_finder.generators.cisco._cmd_parse_running_interfaces.RunningInterfaces(cmd_op)[source]

Bases: object

object for interface level running config parser

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

static get_int_channel_group(port_dict, l)[source]

parser function to update interface port channel details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_int_mode_details(port_dict, l)[source]

parser function to update interface mode details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_int_ospf_auth(port_dict, l)[source]

parser function to update ospf authentication details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_int_udld(port_dict, l)[source]

parser function to update udld parameter details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_int_vlan_details(port_dict, l)[source]

parser function to update interface vlan details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_int_vrf(port_dict, l)[source]

parser function to update interface vrf details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_interface_description(port_dict, l)[source]

parser function to update interface description details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_interface_state(port_dict, l)[source]

parser function to update interface state details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_interface_v4_helpers(port_dict, l)[source]

parser function to update ipv4 helpers details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_interface_v6_helpers(port_dict, l)[source]

parser function to update ipv6 helpers details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_ip_details(port_dict, l)[source]

parser function to update interface ipv4 ip address details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_ipv6_details(port_dict, l)[source]

parser function to update interface ipv6 ip address details

Parameters:
  • port_dict (dict) – dictionary with a port info

  • l (str) – string line to parse

Returns:

None

Return type:

None

interface_channel_group()[source]

update the interface port channel details

interface_description()[source]

update the interface description details

interface_ips()[source]

update the interface ipv4 ip address details

interface_mode()[source]

update the interface mode details

interface_ospf_auth()[source]

update the interface ospf authentication details

interface_read(func)[source]

directive function to get the various interface level output

Parameters:

func (method) – method to be executed on interface config line

Returns:

parsed output dictionary

Return type:

dict

interface_state()[source]

update the interface status (up/down/disabled) details

interface_udld()[source]

update the interface udld parameter details

interface_v4_helpers()[source]

update the interface ipv4 helpers details

interface_v6_helpers()[source]

update the interface ipv6 helpers details

interface_v6_ips()[source]

update the interface ipv6 ip address details

interface_vlans()[source]

update the interface vlan details

interface_vrf()[source]

update the interface vrf details

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_interfaces.get_interfaces_running(cmd_op, *args)[source]

defines set of methods executions. to get various inteface parameters. uses RunningInterfaces in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

7.16. cisco parser - prefix lists

cisco running-config - prefix list output parser

class nettoolkit.facts_finder.generators.cisco._cmd_parse_running_prefix_list.RunningPrefixLists(cmd_op)[source]

Bases: object

object for running config prefix list parser

static get_obj_dict(dic, l, spl)[source]

parser function to update prefix-list details

Parameters:
  • dic (dict) – blank dictionary to update a prefix-list info

  • l (str) – line to parse

Returns:

None

Return type:

None

pl_dict()[source]

update the prefix-list details

pl_read(func)[source]

directive function to get the various prefix list level output

Parameters:

func (method) – method to be executed on prefix list config line

Returns:

parsed output dictionary

Return type:

dict

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_prefix_list.get_system_running_prefix_lists(cmd_op, *args)[source]

defines set of methods executions. to get various ip prefix-list parameters. uses RunningPrefixLists in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

7.17. cisco parser - routes

cisco running-config - ip routes output parser

class nettoolkit.facts_finder.generators.cisco._cmd_parse_running_routes.RunningRoutes(cmd_op)[source]

Bases: object

object for running config routes parser

static get_route_dict(dic, l, spl)[source]

parser function to update route details

Parameters:
  • dic (dict) – blank dictionary to update a route info

  • l (str) – line to parse

Returns:

None

Return type:

None

route_read(func)[source]

directive function to get the various routes level output

Parameters:

func (method) – method to be executed on ip routes config line

Returns:

parsed output dictionary

Return type:

dict

routes_dict()[source]

update the route details

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_routes.get_administrative_dist(spl, next_hop, idx_distance)[source]

get administrative distance value from ip route command list

Parameters:
  • spl (list) – ip route command splitted

  • next_hop (str) – next hop value

  • idx_distance (int) – index distance

Returns:

value of administrative distance configured or ``

Return type:

str

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_routes.get_multi_idx_item(item, lst)[source]

get multi indexex item from list

Parameters:
  • item (str) – item

  • lst (list) – list of items

Returns:

index till end of list

Return type:

str

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_routes.get_pfx_nh_idxdist(version, spl, idx_distance)[source]

get tuple of prefix, nexthop, indexdistance for give ip route split line

Parameters:
  • version (int) – ip route version

  • spl (list) – list of splitted ip route command

  • idx_distance (int) – index distance

Returns:

_description_

Return type:

_type_

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_routes.get_singel_idx_item(item, lst)[source]

gives next item if found item from list

Parameters:
  • item (str) – item

  • lst (list) – list of items

Returns:

Next index item found in list

Return type:

str

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_routes.get_system_running_routes(cmd_op, *args)[source]

defines set of methods executions. to get various ip route parameters. uses RunningRoutes in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_routes.index_of(item, lst)[source]

index of an item from list

Parameters:
  • item (str) – item

  • lst (list) – list of items

Returns:

index of found item else ``

Return type:

int

7.18. cisco parser - sys_info

cisco show running-config parser for system outputs

class nettoolkit.facts_finder.generators.cisco._cmd_parse_running_system.RunningSystem(cmd_op)[source]

Bases: object

object for running config parser

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

system_bgp_as_number()[source]

get the device bgp as number

system_ca_certificate()[source]

get the device certificate hex values for cisco 9k & supported series switches.

system_exec_banner()[source]

get exec banner first line

system_hostname()[source]

get hostname of device

system_name_server()[source]

get list of dns name server ips from configurations

system_ntp_server()[source]

get list of ntp server ips from configurations

system_syslog_server()[source]

get list of syslog server ips from configurations

system_tacacs_server()[source]

get list of tacacs server ips from aaa configurations

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_system.get_system_running(cmd_op, *args)[source]

defines set of methods executions. to get various system parameters. uses RunningSystem in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

7.19. cisco parser - vrf

cisco show running-config command parser for vrf level outputs

class nettoolkit.facts_finder.generators.cisco._cmd_parse_running_vrfs.RunningVRFs(cmd_op)[source]

Bases: object

object for VRF level running config parser

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

static get_vrf_af(port_dict, l)[source]

parser function to update vrf address-family details

Parameters:
  • port_dict (dict) – dictionary with a vrf info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_vrf_description(port_dict, l)[source]

parser function to update vrf description details

Parameters:
  • port_dict (dict) – dictionary with a vrf info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_vrf_rd(port_dict, l)[source]

parser function to update vrf rd details

Parameters:
  • port_dict (dict) – dictionary with a vrf info

  • l (str) – string line to parse

Returns:

None

Return type:

None

static get_vrf_rt(port_dict, l)[source]

parser function to update vrf rt details

Parameters:
  • port_dict (dict) – dictionary with a vrf info

  • l (str) – string line to parse

Returns:

None

Return type:

None

vrf_af()[source]

update the vrf address-family details

vrf_description()[source]

update the vrf description details

vrf_rd()[source]

update the vrf rd details

vrf_read(func)[source]

directive function to get the various VRF level output

Parameters:

func (method) – method to be executed on VRF config line

Returns:

parsed output dictionary

Return type:

dict

vrf_rt()[source]

update the vrf rt details

nettoolkit.facts_finder.generators.cisco._cmd_parse_running_vrfs.get_vrfs_running(cmd_op, *args)[source]

defines set of methods executions. to get various vrf parameters. uses RunningVRFs in order to get all.

Parameters:

cmd_op (list, str) – running config output, either list of multiline string

Returns:

output dictionary with parsed with system fields

Return type:

dict

7.20. cisco parser - version

cisco show version command output parser

nettoolkit.facts_finder.generators.cisco._cmd_parse_version.get_version(cmd_op, *args)[source]

parser - show version command output

Parsed Fields:
  • software

  • bootfile

  • serial

  • model

Parameters:

cmd_op (list, str) – command output in list/multiline string.

Returns:

output dictionary with parsed fields

Return type:

dict