From e982b78f24d1dca3d2bc92a39b8e9fcf35b39a37 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 9 Jan 2021 14:31:48 +0100 Subject: xml: op-mode: add preprocessor support as known from configuration mode --- op-mode-definitions/show-log.xml.in | 218 ++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 op-mode-definitions/show-log.xml.in (limited to 'op-mode-definitions/show-log.xml.in') diff --git a/op-mode-definitions/show-log.xml.in b/op-mode-definitions/show-log.xml.in new file mode 100644 index 000000000..b00e4cfec --- /dev/null +++ b/op-mode-definitions/show-log.xml.in @@ -0,0 +1,218 @@ + + + + + + + Show contents of current master log file + + /bin/journalctl + + + + Show contents of all master log files + + eval $(lesspipe); less $_vyatta_less_options --prompt=".log?m, file %i of %m., page %dt of %D" -- `printf "%s\n" /var/log/messages* | sort -nr` + + + + Show listing of authorization attempts + + /bin/journalctl -q SYSLOG_FACILITY=10 SYSLOG_FACILITY=4 + + + + Show log for Cluster + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e heartbeat -e cl_status -e mach_down -e ha_log + + + + Show log for Conntrack-sync + + cat $(printf "%s\n" /var/log/messages* | sort -nr ) | grep -e conntrackd + + + + Show log for Dynamic Host Control Protocol (DHCP) + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep dhcpd + + + + Show log for Firewall + + + + + Show log for a specified firewall (IPv6) + + firewall ipv6-name + + + cat $(printf "%s\n" /var/log/messages* | sort -nr ) | egrep "\[$5-([0-9]+|default)-[ADR]\]" + + + + Show log for a rule in the specified firewall + + firewall ipv6-name ${COMP_WORDS[4]} rule + + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e "\[$5-$7-[ADR]\]" + + + + + + Show log for a specified firewall (IPv4) + + firewall name + + + cat $(printf "%s\n" /var/log/messages* | sort -nr ) | egrep "\[$5-([0-9]+|default)-[ADR]\]" + + + + Show log for a rule in the specified firewall + + firewall name ${COMP_WORDS[4]} rule + + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | egrep "\[$5-$7-[ADR]\]" + + + + + + + + Show log for HTTPs + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e nginx + + + + Show contents of master log file for image + + + + + less $_vyatta_less_options --prompt=".log, page %dt of %D" -- /lib/live/mount/persistence/boot/$4/rw/var/log/messages + + + + Show contents of all master log files for image + + eval $(lesspipe); less $_vyatta_less_options --prompt=".log?m, file %i of %m., page %dt of %D" -- `printf "%s\n" /lib/live/mount/persistence/boot/$4/rw/var/log/messages* | sort -nr` + + + + Show listing of authorization attempts for image + + less $_vyatta_less_options --prompt=".log, page %dt of %D" -- /lib/live/mount/persistence/boot/$4/rw/var/log/auth.log + + + + Show last changes to messages + + <NUMBER> + + + tail -n "$6" /lib/live/mount/persistence/boot/$4/rw/var/log/messages | ${VYATTA_PAGER:-cat} + + + + + + Show log for LLDP + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e lldpd + + + + Show log for Network Address Translation (NAT) + + egrep -i "kernel:.*\[NAT-[A-Z]{3,}-[0-9]+(-MASQ)?\]" $(find /var/log -maxdepth 1 -type f -name messages\* | sort -t. -k2nr) + + + + Show log for OpenVPN + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e openvpn + + + + Show log for Simple Network Monitoring Protocol (SNMP) + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e snmpd + + + + Show last n changes to messages + + <NUMBER> + + + tail -n "$4" /var/log/messages | ${VYATTA_PAGER:-cat} + + + + Show last 10 lines of /var/log/messages file + + tail -n 10 /var/log/messages + + + + Show log for Virtual Private Network (VPN) + + + + + Show log for ALL + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e charon -e accel -e pptpd -e ppp + + + + Show log for IPSec + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e charon + + + + Show log for L2TP + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e remote-access-aaa-win -e remote-access-zzz-mac -e accel-l2tp -e ppp + + + + Show log for PPTP + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e accel-pptp -e ppp + + + + Show log for SSTP + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e accel-sstp -e ppp + + + + + + Show log for Virtual Router Redundancy Protocol (VRRP) + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e Keepalived_vrrp + + + + Show log for Webproxy + + cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e "squid" + + + + + + -- cgit v1.2.3