document solution
[dell-switch] / README
1 ./ips | xargs -i ./dell-switch.pl {} "show bridge address"
2
3 ./ips | xargs -i ./dell-switch.pl {} "show interfaces status"
4
5 ./ips | xargs -i ./dell-switch.pl {} "show running-config"
6
7 This will save all commands executed to git repository under log/
8
9 However, somethimes you just need to execute few commands but don't want
10 log output (if configuring switches in batch, for example). You can do
11 that by setting NO_LOG enviroment variable like this:
12
13 grep -A 1 sw-lib /etc/munin/munin.conf | grep 10.20 | awk '{ print $2 }' \
14 | NO_LOG=1 xargs -i ./dell-switch.pl 'snmp-server community public-or-not ro view Default' 'exit' 'copy running-config startup-config'
15
16
17 To use fans script first pull show system from all switches:
18
19 ./ips | xargs -i ./dell-switch.pl {} "show system"
20
21
22 Backup switch configuration to tftp server:
23
24 ./ips 1,2 | awk '{ print "./dell-switch.pl "$1" \"copy startup-config tftp://10.20.0.253/backups/"$2".config\"" }' | NO_LOG=1 sh -x
25
26
27 To use snmp* utils, create snmp.conf with:
28
29 COMMUNITY=my-comminity-or-public
30
31
32 # Find mac address on network
33
34 collect all mac addresses using snmp
35
36 dpavlin@black:~/dell-switch$ ./sw-mac-port.sh 
37
38 find interesting mac
39
40 dpavlin@black:~/dell-switch$ ./find-port-for-mac 00:1e:8c:0a:49:3c # eeepy eth0
41 sw-e300 1 00:1e:8c:0a:49:3c 23
42 sw-e300-2 1 00:1e:8c:0a:49:3c 21
43 # mac 00:1e:8c:0a:49:3c on 41 switches
44
45 dpavlin@black:~/dell-switch$ ./find-port-for-mac 00:80:c8:37:6d:76 # eeepy eth3
46 sw-e300 1 00:80:c8:37:6d:76 17
47 # mac 00:80:c8:37:6d:76 on 41 switches
48