Operating System - HP-UX
1825756 Members
2297 Online
109687 Solutions
New Discussion

Re: How can i get the status of each interface

 
wangshirun
New Member

How can i get the status of each interface

Hi,
I made a network interface bonding with APA(Auto Port Aggregation),for example :lan0 lan1 -->lan900,now i want to get the status(active,backup,down) of lan0 and lan1 by programing,can anybody give me some suggestions? or show me some "apa" functions .

thank you!


Ringle
3 REPLIES 3
mobidyc
Trusted Contributor

Re: How can i get the status of each interface

Hello,

lanscan can give your some informations:
# lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
10/12/6 0x080009B19B60 12 UP lan0 snap0 11 ETHER Yes 119
LinkAgg0 0x0010830497D5 900 UP lan900 snap900 14 ETHER Yes 119
LinkAgg1 0x0060B0770028 901 UP lan901 snap901 15 ETHER Yes 119
LinkAgg2 0x000000000000 902 DOWN lan902 snap902 16 ETHER Yes 119
LinkAgg3 0x000000000000 903 DOWN lan903 snap903 17 ETHER Yes 119
LinkAgg4 0x000000000000 904 DOWN lan904 snap904 18 ETHER Yes 119

you can also us lanadmin with your PPA:
# lanadmin -g 900
# lanadmin -x -i 905

you can search for:
apa "support guide"
http://docs.hp.com for more informations.

Regards,
Cedrick Gaillard
Best regards, Cedrick Gaillard
wangshirun
New Member

Re: How can i get the status of each interface

Thank you very for your reply. But what i needed is by programing.because our programs need the status of interfaces,so it must call some apa function to do this ,now which function is ,I really don't know .Can anybody tell me ?
mobidyc
Trusted Contributor

Re: How can i get the status of each interface

what problem with programming?

---<-----
#! /bin/ksh
for PPA in $(lanscan |egrep -v "^Hardware|^Path" |awk '{print $3}')
do
printf " lan$PPA: "
lanadmin -x $PPA 2>/dev/null | \
while read line
do
printf "$line "
done
printf "\n"
done
---<-----

this script is not complete, i wrote it very quickly for colleagues that don't know other unix than solaris...

Regards,
Cedrick Gaillard
Best regards, Cedrick Gaillard