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

Get statistic on my LAN and HBA card

SOLVED
Go to solution
Sebastien Masson
Valued Contributor

Get statistic on my LAN and HBA card

Hi,

Someone know an ascii, not interactive tool (not Glance or LanAdmin) to grab statistic on LAN card and HBA. Something like:

How much packet I/O
How much Error I/O
How much Collision I/O

I want to know if my I/O card are busy or not.
5 REPLIES
Helen French
Honored Contributor

Re: Get statistic on my LAN and HBA card

Hi,

Try 'netstat' command. Check man pages for more information. This will list your network statistics
Life is a promise, fulfill it!
Paula J Frazer-Campbell
Honored Contributor

Re: Get statistic on my LAN and HBA card

Hi

From :-
http://www.introcomp.co.uk/examples/index.html

---------------cut here----------------
#!/usr/bin/sh

INTERFACE=lan1 # NIC to monitor
set -u

typeset -i OLD_PACKETS_IN=0
typeset -i OLD_PACKETS_OUT=0
typeset -i OLD_PACKETS_IN_ERR=0
typeset -i OLD_PACKETS_OUT_ERR=0
typeset -i OLD_COLLISSIONS=0
typeset -i IN_BOUND_ERRORS=0
typeset -i NEW_IN_BOUND_ERRORS=0
typeset -i OUT_BOUND_DISCARDS=0
typeset -i NEW_OUT_BOUND_DISCARDS=0

echo " This first entry in this file is the statistics since last boot:"
echo " the other entries are statistics for the previous minute:"

while [ 1=1 ] # Run Foreever
do

netstat -i | grep "$INTERFACE" | read NAME MTU NETWORK ADDRESS IPKTS IERRS OPKTS OERRS COLL

NEW_PACKETS_IN=$(( $IPKTS - $OLD_PACKETS_IN ))
OLD_PACKETS_IN=$IPKTS

NEW_PACKETS_OUT=$(( $OPKTS - $OLD_PACKETS_OUT ))
OLD_PACKETS_OUT=$OPKTS

NEW_PACKETS_IN_ERR=$(( $IERRS - $OLD_PACKETS_IN_ERR ))
OLD_PACKETS_IN_ERR=$IERRS

NEW_PACKETS_OUT_ERR=$(( $OERRS - $OLD_PACKETS_OUT_ERR ))
OLD_PACKETS_OUT_ERR=$OERRS

NEW_COLLISSIONS=$(( $COLL - $OLD_COLLISSIONS ))
OLD_COLLISSIONS=$COLL

# NEW_IN_BOUND_ERRORS=$(( $4 - $NEW_IN_BOUND_ERRORS ))
# OLD_BOUND_ERRORS=$4
#
# NEW_IN_BOUND_DISCARDS=$(( $3 - $NEW_IN_BOUND_DISCARDS ))
# OUR_BOUND_DISCARDS=$3


date
echo Packets in: $NEW_PACKETS_IN
echo Packet in Errors: $NEW_PACKETS_IN_ERR
echo Packet out: $NEW_PACKETS_OUT
echo Packetout Errors: $NEW_PACKETS_OUT_ERR
echo Collisions: $NEW_COLLISSIONS
echo IN Bound Errors: $NEW_IN_BOUND_ERRORS
echo OUT Bound DISCARDS: $NEW_OUT_BOUND_DISCARDS
echo
sleep 5

typeset -i HOUR=$(date +%H)
if [ $HOUR -eq 18 ]
then
exit
fi
done
#### END OF SCRIPT

---------------cut here------------

HTH

Paula

If you can spell SysAdmin then you is one - anon
Helen French
Honored Contributor

Re: Get statistic on my LAN and HBA card

Hi,

again, try 'sar' for I/O activities.

# sar -u 1 10
# sar -d 1 10
# sar -A 1 10

HTH,
Shiju
Life is a promise, fulfill it!
Vladislav Demidov
Honored Contributor
Solution

Re: Get statistic on my LAN and HBA card

Hello Sebastien,
You also can use lanadmin command and SNMP commands for remote monitoring.
Sebastien Masson
Valued Contributor

Re: Get statistic on my LAN and HBA card

Someone have the SNMP mib to collect information ?!