summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/show-log.xml79
-rw-r--r--op-mode-definitions/show-login.xml33
-rw-r--r--op-mode-definitions/show-monitoring.xml13
3 files changed, 125 insertions, 0 deletions
diff --git a/op-mode-definitions/show-log.xml b/op-mode-definitions/show-log.xml
index 87d78cc49..0c4da647b 100644
--- a/op-mode-definitions/show-log.xml
+++ b/op-mode-definitions/show-log.xml
@@ -38,12 +38,91 @@
</properties>
<command>cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep dhcpd</command>
</leafNode>
+ <node name="firewall">
+ <properties>
+ <help>Show log for Firewall</help>
+ </properties>
+ <children>
+ <tagNode name="ipv6-name">
+ <properties>
+ <help>Show log for a specified firewall (IPv6)</help>
+ <completionHelp>
+ <path>firewall ipv6-name</path>
+ </completionHelp>
+ </properties>
+ <command>cat $(printf "%s\n" /var/log/messages* | sort -nr ) | egrep "\[$5-([0-9]+|default)-[ADR]\]"</command>
+ <children>
+ <tagNode name="rule">
+ <properties>
+ <help>Show log for a rule in the specified firewall</help>
+ <completionHelp>
+ <path>firewall ipv6-name ${COMP_WORDS[4]} rule</path>
+ </completionHelp>
+ </properties>
+ <command>cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e "\[$5-$7-[ADR]\]"</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ <tagNode name="name">
+ <properties>
+ <help>Show log for a specified firewall (IPv4)</help>
+ <completionHelp>
+ <path>firewall name</path>
+ </completionHelp>
+ </properties>
+ <command>cat $(printf "%s\n" /var/log/messages* | sort -nr ) | egrep "\[$5-([0-9]+|default)-[ADR]\]"</command>
+ <children>
+ <tagNode name="rule">
+ <properties>
+ <help>Show log for a rule in the specified firewall</help>
+ <completionHelp>
+ <path>firewall name ${COMP_WORDS[4]} rule</path>
+ </completionHelp>
+ </properties>
+ <command>cat $(printf "%s\n" /var/log/messages* | sort -nr) | egrep "\[$5-$7-[ADR]\]"</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
<leafNode name="https">
<properties>
<help>Show log for HTTPs</help>
</properties>
<command>cat $(printf "%s\n" /var/log/messages* | sort -nr) | grep -e nginx</command>
</leafNode>
+ <tagNode name="image">
+ <properties>
+ <help>Show contents of master log file for image</help>
+ <completionHelp>
+ <script>compgen -f /lib/live/mount/persistence/boot/ | grep -v grub | sed -e s@/lib/live/mount/persistence/boot/@@</script>
+ </completionHelp>
+ </properties>
+ <command>less $_vyatta_less_options --prompt=".log, page %dt of %D" -- /lib/live/mount/persistence/boot/$4/rw/var/log/messages</command>
+ <children>
+ <leafNode name="all">
+ <properties>
+ <help>Show contents of all master log files for image</help>
+ </properties>
+ <command>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`</command>
+ </leafNode>
+ <leafNode name="authorization">
+ <properties>
+ <help>Show listing of authorization attempts for image</help>
+ </properties>
+ <command>less $_vyatta_less_options --prompt=".log, page %dt of %D" -- /lib/live/mount/persistence/boot/$4/rw/var/log/auth.log</command>
+ </leafNode>
+ <tagNode name="tail">
+ <properties>
+ <help>Show last changes to messages</help>
+ <completionHelp>
+ <list>&lt;NUMBER&gt;</list>
+ </completionHelp>
+ </properties>
+ <command>tail -n "$6" /lib/live/mount/persistence/boot/$4/rw/var/log/messages | ${VYATTA_PAGER:-cat}</command>
+ </tagNode>
+ </children>
+ </tagNode>
<leafNode name="lldp">
<properties>
<help>Show log for LLDP</help>
diff --git a/op-mode-definitions/show-login.xml b/op-mode-definitions/show-login.xml
new file mode 100644
index 000000000..6d8c782c4
--- /dev/null
+++ b/op-mode-definitions/show-login.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="show">
+ <children>
+ <node name="login">
+ <properties>
+ <help>Show current login credentials</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/show_current_user.sh</command>
+ <children>
+ <leafNode name="groups">
+ <properties>
+ <help>Show current login group information</help>
+ </properties>
+ <command>/usr/bin/id -Gn</command>
+ </leafNode>
+ <leafNode name="level">
+ <properties>
+ <help>Show current login level</help>
+ </properties>
+ <command>if [ -n "$VYATTA_USER_LEVEL_DIR" ]; then basename $VYATTA_USER_LEVEL_DIR; fi</command>
+ </leafNode>
+ <leafNode name="user">
+ <properties>
+ <help>Show current login user id</help>
+ </properties>
+ <command>/usr/bin/id -un</command>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>
diff --git a/op-mode-definitions/show-monitoring.xml b/op-mode-definitions/show-monitoring.xml
new file mode 100644
index 000000000..2651b3438
--- /dev/null
+++ b/op-mode-definitions/show-monitoring.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="show">
+ <children>
+ <leafNode name="monitoring">
+ <properties>
+ <help>Show currently monitored services</help>
+ </properties>
+ <command>vtysh -c "show debugging"</command>
+ </leafNode>
+ </children>
+ </node>
+</interfaceDefinition>