Hi Folks,
I would like to extend net-snmp to use some perl scripts producing output in a
tabular format like so :-
[EMAIL PROTECTED] $ /usr/local/bin/prstatByZone
zone1 487 230 2.8 0.3
global 596 155 1.8 0.3
zone2 9395 7583 95 0.2
zone3 87 15 0.2 0.0
column headers are ZoneName, VirtMemSize, ResMemSize, MemPercent, CpuPercent
(fairly obviously derived from solaris prstat -Z)
Ideally I want my snmp agent (in my case the Sun SMA Agent - net-snmp v5.0.9)
to exec
this script when polled and return the values in a tabular format (similar to
the load average table OID
.1.3.6.1.4.1.2021.10 ).
First thing I tried was adding this to my snmpd.conf :-
exec .1.3.6.1.4.1.9876.13.13.1 prstatByZoneTable /usr/local/bin/prstatByZone
not so good :-
-bash-3.00$ /usr/sfw/bin/snmpwalk -v2c -c secret sol10 .1.3.6.1.4.1.9876.13.13.1
SNMPv2-SMI::enterprises.9876.13.13.1.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.9876.13.13.1.2.1 = STRING: "prstatByZoneTable"
SNMPv2-SMI::enterprises.9876.13.13.1.3.1 = STRING: "/usr/local/bin/prstatByZone"
SNMPv2-SMI::enterprises.9876.13.13.1.100.1 = INTEGER: 0
SNMPv2-SMI::enterprises.9876.13.13.1.101.1 = STRING: "global 598 155 1.8 0.3 "
SNMPv2-SMI::enterprises.9876.13.13.1.101.2 = STRING: "zone2 9395 7583 95 0.2 "
SNMPv2-SMI::enterprises.9876.13.13.1.101.3 = STRING: "zone1 492 234 2.8 0.1 "
SNMPv2-SMI::enterprises.9876.13.13.1.101.4 = STRING: "zone3 87 15 0.2 0.0 "
SNMPv2-SMI::enterprises.9876.13.13.1.102.1 = INTEGER: 0
Ideally i wanted something like the laTable (output converted to what i would
like to see):-
UCD-SNMP-MIB::zIndex.1 = INTEGER: 1
UCD-SNMP-MIB::zIndex.2 = INTEGER: 2
UCD-SNMP-MIB::zIndex.3 = INTEGER: 3
UCD-SNMP-MIB::zIndex.4 = INTEGER: 4
UCD-SNMP-MIB::zName.1 = STRING: global
UCD-SNMP-MIB::zName.2 = STRING: zone2
UCD-SNMP-MIB::zName.3 = STRING: zone1
UCD-SNMP-MIB::zName.4 = STRING: zone3
UCD-SNMP-MIB::zVmSize.1 = INTEGER: 598
UCD-SNMP-MIB::zVmSize.2 = INTEGER: 9395
UCD-SNMP-MIB::zVmSize.3 = INTEGER: 492
UCD-SNMP-MIB::zVmSize.4 = INTEGER: 87
UCD-SNMP-MIB::zResSize.1 = INTEGER: 155
UCD-SNMP-MIB::zResSize.2 = INTEGER: 7583
UCD-SNMP-MIB::zResSize.3 = INTEGER: 234
UCD-SNMP-MIB::zResSize.4 = INTEGER: 15
UCD-SNMP-MIB::zMemPct.1 = Opaque: Float: 1.8
UCD-SNMP-MIB::zMemPct.2 = Opaque: Float: 95
UCD-SNMP-MIB::zMemPct.3 = Opaque: Float: 2.8
UCD-SNMP-MIB::zMemPct.4 = Opaque: Float: 0.2
UCD-SNMP-MIB::zCpuPct.1 = Opaque: Float: 0.3
UCD-SNMP-MIB::zCpuPct.2 = Opaque: Float: 0.2
UCD-SNMP-MIB::zCpuPct.3 = Opaque: Float: 0.1
UCD-SNMP-MIB::zCpuPct.4 = Opaque: Float: 0.0
Now I am looking at creating an SMA module, and have gotten as far
as writing my mib and trying to create headers with mib2c (but having
issues at this stage).
Is there a simple way to achieve my objective with arbitrary extension commands
in the snmpd.conf?
Thanks
Repudi8or
_________________________________________________________________
It's simple! Sell your car for just $30 at CarPoint.com.au
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users