How can I reply to a get request from managing software such as (solarwinds)

安稳与你 提交于 2019-12-13 08:26:01

问题


I use sharpSnmp to make a SNMP agent (virtual SNMP machine) that communicates with monitoring software.

But my agent is not detected by Monitoring apps.

I can get the Message from monitoring software by this code, the incoming message from monitoring software (solarwinds) has an OID: "1.3.6.1.2.1.1.2.0" with null value. I tried to set it's value and reply by this code:

private void MessageToListener(object sender, EventArgs e)
    {
        int i = 0;
        //Listener listen = sender as Listener;
        MessageReceivedEventArgs ee = e as MessageReceivedEventArgs;

        ISnmpMessage message = ee.Message;
        int messageId = message.MessageId();
        int requestId = message.RequestId();


        OctetString userName = message.Parameters.UserName;
        IList<Variable> List= new List<Variable>
        {
            new Variable(new ObjectIdentifier("1.3.6.1.2.1.1.2.0"), new OctetString("Shanghai"))
        };


        if (message.Version == VersionCode.V2)
        {

            Messenger.Set(VersionCode.V2, new IPEndPoint(IPAddress.Parse("192.168.52.10"), 161), userName, List,
                10000);

        }
    }

but I get 'Timeout exception' at my agent side and 'Test Failed' at monitoring software side. Where is my mistake? anybody can help?

来源:https://stackoverflow.com/questions/38026934/how-can-i-reply-to-a-get-request-from-managing-software-such-as-solarwinds

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!