I am having trouble getting a subagent to work.
I have attempted to follow the rules of support and first check alternative
sources.
I have been through the wiki and tutorials many times.
I hope this is not one of thoes cases where the answer is obvious and I have
complete overlooked it.
If that is the case then I am sorry.
Below is the process I used in detail.

0)
Tested the MIB with "snmptranslate".
It appeared to work fine.
I havent registered a number with IANA yet
so using 82 temporarily. Sorry "Auspex Systems, Inc".

1)
I inputted this line
env MIBS="+PS-TEST6-MIB" mib2c psTest6MIB

this was the response
OID: psTest6MIB
numeric translation 1.3.6.1.4.1.82
number of scalars within: 1

I choose Net-SNMP style code and to "tie interger values to integer scalars"

As expected is generated psTest6MIB.c and psTest6MIB.h


2)I then compile-subagent
net-snmp-config --compile-subagent psTest6MIB psTest6MIB.c
resulting in
"subagent program psTest6MIB created".


3)I start net-snmp
snmpd
Then I start the subagent
./psTest6MIB
All seems fine. No errors.


4)Testing
When using an SNMP manager connected to "localhost"
-Asking for the variable "1.3.6.1.2.1.1.1.0" does return the
"sysDescription". The SYSTEM tree does work.
-Asking for the variable "1.3.6.1.4.1.82.2" which belongs to the subagent,
returns null.
snmpget -v1 -c public localhost PS-TEST6-MIB::psTest6MIB
returns
"Eror In packet"
"Reason: (noSouchName) There is no such variable in this MIB"
"Failed object: PS-TEST6-MIB::psTest6MIB"

snmpget -v2c -c public localhost PS-TEST6-MIB::psTest6MIB
returns
"No Such Object available on this agent at this OID"

snmpgetnext -v1 -c public localhost PS-TEST6-MIB::versionTag
returns
"Unknown Object Idenfitier"

snmpwalk -v1 -c public localhost PS-TEST6-MIB:psTest6MIB
returns
"End Of MIB"

snmpwalk -v2c -c public localhost PS-TEST6-MIB::psTest6MIB
returns
"No more variables left in this MIB View(Is is past the end of the MIB
tree)"

Using
"snmpd -DpsTest6MIB" to start the agent
returns some errors
/usr/local/share/snmp/snmp.conf: line 15: Warning: Unknown token:
agentAddress.
/usr/local/share/snmp/snmp.conf: line 45: Warning: Unknown token: view.
/usr/local/share/snmp/snmp.conf: line 46: Warning: Unknown token: view.
/usr/local/share/snmp/snmp.conf: line 51: Warning: Unknown token:
rocommunity.
/usr/local/share/snmp/snmp.conf: line 60: Warning: Unknown token: rouser.
/usr/local/share/snmp/snmp.conf: line 77: Warning: Unknown token:
sysLocation.
/usr/local/share/snmp/snmp.conf: line 78: Warning: Unknown token:
sysContact.
/usr/local/share/snmp/snmp.conf: line 80: Warning: Unknown token:
sysServices.
/usr/local/share/snmp/snmp.conf: line 87: Warning: Unknown token: proc.
/usr/local/share/snmp/snmp.conf: line 89: Warning: Unknown token: proc.
/usr/local/share/snmp/snmp.conf: line 91: Warning: Unknown token: proc.
/usr/local/share/snmp/snmp.conf: line 101: Warning: Unknown token: disk.
/usr/local/share/snmp/snmp.conf: line 102: Warning: Unknown token: disk.
/usr/local/share/snmp/snmp.conf: line 103: Warning: Unknown token:
includeAllDisks.
/usr/local/share/snmp/snmp.conf: line 113: Warning: Unknown token: load.
/usr/local/share/snmp/snmp.conf: line 126: Warning: Unknown token: trapsink.
/usr/local/share/snmp/snmp.conf: line 140: Warning: Unknown token:
iquerySecName.
/usr/local/share/snmp/snmp.conf: line 141: Warning: Unknown token: rouser.
/usr/local/share/snmp/snmp.conf: line 143: Warning: Unknown token:
defaultMonitors.
/usr/local/share/snmp/snmp.conf: line 145: Warning: Unknown token:
linkUpDownNotifications.
/usr/local/share/snmp/snmp.conf: line 157: Warning: Unknown token: extend.
/usr/local/share/snmp/snmp.conf: line 158: Warning: Unknown token:
extend-sh.
/usr/local/share/snmp/snmp.conf: line 190: Warning: Unknown token: master.

5)Confirgation
I added
rocommunity public 192.168.1.0/16
to the configuration. after that didn't worked I also added the following
lines
com2sec readonly default public
com2sec readwrite default private
That still didnt work

I also made sure that
master agentx
was uncommented in snmpd.conf


6)Appendicies
Received SNMP packet(s) from UDP: [192.168.1.146]:162->[192.168.1.147]
  GET message
    -- DISMAN-EVENT-MIB::sysUpTimeInstance

Sending 43 bytes to UDP: [192.168.1.146]:162->[192.168.1.147]
0000: 30 29 02 01  00 04 06 70  75 62 6C 69  63 A2 1C 02    0).....public...
0016: 02 02 A2 02  01 00 02 01  00 30 10 30  0E 06 08 2B    .........0.0...+
0032: 06 01 02 01  01 03 00 43  02 37 DA                    .......C.7.


Received 41 bytes from UDP: [192.168.1.146]:162->[192.168.1.147]
0000: 30 27 02 01  00 04 06 70  75 62 6C 69  63 A0 1A 02    0'.....public...
0016: 02 02 A3 02  01 00 02 01  00 30 0E 30  0C 06 08 2B    .........0.0...+
0032: 06 01 04 01  52 02 00 05  00                          ....R....

Received SNMP packet(s) from UDP: [192.168.1.146]:162->[192.168.1.147]
  GET message
    -- SNMPv2-SMI::enterprises.82.2.0

Sending 41 bytes to UDP: [192.168.1.146]:162->[192.168.1.147]
0000: 30 27 02 01  00 04 06 70  75 62 6C 69  63 A2 1A 02    0'.....public...
0016: 02 02 A3 02  01 02 02 01  01 30 0E 30  0C 06 08 2B    .........0.0...+
0032: 06 01 04 01  52 02 00 05  00                          ....R....




PS-TEST6-MIB DEFINITIONS ::= BEGIN
IMPORTS
    OBJECT-TYPE, NOTIFICATION-TYPE, MODULE-IDENTITY,
    Integer32, Opaque, enterprises, Counter32
        FROM SNMPv2-SMI

psTest6MIB MODULE-IDENTITY
    LAST-UPDATED "9912090000Z"
    ORGANIZATION "Organization name goes here"
    CONTACT-INFO "Contact info goes here"
    DESCRIPTION "Attempt number 6 to get sub agents working"
    ::= { enterprises 82 }

psRandomValue OBJECT-TYPE
    SYNTAX Integer32 (0..2147483647)
    MAX-ACCESS read-write
    STATUS current
    DESCRIPTION "This is a random interger"
    ::= { psTest6MIB 2 }

END

Thank you for your time,
>From Scott C.
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
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

Reply via email to