msgbartop
Tips and Tricks site for advanced HP-UX Engineers
msgbarbottom

15 Aug 19 APA network pairings: How to find out fast what they are

Script for detecting APA network bonded pairs. It is already built into the cinam21t drd image. It will save you 3-5 hours of guess work on future builds.

Networking was changed to protect the innocent.

Here is an example:

[root@cinam21t]:/home/root # ./apanetwork_discover 142.18.1.26 142.18.1.96 ——————————————————— -This script figures out which NIC cards are APA paired.- -It has two inputs:……………………………….- -1- The assigned IP address of the APA Group lan90#…..-
-2- The known network address of an HP-UX server on net.- -ex ./apanetwork_discover 142.18.1.26 142.18.1.96 ……-
– These are cinam21t and stlam31t…………………..-
– The system must be OFF network for this to work ……-
– Instruction: …………………………………..-
– /sbin/init.d/net stop …………………………..-
– /sbin/init.d/vlan stop ………………………….-
– /sbin/init.d/hplm stop ………………………….-
– /sbin/init.d/hpapa stop (You may need to ctrl-break…-
– netstat -rn (ifconfig lan# down then unplumb any lans.-
– Wash,rinse and repeat for lan901,lan902,lan903 …….-
———————————————————
The LAN is lan0 Success lan0 as 142.18.1.26 was able to ping 142.18.1.96 The LAN is lan8 NO JOY lan8 as 142.18.1.26 was able NOT to ping 142.18.1.96
The LAN is lan16 NO JOY lan16 as 142.18.1.26 was able NOT to ping 142.18.1.96
The LAN is lan19 NO JOY lan19 as 142.18.1.26 was able NOT to ping 142.18.1.96
The LAN is lan2 NO JOY lan2 as 142.18.1.26 was able NOT to ping 142.18.1.96
The LAN is lan49 NO JOY lan49 as 142.18.1.26 was able NOT to ping 142.18.1.96
The LAN is lan52 NO JOY lan52 as 142.18.1.26 was able NOT to ping 142.18.1.96
The LAN is lan56 Success lan56 as 142.18.1.26 was able to ping 142.18.1.96 [root@cinam21t]:/home/root #

In this case lan0 are in the bonded pair (lan900)

Take a nwmgr output before bringing network down. Run from console only

Here is the script code

/root/build # cat apanetwork_discover

!/bin/ksh

#
echo “———————————————————“
echo “-This script figures out which NIC cards are APA paired.-“
echo “-It has two inputs:……………………………….-“
echo “-1- The assigned IP address of the APA Group lan90#…..-“
echo “-2- The known network address of an HP-UX server on net.-“
echo “-ex ./apanetwork_discover 172.19.1.26 172.19.1.96 ……-“
echo “- These are stlam34t and stlam31t…………………..-“
echo “- The system must be OFF network for this to work ……-“
echo “- Instruction: …………………………………..-“
echo “- /sbin/init.d/net stop …………………………..-“
echo “- /sbin/init.d/vlan stop ………………………….-“
echo “- /sbin/init.d/hplm stop ………………………….-“
echo “- /sbin/init.d/hpapa stop (You may need to ctrl-break…-“
echo “- netstat -rn (ifconfig lan# down then unplumb any lans.-“
echo “- Wash,rinse and repeat for lan901,lan902,lan903 …….-“
echo “———————————————————“
IP2=$2
IPADDY=$1

nwmgr | awk ‘!/hp_apa/{ printf “%s %s\n”, $1,$2 }’ | awk ‘/UP/{print $1}’ | while read -r LN
do

 sleep 1
 echo "The LAN is ${LN}"
 ifconfig ${LN} ${IPADDY} netmask 255.255.255.0 up > /dev/null
 ping ${IP2} -n 1 -m 5 > /dev/null
 rc=$?
 if [ $rc -eq 0 ]
 then
   echo "Success $LN as $IPADDY was able to ping $IP2"
 else
   echo "NO JOY $LN as $IPADDY was able NOT to ping $IP2"
 fi
 ifconfig ${LN} down
 ifconfig ${LN} unplumb

done

Leave a Comment

You must be logged in to post a comment.

Supportscreen tag
WhatsApp chat