-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
197 changed files
with
3,674 additions
and
954 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from nubia import command | ||
from suzieq.cli.nubia_patch import argument | ||
|
||
from suzieq.cli.sqcmds.command import SqTableCommand | ||
from suzieq.sqobjects.igmp import IgmpObj | ||
|
||
|
||
@command("igmp", help="Act on Igmp") | ||
@argument("vrf", description="VRF(s), space separated") | ||
@argument("group", description="Group(s), in quotes, space separated") | ||
class IgmpCmd(SqTableCommand): | ||
"""IGMP table information""" | ||
|
||
def __init__( | ||
self, | ||
engine: str = "", | ||
hostname: str = "", | ||
start_time: str = "", | ||
end_time: str = "", | ||
view: str = "", | ||
namespace: str = "", | ||
format: str = "", # pylint: disable=redefined-builtin | ||
query_str: str = ' ', | ||
columns: str = "default", | ||
vrf: str = "", | ||
group: str = "", | ||
) -> None: | ||
super().__init__( | ||
engine=engine, | ||
hostname=hostname, | ||
start_time=start_time, | ||
end_time=end_time, | ||
view=view, | ||
namespace=namespace, | ||
columns=columns, | ||
format=format, | ||
query_str=query_str, | ||
sqobj=IgmpObj, | ||
) | ||
self.lvars = { | ||
'vrf': vrf.split(), | ||
'group': group.split() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import ipaddress | ||
|
||
from nubia import command | ||
from suzieq.cli.nubia_patch import argument | ||
|
||
from suzieq.cli.sqcmds.command import SqTableCommand | ||
from suzieq.sqobjects.mroutes import MroutesObj | ||
|
||
|
||
@command("mroute", help="Act on Mroutes") | ||
@argument("vrf", description="VRF(s), space separated") | ||
@argument("source", description="Source(s), in quotes, space separated") | ||
@argument("group", description="Group(s), in quotes, space separated") | ||
class MrouteCmd(SqTableCommand): | ||
"""Multicast Routing table information""" | ||
|
||
def __init__( | ||
self, | ||
engine: str = "", | ||
hostname: str = "", | ||
start_time: str = "", | ||
end_time: str = "", | ||
view: str = "", | ||
namespace: str = "", | ||
format: str = "", # pylint: disable=redefined-builtin | ||
query_str: str = ' ', | ||
columns: str = "default", | ||
vrf: str = "", | ||
source: str = '', | ||
group: str = '', | ||
) -> None: | ||
super().__init__( | ||
engine=engine, | ||
hostname=hostname, | ||
start_time=start_time, | ||
end_time=end_time, | ||
view=view, | ||
namespace=namespace, | ||
columns=columns, | ||
format=format, | ||
query_str=query_str, | ||
sqobj=MroutesObj, | ||
) | ||
self.lvars = { | ||
'vrf': vrf.split(), | ||
'source': source.split(), | ||
'group': group.split() | ||
} | ||
|
||
def _json_print_handler(self, in_data): # pylint: disable=method-hidden | ||
"""This handler calls the code to print the IPNetwork as a string""" | ||
if isinstance(in_data, ipaddress.IPv4Network): | ||
return ipaddress.IPv4Network.__str__(in_data) | ||
elif isinstance(in_data, ipaddress.IPv6Network): | ||
return ipaddress.IPv6Network.__str__(in_data) | ||
return in_data | ||
|
||
def _get_ipvers(self, value: str) -> int: | ||
"""Return the IP version in use""" | ||
|
||
if ':' in value: | ||
ipvers = 6 | ||
elif '.' in value: | ||
ipvers = 4 | ||
else: | ||
ipvers = '' | ||
|
||
return ipvers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
service: igmp | ||
keys: | ||
- group | ||
- vrf | ||
- interface | ||
ignore-fields: | ||
- lastUpTime | ||
show-fields: | ||
- interface | ||
- flag | ||
- vrf | ||
|
||
apply: | ||
eos: | ||
version: all | ||
command: | ||
- command: show ip igmp groups | ||
normalize: 'groupList/*/[ | ||
"groupAddress: group", | ||
"interfaceName: interface", | ||
"uptime: lastUpTime", | ||
"lastReporter: querier", | ||
"flag: flag?|dynamic", | ||
"vrf: vrf?|default" | ||
]' | ||
- command: show ip igmp static-groups | ||
normalize: 'intfAddrs/*:interface/[ | ||
"groupAddrsList: group", | ||
"flag: flag?|static", | ||
"vrf: vrf?|default" | ||
]' | ||
nxos: | ||
version: all | ||
command: show ip igmp groups vrf all | ||
textfsm: textfsm_templates/nxos_show_ip_igmp_groups_vrf_all.tfsm | ||
merge: False | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
service: mroutes | ||
keys: | ||
- source | ||
- group | ||
- vrf | ||
ignore-fields: | ||
- statusChangeTimestamp | ||
show-fields: | ||
- source | ||
- group | ||
- rpfInterface | ||
- oifList | ||
- vrf | ||
- ipvers | ||
- rpfNeighbor | ||
- lastUpTime | ||
|
||
|
||
apply: | ||
eos: | ||
version: all | ||
command: show ip mroute | ||
normalize: '*:protocol/groups/*:group/groupSources/*:source/[ | ||
"creationTime: lastUpTime", | ||
"rpfInterface: rpfInterface", | ||
"rpf/rpfNeighbor: rpfNeighbor", | ||
"oifList: oifList", | ||
"vrf: vrf?|default" | ||
]' | ||
|
||
nxos: | ||
version: all | ||
command: show ip mroute vrf all | ||
textfsm: textfsm_templates/nxos_show_ip_mroute_vrf_all.tfsm | ||
merge: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"namespace": "suzieq", | ||
"name": "igmp", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "sqvers", | ||
"type": "string", | ||
"partition": 0, | ||
"default": "2.0", | ||
"suppress": true, | ||
"description": "Schema version, not selectable" | ||
}, | ||
{ | ||
"name": "group", | ||
"type": "string", | ||
"key": 3, | ||
"display": 3, | ||
"description": "The multicast group being subscribed to" | ||
}, | ||
{ | ||
"name": "interface", | ||
"type": "string", | ||
"display": 4, | ||
"description": "The interface with a subscribed to the group" | ||
}, | ||
{ | ||
"name": "flag", | ||
"type": "string", | ||
"display": 5, | ||
"description": "Whether the igmp group is dynamic or statically configured" | ||
}, | ||
{ | ||
"name": "hostname", | ||
"type": "string", | ||
"key": 1, | ||
"display": 1, | ||
"description": "Hostname of the device that returned the data" | ||
}, | ||
{ | ||
"name": "vrf", | ||
"type": "string", | ||
"key": 4, | ||
"display": 6, | ||
"description": "VRF that the group has joined" | ||
}, | ||
{ | ||
"name": "namespace", | ||
"type": "string", | ||
"key": 0, | ||
"display": 0, | ||
"description": "namespace to which the data belongs" | ||
}, | ||
{ | ||
"name": "timestamp", | ||
"type": "timestamp" | ||
}, | ||
{ | ||
"name": "active", | ||
"type": "boolean" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ | ||
"namespace": "suzieq", | ||
"name": "mroutes", | ||
"type": "record", | ||
"fields": [ | ||
{ | ||
"name": "sqvers", | ||
"type": "string", | ||
"partition": 0, | ||
"default": "2.0", | ||
"suppress": true, | ||
"description": "Schema version, not selectable" | ||
}, | ||
{ | ||
"name": "source", | ||
"type": "string", | ||
"key": 2, | ||
"display": 2, | ||
"description": "Source advertising a given multicast group/route" | ||
}, | ||
{ | ||
"name": "group", | ||
"type": "string", | ||
"key": 3, | ||
"display": 3, | ||
"description": "multicast group" | ||
}, | ||
{ | ||
"name": "hostname", | ||
"type": "string", | ||
"key": 1, | ||
"display": 1, | ||
"description": "Device the data was gathered from" | ||
}, | ||
{ | ||
"name": "rpfInterface", | ||
"type": "string", | ||
"display": 4, | ||
"description": "Reverse path forwarding interface. The interface toward the originator of the multicast traffic" | ||
}, | ||
{ | ||
"name": "oifList", | ||
"type": { | ||
"type": "array", | ||
"items": { | ||
"name": "oif", | ||
"type": "string" | ||
} | ||
}, | ||
"display": 5, | ||
"description": "Outgoing interface list. The list of interfaces toward the multicast receivers" | ||
}, | ||
{ | ||
"name": "vrf", | ||
"type": "string", | ||
"key": 3, | ||
"display": 6, | ||
"description": "VRF the data is from on the specific device" | ||
}, | ||
{ | ||
"name": "ipvers", | ||
"type": "long", | ||
"display": 7 | ||
}, | ||
{ | ||
"name": "rpNeighbor", | ||
"type": "string", | ||
"display": 9, | ||
"description": "IP of the RPF neighbor. Should be reachable via the rpfInterface" | ||
}, | ||
{ | ||
"name": "namespace", | ||
"type": "string", | ||
"key": 0, | ||
"display": 0 | ||
}, | ||
{ | ||
"name": "timestamp", | ||
"type": "timestamp", | ||
"display": 10 | ||
}, | ||
{ | ||
"name": "active", | ||
"type": "boolean" | ||
} | ||
] | ||
} |
Oops, something went wrong.