Operating System - Linux
1751770 Members
4636 Online
108781 Solutions
New Discussion юеВ

number of physical network cards on the hpux server

 
SOLVED
Go to solution
Shivkumar
Super Advisor

number of physical network cards on the hpux server

i want to count actual physical network cards on the hpux server. I mean i don't want to count virtual network interfaces. Just need to count actual physical one.

can anyone suggest me command for the same ?
17 REPLIES 17
James R. Ferguson
Acclaimed Contributor
Solution

Re: number of physical network cards on the hpux server

Hi:

My first choice would be to do:

# ioscan -kC lan

...and if you simply want the count of LAN cards:

# ioscan -lc lan||grep -c lan

Regards!

...JRF...
Mel Burslan
Honored Contributor

Re: number of physical network cards on the hpux server

ioscan -fnC lan | grep ^lan | wc -l

this gives you the number of network interfaces on your system. usually, lan0 is located on the system mainboard (there are exceptions to this rule rp4440 being one of them) so, if you subtract one from the obtained value, you can see your addtional network interfaces.

Also another caveat to the calculation above, the are dual or quad network cards, which means two or four network ports come on a single PCI card. In which case the number of cards and number of ports may not be one-to-one.

There is no straight correlation between the card count and the port count to make this calculation simple. Also, server type as in the case of rp4440/rx4440 goes, makes a difference on the card count.

Best bet is to know the server type and running a

ioscan -fnC lan

command and manually analyzing the output.

Hardware paths, if you look at their numerical representation, will tell you if you have a dual or quad network adapter cards.

For instance, on this system

# ioscan -fknC lan
Class I H/W Path Driver S/W State H/W Type Description
=========================================================================
lan 0 0/0/0/0 btlan CLAIMED INTERFACE HP PCI 10/100Base-TX Core
/dev/diag/lan0 /dev/ether0 /dev/lan0
lan 2 0/5/0/0/4/0 btlan CLAIMED INTERFACE HP A5506A PCI 10/100Base-TX 4 Port
/dev/diag/lan2 /dev/ether2 /dev/lan2
lan 3 0/5/0/0/5/0 btlan CLAIMED INTERFACE HP A5506A PCI 10/100Base-TX 4 Port
/dev/diag/lan3 /dev/ether3 /dev/lan3
lan 4 0/5/0/0/6/0 btlan CLAIMED INTERFACE HP A5506A PCI 10/100Base-TX 4 Port
/dev/diag/lan4 /dev/ether4 /dev/lan4
lan 5 0/5/0/0/7/0 btlan CLAIMED INTERFACE HP A5506A PCI 10/100Base-TX 4 Port
/dev/diag/lan5 /dev/ether5 /dev/lan5
lan 9 1/12/0/0/4/0 btlan CLAIMED INTERFACE HP A5506A PCI 10/100Base-TX 4 Port
/dev/diag/lan9 /dev/ether9 /dev/lan9
lan 10 1/12/0/0/5/0 btlan CLAIMED INTERFACE HP A5506A PCI 10/100Base-TX 4 Port
/dev/diag/lan10 /dev/ether10 /dev/lan10
lan 11 1/12/0/0/6/0 btlan CLAIMED INTERFACE HP A5506A PCI 10/100Base-TX 4 Port
/dev/diag/lan11 /dev/ether11 /dev/lan11
lan 12 1/12/0/0/7/0 btlan CLAIMED INTERFACE HP A5506A PCI 10/100Base-TX 4 Port
/dev/diag/lan12 /dev/ether12 /dev/lan12

lan0 is built in lan and has a different path than the others.

lan2 thru lan5 as you can see is placed on the same h/w path, which tells you this is a quad card. And same can be said for the lan9 thru lan12.

This is how you get to calculate them.

Hope it helps
________________________________
UNIX because I majored in cryptology...
Geoff Wild
Honored Contributor

Re: number of physical network cards on the hpux server

Try this script:

# cat /usr/local/bin/lancards

#!/usr/bin/sh
# script to check speed and settings of lan cards
PATH=/usr/sbin:/usr/bin
ppas=`lanscan | awk '$3~/^[0-9]$/{print $3}' | xargs`
for i in $ppas
do
printf "Card at PPA %s - " $i
ipa=`ifconfig lan${i} 2>/dev/null | awk '{ip=$2}END{if(ip==""){printf("Not assigned")}else{printf("%s ",ip)}}'`
printf "IP Address: %15s- " "$ipa"
lanadmin -x $i 2>/dev/null | awk '{$1="";printf("%s",$0)}'
echo ""
done



Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Arunvijai_4
Honored Contributor

Re: number of physical network cards on the hpux server

Shiv, You can use SAM to get to know how many network cards installed on your HP-UX server,

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Shivkumar
Super Advisor

Re: number of physical network cards on the hpux server

Is there a way to find out whether a particular "nic" has been configured for the backup purpose specifically ?

Regards,
Shiv
Steven E. Protter
Exalted Contributor

Re: number of physical network cards on the hpux server

Shalom again,

The primary network card is part of network configuration. You should be able to id it in /etc/rc.config.d/netconf

That's where I'd look.

I remember seeing the ability to designate a primary NIC in the Ignire install interface, perhaps that is what you refer to?

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Arunvijai_4
Honored Contributor

Re: number of physical network cards on the hpux server

Shiv, As Steve specified take a look at /etc/rc.config.d/netconf for all network configuration related information. Also, you can use #ifconfig -a to get all information.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Joseph Loo
Honored Contributor

Re: number of physical network cards on the hpux server

hi,

"lanscan" command will also tell u the number of network cards.

"netstat -in" will tell u the state of the cards.

regards.
what you do not see does not mean you should not believe
rick jones
Honored Contributor

Re: number of physical network cards on the hpux server

The difference between lanscan and ioscan includes:

*) lanscan will show APA aggregates

*) ioscan will show cards not claimed by a driver

FWIW, the being able to grep for "lan" may not be a 100% thing - third party devices _may_ not appear as "lan" devices in ioscan output. However, 99 times out of 10 grepping for lan is sufficient.
there is no rest for the wicked yet the virtuous have no pillows