Using kstat for ce interfaces

Since I don’t seem to remember the kstat options for checking the link status of a ce interface, I’m putting it here.

  # kstat -p ce:::link_up

will produce

  ce:0:ce0:link_up        0
  ce:1:ce1:link_up        1
  ce:2:ce2:link_up        1
  ce:3:ce3:link_up        0
  ce:4:ce4:link_up        0
  ce:5:ce5:link_up        0

It can even do regular expressions, so you can do something like this to see your speed, duplex and link status:

  # kstat -p 'ce:0::/link_(speed|up|duplex)/'
  ce:0:ce0:link_duplex    2
  ce:0:ce0:link_speed     100
  ce:0:ce0:link_up        0

Tuesday January 4, 2005   ·   Permalink