non-root user checking NIC speed/duplex

From: lance.tost@respironics.com
Date: Wed Sep 17 2003 - 14:13:11 EDT


I've searched sunsolve, bigadmin, etc but haven't found an answer to this.
I'd like a script to run as a *non-root* user to query all network
interfaces and report their actual speed/duplex.

Here's what I've learned so far:
* ce - easy. Use kstat.
* hme - It seems I can get speed via kstat, and maybe duplex but I
couldn't seem to kick mine into hdx so I wasn't sure. I find it odd
though that kstat reports 0 for duplex while ndd reports 1 (for fdx). Is
it safe to assume, kstat will report 1 for hdx?
* ge - I see ifspeed in kstat, but no duplex
* dmfe - ifspeed is in kstat, but no duplex
* eri - ifspeed is in kstat, but no duplex

I know I can get this stuff with ndd, but I'd really like to run this
script as a non-root user (it's tied into our big brother monitoring).
Besides setting up sudo to allow this user to run ndd, does anyone have
another solution?

Thanks

PS. If anyone is interested in the script, I'll probably put it on
deadcat.net when I feel it's mostly completed. Right now, I need to
figure out the best way to specify when 10hdx is "ok" so it doesn't get
flagged as red.

-- 
Lance Tost, Systems Engineer
lance.tost@respironics.com
========================================================================
CONFIDENTIALITY NOTICE
----------------------
This message, together with any attachments, may be legally privileged
and is confidential information intended only for the use of the
individual or entity to which it is addressed.  It is exempt from
disclosure under applicable law including court orders.  If you are not
the intended recipient, you are hereby notified that any use,
dissemination, distribution or copy of this message, or any attachment,
is strictly prohibited.  If you have received this message in error,
please notify the original sender and delete this message, along with
any attachments, from your computer.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:27:08 EDT