Skip to content

Commit

Permalink
T5411: add additional monitor log targets
Browse files Browse the repository at this point in the history
  • Loading branch information
c-po committed Jul 27, 2023
1 parent b76f103 commit 2015717
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 106 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,7 @@ op_mode_definitions: $(op_xml_obj)
rm -f $(OP_TMPL_DIR)/clear/node.def
rm -f $(OP_TMPL_DIR)/delete/node.def
rm -f $(OP_TMPL_DIR)/generate/node.def
rm -f $(OP_TMPL_DIR)/monitor/node.def
rm -f $(OP_TMPL_DIR)/set/node.def
rm -f $(OP_TMPL_DIR)/show/node.def
rm -f $(OP_TMPL_DIR)/show/system/node.def
rm -f $(OP_TMPL_DIR)/show/tech-support/node.def

# XXX: ping and traceroute must be able to recursivly call itself as the
Expand Down
4 changes: 2 additions & 2 deletions op-mode-definitions/monitor-bridge.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<children>
<node name="bridge">
<properties>
<help>Monitoring bridge database generated objects and address changes</help>
<help>Monitor bridge database changes</help>
</properties>
<command>sudo bridge monitor all</command>
<children>
<node name="link">
<command>sudo bridge monitor link</command>
<properties>
<help>Monitoring bridge database generated connection interface changes</help>
<help>Monitor bridge database generated connection interface changes</help>
</properties>
</node>
<node name="fdb">
Expand Down
107 changes: 63 additions & 44 deletions op-mode-definitions/monitor-log.xml.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="monitor">
<properties>
<help>Monitor system information</help>
</properties>
<children>
<node name="log">
<properties>
Expand All @@ -27,6 +30,12 @@
</leafNode>
</children>
</node>
<leafNode name="conntrack-sync">
<properties>
<help>Monitor last lines of conntrack-sync log</help>
</properties>
<command>journalctl --no-hostname --follow --boot --unit conntrackd.service</command>
</leafNode>
<node name="dhcp">
<properties>
<help>Monitor last lines of Dynamic Host Control Protocol log</help>
Expand Down Expand Up @@ -117,6 +126,23 @@
</properties>
<command>journalctl --no-hostname --boot --follow --unit chrony.service</command>
</leafNode>
<node name="openvpn">
<properties>
<help>Monitor last lines of OpenVPN log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit openvpn@*.service</command>
<children>
<tagNode name="interface">
<properties>
<help>Monitor last lines of specific OpenVPN interface log</help>
<completionHelp>
<path>interfaces openvpn</path>
</completionHelp>
</properties>
<command>journalctl --no-hostname --boot --unit openvpn@$5.service</command>
</tagNode>
</children>
</node>
<node name="pppoe">
<properties>
<help>Monitor last lines of PPPoE interface log</help>
Expand Down Expand Up @@ -248,9 +274,45 @@
</properties>
<command>journalctl --no-hostname --boot --follow --unit ssh.service</command>
</leafNode>
<leafNode name="vpn">
<properties>
<help>Monitor last lines of ALL Virtual Private Network services</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit strongswan.service --unit accel-ppp@*.service --unit ocserv.service</command>
</leafNode>
<leafNode name="ipsec">
<properties>
<help>Monitor last lines of IPsec log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit strongswan.service</command>
</leafNode>
<leafNode name="l2tp">
<properties>
<help>Monitor last lines of L2TP log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit [email protected]</command>
</leafNode>
<leafNode name="openconnect">
<properties>
<help>Monitor last lines of OpenConnect log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit ocserv.service</command>
</leafNode>
<leafNode name="pptp">
<properties>
<help>Monitor last lines of PPTP log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit [email protected]</command>
</leafNode>
<leafNode name="sstp">
<properties>
<help>Monitor last lines of Secure Socket Tunneling Protocol server</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit [email protected]</command>
</leafNode>
<node name="sstpc">
<properties>
<help>Monitor last lines of Secure Socket Tunneling Protocol log</help>
<help>Monitor last lines of Secure Socket Tunneling Protocol client</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit "ppp@sstpc*.service"</command>
<children>
Expand All @@ -265,49 +327,6 @@
</tagNode>
</children>
</node>
<node name="vpn">
<properties>
<help>Monitor Virtual Private Network services</help>
</properties>
<children>
<leafNode name="all">
<properties>
<help>Monitor last lines of ALL VPNs</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit strongswan.service --unit accel-ppp@*.service --unit ocserv.service</command>
</leafNode>
<leafNode name="ipsec">
<properties>
<help>Monitor last lines of IPsec log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit strongswan.service</command>
</leafNode>
<leafNode name="l2tp">
<properties>
<help>Monitor last lines of L2TP log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit [email protected]</command>
</leafNode>
<leafNode name="openconnect">
<properties>
<help>Monitor last lines of OpenConnect log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit ocserv.service</command>
</leafNode>
<leafNode name="pptp">
<properties>
<help>Monitor last lines of PPTP log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit [email protected]</command>
</leafNode>
<leafNode name="sstp">
<properties>
<help>Monitor last lines of SSTP log</help>
</properties>
<command>journalctl --no-hostname --boot --follow --unit [email protected]</command>
</leafNode>
</children>
</node>
<leafNode name="vpp">
<properties>
<help>Monitor last lines of Vector Packet Processor log</help>
Expand Down
8 changes: 4 additions & 4 deletions op-mode-definitions/monitor-ndp.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<children>
<node name="ndp">
<properties>
<help>Monitor the NDP information received by the router through the device</help>
<help>Monitor Neighbor Discovery Protocol (NDP) information</help>
</properties>
<command>sudo ndptool monitor</command>
<children>
<tagNode name="interface">
<command>sudo ndptool monitor --ifname=$4</command>
<properties>
<help>Monitor ndp protocol on specified interface</help>
<help>Monitor Neighbor Discovery Protocol on specified interface</help>
<completionHelp>
<script>${vyos_completion_dir}/list_interfaces</script>
</completionHelp>
Expand All @@ -20,7 +20,7 @@
<tagNode name="type">
<command>sudo ndptool monitor --ifname=$4 --msg-type=$6</command>
<properties>
<help>Monitor specific types of NDP protocols</help>
<help>Monitor specific Neighbor Discovery Protocol type</help>
<completionHelp>
<list>rs ra ns na</list>
</completionHelp>
Expand All @@ -31,7 +31,7 @@
<tagNode name="type">
<command>sudo ndptool monitor --msg-type=$4</command>
<properties>
<help>Monitor specific types of NDP protocols</help>
<help>Monitor specific Neighbor Discovery Protocol type</help>
<completionHelp>
<list>rs ra ns na</list>
</completionHelp>
Expand Down
102 changes: 49 additions & 53 deletions op-mode-definitions/show-log.xml.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0"?>
<interfaceDefinition>
<node name="show">
<properties>
<help>Show system information</help>
</properties>
<children>
<tagNode name="log">
<properties>
Expand Down Expand Up @@ -395,23 +398,6 @@
</properties>
<command>journalctl --no-hostname --boot --unit ssh.service</command>
</leafNode>
<node name="sstpc">
<properties>
<help>Show log for SSTP client</help>
</properties>
<command>journalctl --no-hostname --boot --unit "ppp@sstpc*.service"</command>
<children>
<tagNode name="interface">
<properties>
<help>Show SSTP client log on specific interface</help>
<completionHelp>
<path>interfaces sstpc</path>
</completionHelp>
</properties>
<command>journalctl --no-hostname --boot --unit "ppp@$5.service"</command>
</tagNode>
</children>
</node>
<tagNode name="tail">
<properties>
<help>Show last n changes to messages</help>
Expand All @@ -427,47 +413,57 @@
</properties>
<command>tail -n 10 /var/log/messages</command>
</node>
<node name="vpn">
<leafNode name="vpn">
<properties>
<help>Monitor last lines of ALL Virtual Private Network services</help>
</properties>
<command>journalctl --no-hostname --boot --unit strongswan.service --unit accel-ppp@*.service --unit ocserv.service</command>
</leafNode>
<leafNode name="ipsec">
<properties>
<help>Show log for IPsec</help>
</properties>
<command>journalctl --no-hostname --boot --unit strongswan.service</command>
</leafNode>
<leafNode name="l2tp">
<properties>
<help>Show log for L2TP</help>
</properties>
<command>journalctl --no-hostname --boot --unit [email protected]</command>
</leafNode>
<leafNode name="openconnect">
<properties>
<help>Show log for OpenConnect</help>
</properties>
<command>journalctl --no-hostname --boot --unit ocserv.service</command>
</leafNode>
<leafNode name="pptp">
<properties>
<help>Show log for PPTP</help>
</properties>
<command>journalctl --no-hostname --boot --unit [email protected]</command>
</leafNode>
<leafNode name="sstp">
<properties>
<help>Show log for Secure Socket Tunneling Protocol (SSTP) server</help>
</properties>
<command>journalctl --no-hostname --boot --unit [email protected]</command>
</leafNode>
<node name="sstpc">
<properties>
<help>Show log for Virtual Private Network (VPN)</help>
<help>Show log for Secure Socket Tunneling Protocol (SSTP) client</help>
</properties>
<command>journalctl --no-hostname --boot --unit "ppp@sstpc*.service"</command>
<children>
<leafNode name="all">
<properties>
<help>Show log for ALL</help>
</properties>
<command>journalctl --no-hostname --boot --unit strongswan.service --unit accel-ppp@*.service --unit ocserv.service</command>
</leafNode>
<leafNode name="ipsec">
<properties>
<help>Show log for IPsec</help>
</properties>
<command>journalctl --no-hostname --boot --unit strongswan.service</command>
</leafNode>
<leafNode name="l2tp">
<properties>
<help>Show log for L2TP</help>
</properties>
<command>journalctl --no-hostname --boot --unit [email protected]</command>
</leafNode>
<leafNode name="openconnect">
<properties>
<help>Show log for OpenConnect</help>
</properties>
<command>journalctl --no-hostname --boot --unit ocserv.service</command>
</leafNode>
<leafNode name="pptp">
<properties>
<help>Show log for PPTP</help>
</properties>
<command>journalctl --no-hostname --boot --unit [email protected]</command>
</leafNode>
<leafNode name="sstp">
<tagNode name="interface">
<properties>
<help>Show log for SSTP</help>
<help>Show SSTP client log on specific interface</help>
<completionHelp>
<path>interfaces sstpc</path>
</completionHelp>
</properties>
<command>journalctl --no-hostname --boot --unit accel-ppp@sstp.service</command>
</leafNode>
<command>journalctl --no-hostname --boot --unit "ppp@$5.service"</command>
</tagNode>
</children>
</node>
<leafNode name="vpp">
Expand Down

0 comments on commit 2015717

Please sign in to comment.