summaryrefslogtreecommitdiff
path: root/scripts/vyatta-monitor
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/vyatta-monitor')
-rwxr-xr-xscripts/vyatta-monitor7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/vyatta-monitor b/scripts/vyatta-monitor
new file mode 100755
index 0000000..22867e8
--- /dev/null
+++ b/scripts/vyatta-monitor
@@ -0,0 +1,7 @@
+#!/bin/bash
+declare awkmatch="$2"
+for i in "${@:3}"; do
+ awkmatch+="|$i"
+done
+tail -f /var/log/messages \
+ | awk "/$awkmatch/{ \$5=\" $1:\"; for (f=5; f<=NF; ++f) {printf(\"%s \", \$f);}; printf(\"\n\") }"