I'm working in conjuction with Dave Shield on the concept of creating a common store of code for a Hardware Abstration Layer for net-snmp. This will resolve (hopefully) the problem of having two or more sets of code doing the same thing (often using different/conflicting methods). This relates specifically to the HOST-RESOURCES-MIB and UCD-SNMP-MIB but possibly others as well.
What I feel is needed is to decide what is worth accessing and storing, then the best method for doing so. This method needs to be efficient, easy to maintain and not so bloated that it affects system performance (which is the reason I had to drop Sun's various daemons in the first place). Sun has provided (but failed to document) a facility for retrieving a great deal of information - kstat. You can see its output by typing "netstat -k" or using the kstat script (Solaris 8 and later). There are other API's as well - some undocumented and unsupported. Here is a top-level view of what we may be interested in: Network Memory Swap Disk CPU Other (eg. fans, CPU temperatures, warning lights) Translation: HRM -> HOST-RESOURCES-MIB, UCD -> UCD-SNMP-MIB or UCD-DISKIO-MIB Network: Material relating to TCP/IP etc. is at a higher layer than we are interested in and best left to others. The material of interest at the hardware layer, eg. speed, number of packets, is delivered by kstat. Memory: HRM uses kstat to get freemem (hr_storage.h) HRM uses (what?) to get physmem UCD uses kstat to get physmem the bunyip module (part of the RMCmem package) allows delivery of more information through kstat (how?) but we have no MIB that needs it Swap: HRM uses swapctl - this is Bad News (it breaks other things) UCD uses kstat - is this sufficiently informative? Why doesn't it match swap -s? Disk: We need to distinguish between "disk", "partition" and "file system" UCD uses statvfs to get information UCD uses kstat to get disks for IO stats are in vp->magic (see sys/diskio.h) HRM uses mnttab as its list of valid partitions - this is very Bad News as many partitions aren't mounted eg. swap, meta, Solstice, Veritas - then parses through the raster of all possible disks and partitions (inefficient). Does not take into account wierd layouts like /dev/rdsk/c14t5d12s4 eg. on a CD jukebox or SAN/NAS. CPU - kstat Other - not currently available as Sun does not publish the API's for the appropriate libraries These could be salvaged using /usr/platform/whatever/prtdiag -v but I'm loathe to do this except as last resort. It would be hard on resources and very messy. In terms of priority I'm thinking something along these lines: 1. Swap. Get rid of swapctl. Sort out what is good deliverables from kstat. 2. Disk. Sort out the mess in HRM or replace with code from UCD or preferably joint code. 3. Memory. Sort out what is meant by physmem. There's other deliverables from bunyip. Use them? 4. Other How does this sound? This communication is intended for the use of the recipient to which it is addressed, and may contain confidential, personal and or privileged information. Please contact us immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communication received in error, or subsequent reply, should be deleted or destroyed. ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders