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

Problem

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
===
.



Terms of use for this information are found in Legal Notices.

Search

Survey

Did this article answer your question or resolve your issue?

No
Yes

Did this article save you the trouble of contacting technical support?

No
Yes

How can we make this article more helpful?

Email Address (Optional)