How to monitor the physical interface of a Network Card using Solaris kstat

Article:TECH55679  |  Created: 2008-01-04  |  Updated: 2008-01-04  |  Article URL http://www.symantec.com/docs/TECH55679
Article Type
Technical Solution

Product(s)

Environment

Issue



How to monitor the physical interface of a Network Card using Solaris kstat

Solution



Solaris records quite a bit of kernel information. Much of this is available using the kstat facility.
One of things it keeps track of is the physical link status.
When used, it returns a Boolean value with 1 being true(online).

You can see the link status of any NIC (plumbed or unplumbed) with the following command:
# kstat -p :::link_up

hme:0:hme0:link_up      1
qfe:0:qfe0:link_up      0
qfe:1:qfe1:link_up      0
qfe:2:qfe2:link_up      0
qfe:3:qfe3:link_up      0


You can use the NIC type on the command if you are only interested in a particular subset:
#kstat -p hme:::link_up

hme:0:hme0:link_up      1

You can monitor the status of the link every 10 seconds with the following script:
===
#!/bin/sh
while true
do
kstat -p ce:::link_up >> /tmp/linkstats
date >> /tmp/linkstats
sleep 10
done
===
.





Legacy ID



294340


Article URL http://www.symantec.com/docs/TECH55679


Terms of use for this information are found in Legal Notices