[SNMP4J] Re: Basic Question

Petro Peter petropeter at gmail.com
Sat May 5 20:35:14 CEST 2007


Hi,

Its simple, give some time to go thru AgenPro User Guide. There is some
problem i faced, in compiling the .java file using the tool. So, compile it
using java.exe

I prepared the documnt, but I will be able to provide u only on Monday. So,
u can try till that time, i know u can do it.

regards,
petro

On 5/5/07, sitakanta hotta <skhotta at gmail.com> wrote:
>
> Hi Peter,
>
> Great informtaion.
> I tried creating .java file using AgentPro using the
> snmp4J-NOTIFICTION_MIB sample file which is there in one of the
> sub-directories in the agentPro .
> I do not see any .java file.
>
> I followed the steps mentioned in the agentPro pdf doc for creating java
> file from MIB. I used  GUI tool  instead of any command line.
> I do not know what steps I am missing . Could you help on this one?
> If you can send any dummy MIB notification file and steps to create .java
> file using agentPro, that will be great.
>
> I appriciate your help.
>
> thanks,
> Hotta
>
>
> On 5/5/07, Petro Peter <petropeter at gmail.com> wrote:
> >
> > Hi,
> > I used notification using in my project. please follow the below steps.
> >
> > - Create Java file for the new MIB file created usinf AgenPro tool.
> > - Then create the SNMP4J agent, please refer the TestAgent code for
> > example.
> > - Load the newly created Mib file into the agent.
> > - While creating the istance of Mib, pass the reference of Notification
> > Originator
> > - Now, whenever a value is set on a given mib object, Mib class's
> > validation class methods will be called.
> > - We can send the notification from the validation class, using the
> > reference.
> >
> > Find below the code snippet fromm the Mib file.
> >
> > [code]
> >     public class NotificationLevel extends MOScalar
> >     {
> >         NotificationLevel(OID oid, MOAccess access)
> >         {
> >             super(oid, access, new Integer32());
> > //--AgentGen BEGIN=notificationLevel
> > //--AgentGen END
> >         }
> >
> >         public int isValueOK(SubRequest request)
> >         {
> >             Variable newValue =
> >                     request.getVariableBinding().getVariable();
> >             int valueOK = super.isValueOK(request);
> >             if (valueOK != SnmpConstants.SNMP_ERROR_SUCCESS)
> >             {
> >                 return valueOK;
> >             }
> >             //--AgentGen BEGIN=notificationLevel::isValueOK
> >             //--AgentGen END
> >             return valueOK;
> >         }
> >
> >         public Variable getValue()
> >         {
> >             //--AgentGen BEGIN=notificationLevel::getValue
> >             //--AgentGen END
> >             return super.getValue();
> >         }
> >
> >         public int setValue(Variable newValue)
> >         {
> >            //Using the NotificationOriginator reference, sends
> > notification
> >            //whenever this value is set
> >             sendNotification();
> >             return super.setValue(newValue);
> >         }
> >
> >         //--AgentGen BEGIN=notificationLevel::_METHODS
> >         //--AgentGen END
> >
> >     }
> > [/code]
> >
> > For any queries, kindly let me know
> >
> > --
> > regards,
> > petro
>
>
>


-- 
regards,
petro



More information about the SNMP4J mailing list