Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

how to get data for multiple PPA at once

achak01
Advisor

how to get data for multiple PPA at once

i have a automation task at hand. for that i have to run the following command lanadmin -g mibstats . Now how do i get data for a system with multiple PPA at once instead of having to run each time.
4 REPLIES
Prasanth V Aravind
Trusted Contributor

Re: how to get data for multiple PPA at once

for i in ` echo "0 1 2 3 4 5 " `
do
echo " lanadmin -g mibstats $i "
lanadmin -g mibstats $i
done



Gudluck
Prasanth
VK2COT
Honored Contributor

Re: how to get data for multiple PPA at once

Hello,

If you are using HP-UX 11.31, lanadmin(1M),
lanscan(1M) and linkloop(1M) commands
are getting obsolete (still available but
not meant to be used any more).

Instead of lanadmin, use this for example:

# nwmgr -g -c lan0 --st mib

*** lan0 64 bit MIB statistics:
Interface Name = lan0
PPA Number = 0
Description = lan0 HP PCI-X 1000Base-T Release B.11.31.1003
Interface Type = 1000Base-T
MTU Size = 1500
Speed = 100 Mbps
Station Address = 0x0014C265A5BA
Administration Status = UP
Operation Status = UP
Last Change = Mon May 17 09:04:12 2010
Inbound Octets = 8573870
Inbound Unicast Packets = 15985
Inbound Multicast Packets = 0
Inbound Broadcast Packets = 46299
Inbound Discards = 0
Inbound Errors = 0
Inbound Unknown Protocols = 211
Outbound Octets = 15486980
Outbound Unicast Packets = 67016
Outbound Multicast Packets = 5
Outbound Broadcast Packets = 132
Outbound Discards = 0
Outbound Errors = 0
Counter Discontinuity Time = Mon May 17 09:04:12 2010
Physical Promiscuous Mode = FALSE
Physical Connector Present = TRUE
Interface Alias =
Link Up/Down Trap Enable = Enabled

Or, if you want to get the report in a scriptable format, add option "--sc":

# nwmgr -g -c lan0 --st mib --sc
lan0#ifPPA#stats#0
lan0#ifDescr#stats#lan0 HP PCI-X 1000Base-T Release B.11.31.1003
lan0#ifType#stats#1000Base-T
lan0#ifMTU#stats#1500
lan0#ifSpeed#stats#100 Mbps
lan0#ifStationAddress#stats#0x0014C265A5BA
lan0#ifAdmin#stats#UP
lan0#ifOper#stats#UP
lan0#ifLastChange#stats#Mon May 17 09:04:12 2010
lan0#ifInOctets#stats#8580522
lan0#ifInUcastPkts#stats#16013
lan0#ifInMulticastPkts#stats#0
lan0#ifInBroadcastPkts#stats#46349
lan0#ifInDiscards#stats#0
lan0#ifInErrors#stats#0
lan0#ifInUnknownProtos#stats#211
lan0#ifOutOctets#stats#15491890
lan0#ifOutUcastPkts#stats#67051
lan0#ifOutMulticastPkts#stats#5
lan0#ifOutBroadcastPkts#stats#132
lan0#ifOutDiscards#stats#0
lan0#ifOutErrors#stats#0
lan0#ifCounterDiscontinuityTime#stats#Mon May 17 09:04:12 2010
lan0#ifPromiscuousMode#stats#FALSE
lan0#ifConnectorPresent#stats#TRUE
lan0#ifAlias#stats#
lan0#ifLinkUpDownTrapEnable#stats#Enabled

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Aneesh Mohan
Honored Contributor

Re: how to get data for multiple PPA at once

:)

for i in $(lanscan -p)
do
echo " Mibstats of LAN ID : $i"
lanadmin -g mibstats $i
done


Aneesh
Dennis Handly
Acclaimed Contributor

Re: how to get data for multiple PPA at once

>Prasanth: for i in ` echo "0 1 2 3 4 5 " `

You can do this much simpler:
for i in 0 1 2 3 4 5; do