7.33. Cisco Modifier - table

cisco tables modifiers

class nettoolkit.facts_finder.modifiers.cisco.cisco_tables.TableInterfaceCisco(capture, cmd_lst=None, use_cdp=None)[source]

Bases: DataFrameInit, TableInterfaces

Cisco Database Tables Object

Parameters:
  • capture (str) – configuration capture log file

  • cmd_lst (list, optional) – cisco capture command list. Defaults to None.

  • use_cdp (bool, optional) – use cdp neighbors (overrides lldp neighbor). Defaults to None.

Inherits:

DataFrameInit (cls): DataFrameInit TableInterfaces (cls): TableInterfaces

merge_interface_data()[source]

merges interface related data frames from the parsed excel sheet command output which was originated from capture_it along with ntctemplate. DataFrame: A single pandas dataframe clubbed with all interface related details.

po_to_interface()[source]

add port channel number to member interfaces

remove_duplicates()[source]

merges the duplicate columns _x, _y generated during dataframe merge, and removes extra column.

update_functional_cols()[source]

update functional columns values

update_intf_vrf()[source]

update the interface vrf column (if any) by removing management vrfs

update_neighbor_intf()[source]

standardize neighbor interface length

nettoolkit.facts_finder.modifiers.cisco.cisco_tables.filter_col(filtercol)[source]

check for the interface type column and maps it with well known interface type filters Growable.

Parameters:

filtercol (str) – interface type filter column name (key)

Returns:

corresponding standard mapped value for interface type

Return type:

str

nettoolkit.facts_finder.modifiers.cisco.cisco_tables.h4block(ipv6addr)[source]

check for the ipv6 string(s) and from the address returns either 4th or 7th block

Parameters:

ipv6addr (list, set, tuple) – list of IPV6 address strings.

Returns:

4th > 7th octet > Growable

Return type:

str

nettoolkit.facts_finder.modifiers.cisco.cisco_tables.interface_mode(mode)[source]

check for the mode string if it is starting with trunk/access. returns appropriate mode accordingly

Parameters:

mode (str) – interface mode type string (trunk, access)

Returns:

interface mode calculated

Return type:

str

nettoolkit.facts_finder.modifiers.cisco.cisco_tables.intvrf_update(vrf)[source]

get the vrf name except management vrfs

Parameters:

vrf (str) – vrf name

Returns:

vrf name if not management vrf

Return type:

str

nettoolkit.facts_finder.modifiers.cisco.cisco_tables.nbr_hostname(hn)[source]

neighbour hostname split by domain and return striped hostname

Parameters:

hn (str) – hostname string full dns

Returns:

hostname trunkated

Return type:

str

nettoolkit.facts_finder.modifiers.cisco.cisco_tables.subnet(addr)[source]

get the subnet/network ip detail for the interface ip address

Parameters:

addr (str) – ipv4 address/subnet string

Returns:

network address

Return type:

str

nettoolkit.facts_finder.modifiers.cisco.cisco_tables.vlan_members(members)[source]

check for the given vlan members and returns vlan numbers separated by comma. will return no string if default/all

Parameters:

members (str) – vlan members string

Returns:

updated members string

Return type:

str

7.34. Cisco Modifier - var

cisco var modifiers

class nettoolkit.facts_finder.modifiers.cisco.cisco_var.VarCisco(capture, cmd_lst=None)[source]

Bases: DataFrameInit, Var

Cisco Var Databse

Parameters:
  • capture (str) – configuration capture file

  • cmd_lst (list, optional) – capture commands list . Defaults to None.

Inherits:

DataFrameInit (cls): DataFrameInit Var (cls): Var

update_ipv6_hext2_3()[source]

updates the hextate 2 and hextate 3 value from an ipv6 interface. first interface match will be considered.

7.35. Cisco Modifier - vrf

cisco vrf table modifiers

class nettoolkit.facts_finder.modifiers.cisco.cisco_vrfs.TableVrfsCisco(capture, cmd_lst=None)[source]

Bases: DataFrameInit, TableVrfs

Cisco Database VRF Object

Parameters:
  • capture (str) – configuration capture file

  • cmd_lst (list, optional) – capture commands list . Defaults to None.

7.36. Cisco - merger

merger in steps

nettoolkit.facts_finder.modifiers.cisco.merger.cisco_modifier(capture_tfsm_file, cmd_lst=None, var_column_mapper_file=None, int_column_mapper_file=None, use_cdp=False)[source]

Club var/interface/vrf data from various commands parsed excel outputs.

Parameters:
  • capture_tfsm_file (str) – device capture file

  • cmd_lst (_type_, optional) – manually provide commands list, or it will take a few default commands ie. Defaults to None.

  • var_column_mapper_file (str, optional) – var column mapper file. Defaults to None.

  • int_column_mapper_file (str, optional) – interfaces column mapper file. Defaults to None.

  • use_cdp (bool, optional) – inspect cdp neighbors or not. Defaults to False.

Returns:

dictionary of pandas dataframes

Return type:

dict

nettoolkit.facts_finder.modifiers.cisco.merger.get_cmd_list_cisco(var_column_mapper_file=None, int_column_mapper_file=None)[source]

create commands list for each tab (var/interface/vrf) from the column mapper

Parameters:
  • var_column_mapper_file (str, optional) – var column mapper file. Defaults to None.

  • int_column_mapper_file (str, optional) – interfaces column mapper file. Defaults to None.

Returns:

dictionary of commands list

Return type:

dict

7.37. Cisco - commands

# ========================================================================= # THIS FILE CONTAINS THE COLUMN MAPPINGS FROM THE FILE WHICH GOT GENERATED # FROM CAPTURE_IT USING TEXTFSM AND # RELATIVE REQUIRED FIELD VALUES. # =========================================================================