diff --git a/Manifest.in b/Manifest.in index 540b720..16c0d1a 100644 --- a/Manifest.in +++ b/Manifest.in @@ -1 +1,2 @@ -include requirements.txt \ No newline at end of file +include requirements.txt +include utils/*.yml diff --git a/utils/junos_views.py b/utils/junos_views.py new file mode 100755 index 0000000..a8f014d --- /dev/null +++ b/utils/junos_views.py @@ -0,0 +1,7 @@ +""" +Load tables/views +""" +from jnpr.junos.factory import loadyaml +from os.path import splitext +_YAML_ = splitext(__file__)[0] + '.yml' +globals().update(loadyaml(_YAML_)) diff --git a/utils/junos_views.yml b/utils/junos_views.yml new file mode 100644 index 0000000..e40c229 --- /dev/null +++ b/utils/junos_views.yml @@ -0,0 +1,70 @@ +--- + +#### +#### Interface table +#### + +junos_iface_table: + rpc: get-interface-information + args: + extensive: True + args_key: interface_name + item: physical-interface + view: junos_iface_view + +junos_iface_view: + fields: + is_up: { oper-status: True=up } + is_enabled: { admin-status: True=up } + description: description + last_flapped: { interface-flapped/@seconds: int } + mode: logical-interface/address-family/address-family-name + speed: speed + mac_address: current-physical-address + +#### +#### BGP tables +#### + +junos_route_instance_table: + rpc: get-instance-information + item: instance-core + key: instance-name + view: junos_route_instance_view + +junos_route_instance_view: + fields: + name: instance-name + +junos_bgp_table: + rpc: get-bgp-summary-information + item: bgp-peer + key: peer-address + view: junos_bgp_view + +junos_bgp_view: + fields: + remote_as: { peer-as: int } + description: description + is_up: { peer-state: True=Established } + is_enabled: { shutdown: True=False } + uptime: { elapsed-time/@seconds: int } + received_prefixes: { bgp-rib/received-prefix-count: int } + accepted_prefixes: { bgp-rib/accepted-prefix-count: int } + +#### +#### LLDP table +#### + +junos_lldp_table: + rpc: get-lldp-neighbors-information + item: lldp-neighbor-information + key: lldp-local-interface | lldp-local-port-id + view: junos_lldp_view + +junos_lldp_view: + fields: + hostname: lldp-remote-system-name + port: lldp-remote-port-description + +