New in version 2017.7.0.
Runner to search BGP neighbors details.
Minion (proxy) config
The
bgp.neighborsfunction must be appened in the list ofmine_functions:mine_functions: bgp.neighbors: []Which instructs Salt to cache the data returned by the
neighborsfunction from theNAPALM BGP module.How often the mines are refreshed, can be specified using:
mine_interval: <X minutes>
Master config
By default the following options can be configured on the master. They are not mandatory, but available in case the user has different requirements.
- tgt:
*From what minions will collect the mine data. Default:
*(collect mine data from all minions)- tgt_type:
globMinion matching expression form. Default:
glob.- return_fields
What fields to return in the output. It can display all the fields from the
neighborsfunction from theNAPALM BGP module.Some fields cannot be removed:
as_number: the AS number of the neighbordevice: the minion IDneighbor_address: the neighbor remote IP addressBy default, the following extra fields are returned (displayed):
connection_stats: connection stats, as described belowimport_policy: the name of the import policyexport_policy: the name of the export policySpecial fields:
vrf: return the name of the VRF.connection_stats: returning an output of the form<State> <Active>/<Received>/<Accepted>/<Damped>, e.g.Established 398/399/399/0similar to the usual output from network devices.interface_description: matches the neighbor details with the corresponding interface and returns its description. This will reuse functionality from thenet runner, so the user needs to enable the mines as specified in the documentation.interface_name: matches the neighbor details with the corresponding interface and returns the name. Similar tointerface_description, this will reuse functionality from thenet runner, so the user needs to enable the mines as specified in the documentation.- display:
TrueDisplay on the screen or return structured object? Default:
True(return on the CLI).- outputter:
tableSpecify the outputter name when displaying on the CLI. Default:
table.Configuration example:
runners: bgp: tgt: 'edge*' tgt_type: 'glob' return_fields: - up - connection_state - previous_connection_state - suppress_4byte_as - holdtime - flap_count outputter: yaml
salt.runners.bgp.neighbors(*asns, **kwargs)¶Search for BGP neighbors details in the mines of the bgp.neighbors function.
Arguments:
TrueTrue (return on the CLI).tabletable.In addition, any field from the output of the neighbors function
from the NAPALM BGP module can be used as a filter.
CLI Example:
salt-run bgp.neighbors 13335 15169
salt-run bgp.neighbors 13335 ip=172.17.19.1
salt-run bgp.neighbors multipath=True
salt-run bgp.neighbors up=False export_policy=my-export-policy multihop=False
salt-run bgp.neighbors network=192.168.0.0/16
Output example:
BGP Neighbors for 13335, 15169
________________________________________________________________________________________________________________________________________________________________
| Device | AS Number | Neighbor Address | State|#Active/Received/Accepted/Damped | Policy IN | Policy OUT |
________________________________________________________________________________________________________________________________________________________________
| edge01.bjm01 | 13335 | 172.17.109.11 | Established 0/398/398/0 | import-policy | export-policy |
________________________________________________________________________________________________________________________________________________________________
| edge01.bjm01 | 13335 | 172.17.109.12 | Established 397/398/398/0 | import-policy | export-policy |
________________________________________________________________________________________________________________________________________________________________
| edge01.flw01 | 13335 | 192.168.172.11 | Established 1/398/398/0 | import-policy | export-policy |
________________________________________________________________________________________________________________________________________________________________
| edge01.oua01 | 13335 | 172.17.109.17 | Established 0/0/0/0 | import-policy | export-policy |
________________________________________________________________________________________________________________________________________________________________
| edge01.bjm01 | 15169 | 2001::1 | Established 102/102/102/0 | import-policy | export-policy |
________________________________________________________________________________________________________________________________________________________________
| edge01.bjm01 | 15169 | 2001::2 | Established 102/102/102/0 | import-policy | export-policy |
________________________________________________________________________________________________________________________________________________________________
| edge01.tbg01 | 13335 | 192.168.172.17 | Established 0/1/1/0 | import-policy | export-policy |
________________________________________________________________________________________________________________________________________________________________
Docs for previous releases are available on readthedocs.org.
Latest Salt release: 2018.3.3