SNMP trap agent help

Help
2009-03-18
2013-05-28
  • Hi, Milan

    I have to develop SNMP trap agent that will collect information from manager objects on the server and send this information to the managers using SNMP-Trap messages. I looked through your project and found it very interesting. But I didn't find the needed functionality. So, do you have any examples of Agent realization or do you know any open source project that do that stuff? Any help will be appreciated.

    Dima

     
    • milans
      milans
      2009-03-19

      Hi Dima,

      Example how to send SNMP traps can be found here: http://snmpsharpnet.com/trapsendexample.html

      I am working on examples of how to send SNMPv3 traps and informs. When done, it will be posted on the http://www.snmpsharpnet.com/ web site.

      Let me know if this doesn't apply to your particular situation.

      Milan

       
      • Hi, Milan

        Thanks for help, but I have already found this example. I thought you had some special class for this, in order not to create a socket, just call some function. For example

        TrapManager.SendTrap(params....);

        If you implement this in future it will be great.

        Also I've found a project on CodePlex, I think you will be interested in it
        http://sharpsnmplib.codeplex.com/

        Dima

         
  • Hi Milan,

     
  • Hi Milan,

    I am having difficulty in generating SNMPv3 traps and informs. So can you please help me?

     
  • I have a query on SNMP v3 details are below:

    I am working on SNMP Sharp Net library latest version. While using this lib for SNMP v3 sending and receiving traps, I am referring to URL http://www.snmpsharpnet.com/node/20, here in the below code

    UdpTarget target = new UdpTarget((IPAddress)SomeHostIP);
    SecureAgentParameters param = new SecureAgentParameters();

    OctetString ostr = new OctetString();           
    param.SecurityName.Set(ostr);
    param.EngineId.Set(ostr);
    param.EngineBoots.Set("0");
    param.EngineTime.Set("0");           

    if (!target.Discovery(param))
    {
      Console.WriteLine("Discovery failed. Unable to continue…");
      target.Close();
      return;
    }

    target.Discovery function is giving me an error "Request has reached maximum retries.", so can you please help me. Is there anything I am missing here?
    Can you please point me to a documentation/implementation link for SNMP v3 traps.

     
  • Dev DP
    Dev DP
    2012-12-05

    I have a query on SNMP v3 details are below:

    I am working on SNMP Sharp Net library latest version. While using this lib for SNMP v3 sending and receiving traps, I am referring to URL http://www.snmpsharpnet.com/node/20, here in the below code

    UdpTarget target = new UdpTarget((IPAddress)SomeHostIP);
    SecureAgentParameters param = new SecureAgentParameters();

    OctetString ostr = new OctetString();           
    param.SecurityName.Set(ostr);
    param.EngineId.Set(ostr);
    param.EngineBoots.Set("0");
    param.EngineTime.Set("0");           

    if (!target.Discovery(param))
    {
      Console.WriteLine("Discovery failed. Unable to continue…");
      target.Close();
      return;
    }

    target.Discovery function is giving me an error "Request has reached maximum retries.", so can you please help me. Is there anything I am missing here?
    Can you please point me to a documentation/implementation link for SNMP v3 traps.

     
  • milans
    milans
    2012-12-08

    You don't need to set any of the values in the SecureAgentParam class before calling the Discovery() method. Once discovery process is completed, you will need to set the SecurityName, Authentication and Privacy protocols and secrets.

    If you are still not getting a response, it is possible that agent (host you are sending traps to) is not correctly configured or not capable of handling SNMPv3.

    -MilanS