ok, i got a piece of the code which i copy from a snmp manager project, i
don't know if this can help. sorry for can't copy all the projet here.
to start the discoveragent method, i have to provide search address(like
255.255.255.255), snmp version, that's all.
as far as i see, this method simply asked a sysUpTime and sysDescr to each
agent to achieve a auto-discovery.

private void DiscoverAgents(Dart.Snmp.ManagerSlave worker, object state)

{

string address = state as string;

if(m_Settings == null)

m_Settings = new MessageSettings("PowerSNMPFreeManager");

// Create Common Oid Get Message

GetMessage msg = new GetMessage();

msg.Version = m_Settings.Version;

if (msg.Version != SnmpVersion.One)

{

msg.Security = m_Settings.Security;

}

msg.Community = m_Settings.Community;

// setup the message with the current message setting

MibNodes mib = new MibNodes();

msg.Variables.Add(mib.CreateVariable(NodeName.sysUpTime));

msg.Variables.Add(mib.CreateVariable(NodeName.sysDescr));

worker.LocalEndPoint = new IPEndPoint(m_LocalAddress, 0);

worker.Socket.ReceiveTimeout = 3000;

ResponseMessage[] responses = worker.GetResponses(msg, address, 161);

worker.Manager.Marshal(responses, null);

}


On Fri, Jul 9, 2010 at 2:55 PM, Dave Shield <d.t.shi...@liverpool.ac.uk>wrote:

> On 9 July 2010 13:43, Yi ZHOU <zoe...@gmail.com> wrote:
> >       if the snmp manager timeout can't be
> > modified, how can i improve my agent part to react the request quickly?
>
> Well, the first step is to determine exactly what the discovery request
> actually is.   If you don't know what's being asked for, it's going to be
> difficult to make this quicker!
>
> Dave
>
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to