diff options
Diffstat (limited to 'op-mode-definitions')
-rw-r--r-- | op-mode-definitions/container.xml.in (renamed from op-mode-definitions/containers.xml.in) | 60 | ||||
-rw-r--r-- | op-mode-definitions/generate-openconnect-user-key.xml.in | 67 | ||||
-rw-r--r-- | op-mode-definitions/monitor-log.xml.in | 109 | ||||
-rw-r--r-- | op-mode-definitions/show-log.xml.in | 21 | ||||
-rw-r--r-- | op-mode-definitions/traceroute.xml.in | 220 |
5 files changed, 242 insertions, 235 deletions
diff --git a/op-mode-definitions/containers.xml.in b/op-mode-definitions/container.xml.in index b2b318786..fa66402dc 100644 --- a/op-mode-definitions/containers.xml.in +++ b/op-mode-definitions/container.xml.in @@ -11,7 +11,7 @@ <properties> <help>Pull a new image for container</help> </properties> - <command>sudo ${vyos_op_scripts_dir}/containers_op.py --pull "${4}"</command> + <command>sudo podman image pull "${4}"</command> </tagNode> </children> </node> @@ -44,7 +44,51 @@ <script>sudo podman image ls -q</script> </completionHelp> </properties> - <command>sudo ${vyos_op_scripts_dir}/containers_op.py --remove "${4}"</command> + <command>sudo podman image rm --force "${4}"</command> + </tagNode> + </children> + </node> + </children> + </node> + <node name="generate"> + <children> + <node name="container"> + <properties> + <help>Generate Container Image</help> + </properties> + <children> + <tagNode name="image"> + <properties> + <help>Name of container image (tag)</help> + </properties> + <children> + <tagNode name="path"> + <properties> + <help>Path to Dockerfile</help> + <completionHelp> + <list><filename></list> + </completionHelp> + </properties> + <command>sudo podman build --layers --force-rm --tag "$4" $6</command> + </tagNode> + </children> + </tagNode> + </children> + </node> + </children> + </node> + <node name="monitor"> + <children> + <node name="log"> + <children> + <tagNode name="container"> + <properties> + <help>Monitor last lines of container logs</help> + <completionHelp> + <path>container name</path> + </completionHelp> + </properties> + <command>sudo podman logs --follow --names "$4"</command> </tagNode> </children> </node> @@ -56,13 +100,13 @@ <properties> <help>Show containers</help> </properties> - <command>sudo ${vyos_op_scripts_dir}/containers_op.py --all</command> + <command>sudo podman ps --all</command> <children> <leafNode name="image"> <properties> - <help>Delete container image</help> + <help>Show container image</help> </properties> - <command>sudo ${vyos_op_scripts_dir}/containers_op.py --image</command> + <command>sudo podman image ls</command> </leafNode> <tagNode name="log"> <properties> @@ -77,7 +121,7 @@ <properties> <help>Show available container networks</help> </properties> - <command>sudo ${vyos_op_scripts_dir}/containers_op.py --networks</command> + <command>sudo podman network ls</command> </leafNode> </children> </node> @@ -118,12 +162,12 @@ <children> <tagNode name="image"> <properties> - <help>Delete container image</help> + <help>Update container image</help> <completionHelp> <path>container name</path> </completionHelp> </properties> - <command>sudo ${vyos_op_scripts_dir}/containers_op.py --update "${4}"</command> + <command>if cli-shell-api existsActive container name "$4"; then sudo podman pull $(cli-shell-api returnActiveValue container name "$4" image); else echo "Container $4 does not exist"; fi</command> </tagNode> </children> </node> diff --git a/op-mode-definitions/generate-openconnect-user-key.xml.in b/op-mode-definitions/generate-openconnect-user-key.xml.in new file mode 100644 index 000000000..80cdfb3d7 --- /dev/null +++ b/op-mode-definitions/generate-openconnect-user-key.xml.in @@ -0,0 +1,67 @@ +<?xml version="1.0"?> +<interfaceDefinition> + <node name="generate"> + <children> + <node name="openconnect"> + <properties> + <help>Generate OpenConnect client parameters</help> + </properties> + <children> + <tagNode name="username"> + <properties> + <help>Username used for authentication</help> + <completionHelp> + <list><username></list> + </completionHelp> + </properties> + <children> + <node name="otp-key"> + <properties> + <help>Generate OpenConnect OTP token</help> + </properties> + <children> + <node name="hotp-time"> + <properties> + <help>HOTP time-based token</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval 30 --digits 6</command> + <children> + <tagNode name="interval"> + <properties> + <help>Duration of single time interval</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval "$8" --digits 6</command> + <children> + <tagNode name="digits"> + <properties> + <help>The number of digits in the one-time password</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval "$8" --digits "${10}"</command> + </tagNode> + </children> + </tagNode> + <tagNode name="digits"> + <properties> + <help>The number of digits in the one-time password</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval 30 --digits "$8"</command> + <children> + <tagNode name="interval"> + <properties> + <help>Duration of single time interval</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/generate_openconnect_otp_key.py --username "$4" --interval "${10}" --digits $8</command> + </tagNode> + </children> + </tagNode> + </children> + </node> + </children> + </node> + </children> + </tagNode> + </children> + </node> + </children> + </node> +</interfaceDefinition> diff --git a/op-mode-definitions/monitor-log.xml.in b/op-mode-definitions/monitor-log.xml.in index cbdf76fc3..6f82ce611 100644 --- a/op-mode-definitions/monitor-log.xml.in +++ b/op-mode-definitions/monitor-log.xml.in @@ -6,13 +6,96 @@ <properties> <help>Monitor last lines of messages file</help> </properties> - <command>tail --follow=name /var/log/messages</command> + <command>journalctl --no-hostname --follow --boot</command> <children> <node name="colored"> <properties> <help>Output log in a colored fashion</help> </properties> - <command>grc tail --follow=name /var/log/messages</command> + <command>grc journalctl --no-hostname --follow --boot</command> + </node> + <node name="dhcp"> + <properties> + <help>Show log for Dynamic Host Control Protocol (DHCP)</help> + </properties> + <children> + <node name="server"> + <properties> + <help>Show log for DHCP server</help> + </properties> + <command>journalctl --no-hostname --follow --boot --unit isc-dhcp-server.service</command> + </node> + <node name="client"> + <properties> + <help>Show DHCP client logs</help> + </properties> + <command>journalctl --no-hostname --follow --boot --unit "dhclient@*.service"</command> + <children> + <tagNode name="interface"> + <properties> + <help>Show DHCP client log on specific interface</help> + <completionHelp> + <script>${vyos_completion_dir}/list_interfaces.py --broadcast</script> + </completionHelp> + </properties> + <command>journalctl --no-hostname --follow --boot --unit "dhclient@$6.service"</command> + </tagNode> + </children> + </node> + </children> + </node> + <node name="dhcpv6"> + <properties> + <help>Show log for Dynamic Host Control Protocol IPv6 (DHCPv6)</help> + </properties> + <children> + <node name="server"> + <properties> + <help>Show log for DHCPv6 server</help> + </properties> + <command>journalctl --no-hostname --follow --boot --unit isc-dhcp-server6.service</command> + </node> + <node name="client"> + <properties> + <help>Show DHCPv6 client logs</help> + </properties> + <command>journalctl --no-hostname --follow --boot --unit "dhcp6c@*.service"</command> + <children> + <tagNode name="interface"> + <properties> + <help>Show DHCPv6 client log on specific interface</help> + <completionHelp> + <script>${vyos_completion_dir}/list_interfaces.py</script> + </completionHelp> + </properties> + <command>journalctl --no-hostname --follow --boot --unit "dhcp6c@$6.service"</command> + </tagNode> + </children> + </node> + </children> + </node> + <leafNode name="kernel"> + <properties> + <help>Monitor last lines of Linux Kernel log</help> + </properties> + <command>journalctl --no-hostname --boot --follow --dmesg</command> + </leafNode> + <node name="pppoe"> + <properties> + <help>Monitor last lines of PPPoE log</help> + </properties> + <command>journalctl --no-hostname --boot --follow --unit "ppp@pppoe*.service"</command> + <children> + <tagNode name="interface"> + <properties> + <help>Monitor last lines of PPPoE log for specific interface</help> + <completionHelp> + <script>${vyos_completion_dir}/list_interfaces.py -t pppoe</script> + </completionHelp> + </properties> + <command>journalctl --no-hostname --boot --follow --unit "ppp@$6.service"</command> + </tagNode> + </children> </node> <node name="protocol"> <properties> @@ -23,67 +106,67 @@ <properties> <help>Monitor log for OSPF</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/ospfd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/ospfd</command> </leafNode> <leafNode name="ospfv3"> <properties> <help>Monitor log for OSPF for IPv6</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/ospf6d</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/ospf6d</command> </leafNode> <leafNode name="bgp"> <properties> <help>Monitor log for BGP</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/bgpd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/bgpd</command> </leafNode> <leafNode name="rip"> <properties> <help>Monitor log for RIP</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/ripd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/ripd</command> </leafNode> <leafNode name="ripng"> <properties> <help>Monitor log for RIPng</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/ripngd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/ripngd</command> </leafNode> <leafNode name="static"> <properties> <help>Monitor log for static route</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/staticd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/staticd</command> </leafNode> <leafNode name="multicast"> <properties> <help>Monitor log for Multicast protocol</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/pimd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/pimd</command> </leafNode> <leafNode name="isis"> <properties> <help>Monitor log for ISIS</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/isisd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/isisd</command> </leafNode> <leafNode name="nhrp"> <properties> <help>Monitor log for NHRP</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/nhrpd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/nhrpd</command> </leafNode> <leafNode name="bfd"> <properties> <help>Monitor log for BFD</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/bfdd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/bfdd</command> </leafNode> <leafNode name="mpls"> <properties> <help>Monitor log for MPLS</help> </properties> - <command>journalctl --follow --boot /usr/lib/frr/ldpd</command> + <command>journalctl --follow --no-hostname --boot /usr/lib/frr/ldpd</command> </leafNode> </children> </node> diff --git a/op-mode-definitions/show-log.xml.in b/op-mode-definitions/show-log.xml.in index 15bbc7f42..954369712 100644 --- a/op-mode-definitions/show-log.xml.in +++ b/op-mode-definitions/show-log.xml.in @@ -179,9 +179,9 @@ </tagNode> <leafNode name="kernel"> <properties> - <help>Show messages in kernel ring buffer</help> + <help>Show log for Linux Kernel</help> </properties> - <command>sudo dmesg</command> + <command>journalctl --no-hostname --boot --dmesg</command> </leafNode> <leafNode name="lldp"> <properties> @@ -212,6 +212,23 @@ </tagNode> </children> </node> + <node name="pppoe"> + <properties> + <help>Show log for PPPoE</help> + </properties> + <command>journalctl --no-hostname --boot --unit "ppp@pppoe*.service"</command> + <children> + <tagNode name="interface"> + <properties> + <help>Show PPPoE log on specific interface</help> + <completionHelp> + <script>${vyos_completion_dir}/list_interfaces.py -t pppoe</script> + </completionHelp> + </properties> + <command>journalctl --no-hostname --boot --unit "ppp@$6.service"</command> + </tagNode> + </children> + </node> <node name="protocol"> <properties> <help>Show log for Routing Protocols</help> diff --git a/op-mode-definitions/traceroute.xml.in b/op-mode-definitions/traceroute.xml.in index e3217235c..aba0f45e3 100644 --- a/op-mode-definitions/traceroute.xml.in +++ b/op-mode-definitions/traceroute.xml.in @@ -2,226 +2,22 @@ <interfaceDefinition> <tagNode name="traceroute"> <properties> - <help>Track network path to node</help> - <completionHelp> - <list><hostname> <x.x.x.x> <h:h:h:h:h:h:h:h></list> - </completionHelp> - </properties> - <command>/usr/bin/traceroute "$2"</command> - </tagNode> - <node name="traceroute"> - <properties> - <help>Track network path to node</help> + <help>Trace network path to node</help> <completionHelp> <list><hostname> <x.x.x.x> <h:h:h:h:h:h:h:h></list> </completionHelp> </properties> + <command>${vyos_op_scripts_dir}/traceroute.py ${@:2}</command> <children> - <tagNode name="ipv4"> + <leafNode name="node.tag"> <properties> - <help>Explicitly use IPv4 when tracing the path</help> + <help>Traceroute options</help> <completionHelp> - <list><hostname> <x.x.x.x></list> + <script>${vyos_op_scripts_dir}/traceroute.py --get-options "${COMP_WORDS[@]}"</script> </completionHelp> </properties> - <command>/usr/bin/traceroute -4 "$3"</command> - <children> - <node name="tcp"> - <properties> - <help>Route tracing and port detection using TCP</help> - </properties> - <command>sudo /usr/bin/tcptraceroute "$3" </command> - <children> - <tagNode name="port"> - <properties> - <help>TCP port to connect to for path tracing</help> - <completionHelp> - <list>0-65535</list> - </completionHelp> - </properties> - <command>sudo /usr/bin/tcptraceroute "$3" $6</command> - </tagNode> - </children> - </node> - </children> - </tagNode> - <tagNode name="ipv6"> - <properties> - <help>Explicitly use IPv6 when tracing the path</help> - <completionHelp> - <list><hostname> <h:h:h:h:h:h:h:h></list> - </completionHelp> - </properties> - <command>/usr/bin/traceroute -6 "$3"</command> - <children> - <node name="tcp"> - <properties> - <help>Use TCP/IPv6 packets to perform a traceroute</help> - </properties> - <command>sudo /usr/bin/tcptraceroute6 "$3" </command> - <children> - <tagNode name="port"> - <properties> - <help>TCP port to connect to for path tracing</help> - <completionHelp> - <list>0-65535</list> - </completionHelp> - </properties> - <command>sudo /usr/bin/tcptraceroute6 "$3" $6</command> - </tagNode> - </children> - </node> - </children> - </tagNode> - <tagNode name="vrf"> - <properties> - <help>Track network path to specified node via given VRF</help> - <completionHelp> - <path>vrf name</path> - </completionHelp> - </properties> - <children> - <!-- we need an empty tagNode to pass in a plain fqdn/ip address and - let traceroute decide how to handle this parameter --> - <tagNode name=""> - <properties> - <help>Track network path to specified node via given VRF</help> - <completionHelp> - <list><hostname> <x.x.x.x> <h:h:h:h:h:h:h:h></list> - </completionHelp> - </properties> - <command>sudo ip vrf exec "$3" /usr/bin/traceroute "$4"</command> - </tagNode> - <tagNode name="ipv4"> - <properties> - <help>Explicitly use IPv4 when tracing the path via given VRF</help> - <completionHelp> - <list><hostname> <x.x.x.x></list> - </completionHelp> - </properties> - <command>sudo ip vrf exec "$3" /usr/bin/traceroute -4 "$5"</command> - <children> - <node name="tcp"> - <properties> - <help>Route tracing and port detection using TCP</help> - </properties> - <command>sudo ip vrf exec "$3" /usr/bin/tcptraceroute "$5" </command> - <children> - <tagNode name="port"> - <properties> - <help>TCP port to connect to for path tracing</help> - <completionHelp> - <list>0-65535</list> - </completionHelp> - </properties> - <command>sudo ip vrf exec "$3" /usr/bin/tcptraceroute "$5" $8</command> - </tagNode> - </children> - </node> - </children> - </tagNode> - <tagNode name="ipv6"> - <properties> - <help>Explicitly use IPv6 when tracing the path via given VRF</help> - <completionHelp> - <list><hostname> <h:h:h:h:h:h:h:h></list> - </completionHelp> - </properties> - <command>sudo ip vrf exec "$3" /usr/bin/traceroute -6 "$5"</command> - <children> - <node name="tcp"> - <properties> - <help>Use TCP/IPv6 packets to perform a traceroute</help> - </properties> - <command>sudo ip vrf exec "$3" /usr/bin/tcptraceroute6 "$5" </command> - <children> - <tagNode name="port"> - <properties> - <help>TCP port to connect to for path tracing</help> - <completionHelp> - <list>0-65535</list> - </completionHelp> - </properties> - <command>sudo ip vrf exec "$3" /usr/bin/tcptraceroute6 "$5" $8</command> - </tagNode> - </children> - </node> - </children> - </tagNode> - </children> - </tagNode> - </children> - </node> - <node name="monitor"> - <children> - <tagNode name="traceroute"> - <properties> - <help>Monitor path to destination in realtime</help> - <completionHelp> - <list><hostname> <x.x.x.x> <h:h:h:h:h:h:h:h></list> - </completionHelp> - </properties> - <command>/usr/bin/mtr "$3"</command> - </tagNode> - <node name="traceroute"> - <children> - <tagNode name="ipv4"> - <properties> - <help>IPv4 fully qualified domain name (FQDN)</help> - <completionHelp> - <list><fqdn></list> - </completionHelp> - </properties> - <command>/usr/bin/mtr -4 "$4"</command> - </tagNode> - <tagNode name="ipv6"> - <properties> - <help>IPv6 fully qualified domain name (FQDN)</help> - <completionHelp> - <list><fqdn></list> - </completionHelp> - </properties> - <command>/usr/bin/mtr -6 "$4"</command> - </tagNode> - <tagNode name="vrf"> - <properties> - <help>Monitor path to destination in realtime via given VRF</help> - <completionHelp> - <path>vrf name</path> - </completionHelp> - </properties> - <children> - <tagNode name="ipv4"> - <properties> - <help>IPv4 fully qualified domain name (FQDN)</help> - <completionHelp> - <list><fqdn></list> - </completionHelp> - </properties> - <command>sudo ip vrf exec "$4" /usr/bin/mtr -4 "$6"</command> - </tagNode> - <tagNode name="ipv6"> - <properties> - <help>IPv6 fully qualified domain name (FQDN)</help> - <completionHelp> - <list><fqdn></list> - </completionHelp> - </properties> - <command>sudo ip vrf exec "$4" /usr/bin/mtr -6 "$6"</command> - </tagNode> - <tagNode name=""> - <properties> - <help>Track network path to specified node via given VRF</help> - <completionHelp> - <list><hostname> <x.x.x.x> <h:h:h:h:h:h:h:h></list> - </completionHelp> - </properties> - <command>sudo ip vrf exec "$4" /usr/bin/mtr "$5"</command> - </tagNode> - </children> - </tagNode> - </children> - </node> + <command>${vyos_op_scripts_dir}/traceroute.py ${@:2}</command> + </leafNode> </children> - </node> + </tagNode> </interfaceDefinition> |