diff options
Diffstat (limited to 'scripts/vyatta-monitor')
-rwxr-xr-x | scripts/vyatta-monitor | 7 |
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\") }" |