r2537 - also retrieve static MAC records for smaller Cisco switches
authorDenis Ovsienko <infrastation@yandex.ru>
Wed, 11 Mar 2009 13:39:39 +0000 (13:39 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 11 Mar 2009 13:39:39 +0000 (13:39 +0000)
gateways/switchvlans/cisco.connector

index d6198d86057762458a256603f9a337de8f738c87..b4860a7b7dc48e59c6e3962abbd75a21a29d497a 100755 (executable)
@@ -68,7 +68,7 @@ prepare_fetch_commands()
 {
        printf 'term len 0\nshow vlan brief\nquit\n' >> $CMDS1
        printf 'term len 0\nshow int status\nquit\n' >> $CMDS2
-       printf 'term len 0\nshow mac-address-table dynamic\nquit\n' >> $CMDS3
+       printf 'term len 0\nshow mac-address-table\nquit\n' >> $CMDS3
 }
 
 prepare_push_commands()
@@ -132,8 +132,8 @@ do_fetch()
        elif [ "$SW" = "Cisco+IOS+12.2" -o "$SW" = "Cisco+IOS+12.1" ]; then
                case "$HW" in
                        Cisco+Catalyst+35*|Cisco+Catalyst+37*|Cisco+Catalyst+29*)
-                               cat "$OUT3" | tr -d '\r' | fgrep DYNAMIC | \
-                               sed $SEDFLAG 's/ +([0-9]+) +(.+)    DYNAMIC +(.+)/\2=\1@\3/;s/FastEthernet/Fa/;s/GigabitEthernet/Gi/' > "$FILE3"
+                               cat "$OUT3" | tr -d '\r' | egrep 'STATIC|DYNAMIC' | \
+                               sed $SEDFLAG 's/ +([0-9]+|All) +(.+)    (DYNAMIC|STATIC) +(.+)/\2=\1@\4/;s/FastEthernet/Fa/;s/GigabitEthernet/Gi/' > "$FILE3"
                        ;;
                        Cisco+Catalyst+49*)
                                cat "$OUT3" | tr -d '\r' | fgrep dynamic | \