extract switch name generation into own script
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 11 Apr 2018 14:17:09 +0000 (16:17 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 11 Apr 2018 14:17:09 +0000 (16:17 +0200)
snmp-walk
sw-names [new file with mode: 0755]

index c1d157e..4a93344 100755 (executable)
--- a/snmp-walk
+++ b/snmp-walk
@@ -25,7 +25,7 @@ if [ ! -z "$1" ] ; then
 fi
 
 #( ls -d $log.last/* | sed 's/^.*\///' ; ./ips ) | sort -u | while read ip
-grep '^\[snmp;sw' /etc/munin/munin.conf | cut -d';' -f2 | sed 's/\]$//' | while read ip
+./sw-names | while read ip
 do
        echo "## $ip"
        snmp_walk $ip
diff --git a/sw-names b/sw-names
new file mode 100755 (executable)
index 0000000..479a2ea
--- /dev/null
+++ b/sw-names
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# we are extracting switch names from munin config
+
+grep '^\[snmp;sw' /etc/munin/munin.conf | cut -d';' -f2 | sed 's/\]$//'
+