Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/bin/bash
- . "/etc/CFG_FULL.cfg"
- cd $pwd/igmp.v2
- #nmap --excludefile $pwd/db_ip_exclude.txt -sn 192.168.212.0/22 | egrep -v "Host" | awk '{print $5}' > $pwd/db_ip_test.txt
- #nmap --excludefile $pwd/db_ip_agr_exclude.txt -sn 192.168.212.2-49 | egrep -v "Host" | awk '{print $5}' > $pwd/db_ip_agr.txt
- # Коммутаторы доступа
- while read ip
- do
- HW=$(/usr/local/bin/snmpget -v2c -c $CommunityRO $ip iso.3.6.1.2.1.16.19.3.0 | awk '{ print $4 }' | sed -e "s/\"//g")
- ################################################################################################################################
- if [ "$HW" = "C1" ]
- then
- PORT=$(/usr/local/bin/snmpwalk -v2c -c $CommunityRO $ip iso.3.6.1.2.1.17.1.2.0 | awk '{print $4}')
- if [ "$PORT" = "10" ]
- then
- COMD1="config limited_multicast_addr ports 1-8 add profile_id 1"
- COMD2="config max_mcast_group ports 1-8 max_group 4"
- COMD3="config limited_multicast_addr ports 1-8 access permit"
- $pwd/igmp.v2/comd_C1.sh "$ip" "$COMD1" "$COMD2" "$COMD3"
- elif [ "$PORT" = "28" ]
- then
- COMD1="config limited_multicast_addr ports 1-24 add profile_id 1"
- COMD2="config max_mcast_group ports 1-24 max_group 4"
- COMD3="config limited_multicast_addr ports 1-24 access permit"
- $pwd/igmp.v2/comd_C1.sh "$ip" "$COMD1" "$COMD2" "$COMD3"
- elif [ "$PORT" = "52" ]
- then
- COMD1="config limited_multicast_addr ports 1-48 add profile_id 1"
- COMD2="config max_mcast_group ports 1-48 max_group 4"
- COMD3="config limited_multicast_addr ports 1-48 access permit"
- $pwd/igmp.v2/comd_C1.sh "$ip" "$COMD1" "$COMD2" "$COMD3"
- else
- echo "$ip PORT XZ"
- fi
- else
- echo "$ip to $HW"
- fi
- ################################################################################################################################
- done < $pwd/db_ip_test.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement