[SNMP4J] AgenPro Read-Only Scalar Generation, Revisited
Frank Fock
fock at agentpp.com
Wed Feb 20 21:48:32 CET 2013
Hi,
Have you set the property "get" to "yes" for the scalars?
The "factoryScalars" will create the scalars based on the MOFactory
you use. Here no method overwriting is possible, but you can
"inject" your own base class for the scalars (and other objects).
In both cases you can create listeners to the MOServer that enable
you to update the values of the ManagedObjects externally.
That is what I wrote in the discussion from 2006.
Best regards,
Frank
Am 20.02.2013 19:07, schrieb burblebee:
> 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
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
--
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax: +49 7024 8688231
More information about the SNMP4J
mailing list