Operating System - HP-UX
1833780 Members
2769 Online
110063 Solutions
New Discussion

Operational state of lan in HP-UX 11 without using lanadmin?

 
SOLVED
Go to solution
Christian Ching
Occasional Advisor

Operational state of lan in HP-UX 11 without using lanadmin?

Hi,

Is there a way of discovering the operational state of a lan card without using lanadmin? It was possible to achieve this using lanscan in 10.20, but lanscan has changed in 11.

Thanks!

Christian
9 REPLIES 9
unixdaddy
Trusted Contributor

Re: Operational state of lan in HP-UX 11 without using lanadmin?

When I issue Lanscan I get this:-

lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
10/12/6 0x080009AD0423 0 UP lan0 snap0 1 ETHER Yes 119

Which is the same as in 10.20 and it tells me the state of the lan card. Is this what your after?
Christian Ching
Occasional Advisor

Re: Operational state of lan in HP-UX 11 without using lanadmin?

Hi,
from what I understand, there are three states, software, hardware and operational. The operational state determines whether the network is working correctly, so it should show 'UP' when, say the network cable is plugged in, and 'DOWN' when it is unplugged. This works in lanadmin, and lanscan in 10.20, but I'd like to have an alternative to lanadmin, or a command line which shows that information.

Thanks,

Christian
Marcel Boon
Trusted Contributor

Re: Operational state of lan in HP-UX 11 without using lanadmin?

Hi,

Try command: netstat.
see the manual pages.

Marcel
See the man pages
Christian Ching
Occasional Advisor

Re: Operational state of lan in HP-UX 11 without using lanadmin?

Thanks,
I have already tried this using
netstat -I lan0 ,
but somehow this gives inconsistent results, and takes a long time before it shows the operational state is down. It will come up with lan0* but it doesn't always seem to do this. My problem is that I currently have issues using lanadmin which are waiting to be addressed, and in the meantime would like something that can be used in a script and show the operational state, so netstat wouldn't be appropriate as it takes too long, say if I have a lot of lan cards on the system.

Thanks!

Chris
Wodisch
Honored Contributor
Solution

Re: Operational state of lan in HP-UX 11 without using lanadmin?

Hello Christian,

you could ask the local SNMP agent (snmpdm) to tell
you about that. Get some "snmpget" or "snmpwalk"
commands from the internet (UCD, perhaps) and have
a look on the MIB variables below
.iso.org.dod.internet.mgmt.mib2.interfaces
There you will find "adminStatus" and "operStatus" for
each interface you have and you do not have to be
"root" to run those commands.
HTH,
Wodisch
Dyi-Wu Liu_1
Occasional Advisor

Re: Operational state of lan in HP-UX 11 without using lanadmin?

Hi :
Please try this script, hope this can help.
--
Best Regards,
Dyi-Wu Liu

ldw@hputaiv$ cat lanstat.cmd
#! /usr/bin/sh
/usr/bin/uname -a
/usr/sbin/lanscan
ppas="0 1"
for ppa in $ppas
do
stat=`/usr/sbin/lanadmin 2>/dev/null <l
ppa $ppa
d
q

EOF
`
echo $ppa --- $stat
done

Here is sample output :
ldw@hputaiv$ ./lanstat.cmd
HP-UX hputaiv B.11.00 U 9000/800 77177 unlimited-user license
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
5/1/0 0x0060B0B26418 1 UP lan1 snap1 1 ETHER Yes 119
5/0/0 0x0060B0B26433 0 UP lan0 snap0 2 ETHER Yes 119
0 --- Operation Status (value) = up(1)
1 --- Operation Status (value) = up(1)
loves discipline loves knowledge
Ajitkumar Rane
Trusted Contributor

Re: Operational state of lan in HP-UX 11 without using lanadmin?

How about "ifconfig interface name",I'd do a lanscan to find the number of lan interfaces on the system and then ifconfig to get the interface state.

Amidsts difficulties lie opportunities
Robert Landstrum
Occasional Advisor

Re: Operational state of lan in HP-UX 11 without using lanadmin?

lanscan will show you the software state, if the card is configured. ifconfig will show you the hardware state, if the card is UP, ifcongig will show you. If the the card is not up, ifconfig will not show you a DOWN, it will just not show UP.
If I thought the answer was easy, I would have called HP.
Christian Ching
Occasional Advisor

Re: Operational state of lan in HP-UX 11 without using lanadmin?

Thanks for the help, especially Wodisch and Dyi-Wu. I think its very easy to get confused between hardware, software and operational state!!

Christian