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

Article: 100029891
Last Published: 2021-12-14
Ratings: 0 0
Product(s): InfoScale & Storage Foundation

Description

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).
 
One 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


One can use the NIC type on the command if only interested in a particular subset:

#kstat -phme:::link_up

hme:0:hme0:link_up      1

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

 
 

 

Was this content helpful?