On Tue, Jul 1, 2008 at 6:28 PM, Dave Shield <[EMAIL PROTECTED]>
wrote:

>    [ First - *please* don't mail me privately, without copying
>     any responses to the mailing list.  I don't have the time
>     or inclination to offer private, unpaid, SNMP consultancy.
>     Keep discussions to the list, where others can both learn
>     and offer advice.  Thanks.   ]
>


> First of all i've to say sorry for you dave and all of the members of this
> mailing list
>
it was an accident when i using my email application

>
>
> 2008/6/30 deka aditia <[EMAIL PROTECTED]>:
> > On 6/30/08, Dave Shield <[EMAIL PROTECTED]> wrote:
> >> 2008/6/30 deka aditia <[EMAIL PROTECTED]>:
> >>> currently i'm developing an application that will listen to SNMP Port,
> >>> when there is snmp packet incoming then my application will translate
> >>> the request and send it back to user .
> >>
> >> That sounds suspiciously like an "SNMP agent".
> >> We provide exactly such a beast - why not use that,
> >> rather than re-inventing the wheel.
> >>
> >
> > OK Mr. Dave i prefer to choose "SNMP listener" rather than "SNMP agent"
> > i'm just confuse with what i should asking
>
>
> The standard terminology within the SNMP community is
> either "command responder" or "agent".
> The term "SNMP listener" is ambiguous, as it would
> cover several different types of application.
>
>
> I suggest you follow established practise, rather than
> inventing your own terminology.
>
>
>
>
> >>> Before i will start deveIoping this application, i have a basic
> questions
> >>> :
> >>> How we i detect a new incoming SNMP packet using net-snmp ?
> >>
> >> If you are determined to implement an agent for yourself,
> >> please see the routine "receive()" in the file 'agent/snmpd.c'
> >>
> >
> > it's just a program that listen to some SNMP request which OID is'nt
> > come to standard MIB, moreover it will access some hardware
> > information and send the response ...
>
> Yes - that is exactly the behaviour of an agent.
>
> I would suggest that you concentrate on developing a MIB
> module for your particular needs, and use this within the
> existing Net-SNMP agent framework.
>   Trying to code the whole thing from scratch will involve a
> lot of unnecessary duplication.
>
>
>
> >> This contains the main event loop, for detecting incoming requests
> >> and processing them.   The vital elements of this are:
> >>
> >>     snmp_select_info()
> >>     select()
> >>     snmp_read()
> >>
> >> But I'd strongly advise against trying to write your own agent.
> >> There's best part of twenty years work gone into the Net-SNMP
> >> agent - it's going to take you a while to reproduce that!
> >>
> >> Dave
> >>
> >
> > could you explain more about 3 procedure above :D .....
>
>
> I repeat - I would *STRONGLY* suggest that you do not
> try to implement an agent from scratch.   The existing
> agent will handle accepting incoming requests, decoding
> them into a useable data structure, and passing the
> request off to the appropriate MIB module handlers.
> There is a lot of fiddly detail here, which would take
> you a long time to reproduce for yourself.
>
>  If you use the Net-SNMP agent, then you don't need to
> worry about any of this - it's all handled for you.  You can
> concentrate on the important task, of handling your
> hardware and implementing the corresponding MIB.
>

Now i got what you want,
you suggest me to develop a sub agent in existing agent, right ?
And for that reason i've download the example code in
here<http://www.net-snmp.org/wiki/index.php/TUT:Writing_a_Subagent>...
But as a newbie of course i still got some weird stuff in there ...
Some question that make me confuse is :
1.) I just try to run this program on my PC (i'm using opensuse 11.0)
but it got a message that the program can't communicate with the main agent
....
what is the agent program in net-snmp ? is it snmpd? i'm try to looking
snmpd but looks like it doesn't exist in my opensuse 11.0, altough it has
confirmed to succesful installation of net-snmp ..

2.)

/* your main loop here... */
  while(keep_running) {
    /* if you use select(), see snmp_select_info() in snmp_api(3) */
    /*     --- OR ---  */
    agent_check_and_process(1); /* 0 == don't block */
  }

I've been known how to usage select(), snmp_select_info() .....  in some
tutorial. one of them is
here<http://www.users.pjwstk.edu.pl/%7Ejms/qnx/help/tcpip_4.25_en/prog_guide/libs/snmp_select_info.html>,
but in the context of this program how i can integrate all of this function
with main program ... i mean what should i do to pass call back routine with
read ??
Thanx before,  i appreciate your help ....


>
> Dave
>
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to