[SNMP4J] AgenPro Read-Only Scalar Generation, Revisited

burblebee wildcard_seven at yahoo.com
Wed Feb 20 19:07:50 CET 2013


http://lists.agentpp.org/pipermail/snmp4j/2006-March/001162.html

I'm running up against the same issue as my friend above. By default, 
AgenPro does not want to generate a stub class with the get method for 
read-only scalars. The old email from above

says there will be an option to resolve this in the future (or now) 
without trying to manually modify the code generation template. I 
ASSUMED that setting the factoryScalars property

to "true" on the node below which my read-only scalars reside is that 
fix (I see now that's not what it does). But I'm having no luck. For this example project, the relevant part
 of the MIB is:

TOASTER-MIB DEFINITIONS ::= BEGIN

IMPORTS
        enterprises,
        MODULE-IDENTITY,
        OBJECT-TYPE,
        Integer32
                FROM SNMPv2-SMI
         OBJECT-GROUP
                FROM SNMPv2-CONF
        DisplayString
                FROM SNMPv2-TC;

toasterMIB MODULE-IDENTITY
    LAST-UPDATED "201302071012Z"
    ORGANIZATION "Toaster Org"
    CONTACT-INFO "www.toaster.org"
    DESCRIPTION  "Toaster Company"
    REVISION     "201302071012Z"
    DESCRIPTION "The initial version of our great toaster mib"
    ::= { enterprises 12 3 1}


epilogue        OBJECT IDENTIFIER ::= {enterprises 12}
toaster         OBJECT IDENTIFIER ::= {epilogue 1}


toasterGroup OBJECT-GROUP
        OBJECTS {toasterControl,
                 toasterDoneness,
                 toasterManufacturer,
                 toasterModelNumber,
                 toasterToastType
                 }
        STATUS  current
        DESCRIPTION
        "toaster module group"
        ::= { enterprises 12 5 2}



toasterManufacturer OBJECT-TYPE
  SYNTAX  DisplayString
  MAX-ACCESS  read-only
  STATUS  current
  DESCRIPTION
          "The name of the toaster's manufacturer. For  instance,
          Microsoft Toaster."
  ::= {toaster 1}

toasterModelNumber OBJECT-TYPE
  SYNTAX  DisplayString
  MAX-ACCESS  read-only
  STATUS  current
  DESCRIPTION
          "The name of the toaster's model. For instance,
          Radiant Automatic."
  ::= {toaster 2}


..............................
....



PROJECT FILE:

#AgenPro 3 Project File
#Wed Feb 20 11:22:11 CST 2013
agenpro.FileTemplate0=C\:\\Program Files\\AgenPro3\\templates\\snmp4j-agent_2_0_5\\java_filename.vm
agenpro.ExecutionPerModule0=2
agenpro.InputDir0=
agenpro.UseRepositoryModules=false
agenpro.cfg.version=3.0.5
agenpro.Modules0=TOASTER-MIB
agenpro.GenerationTemplate0=C\:\\Program Files\\AgenPro3\\templates\\snmp4j-agent_2_0_5\\java_code.vm
agenpro.attributes.key.1.3.6.1.4.1.8888.2.2.1.0=factoryScalars
agenpro.attributes.value.1.3.6.1.4.1.8888.2.2.1.0=yes
agenpro.RootDir.IO=
agenpro.MergeWithExistingCode=false
agenpro.OutputDir0=G\:\\Projects\\SNMP\\_MibSrcCompiled
agenpro.RootDir.Templates=
agenpro.SelectionTemplate0=C\:\\Program Files\\AgenPro3\\templates\\snmp4j-agent_2_0_5\\select_1module1file.vm



.....

How can I make this work? I'd appreciate some insight. Thanks



More information about the SNMP4J mailing list