Quantcast
Channel: C# Based Open Source SNMP Library for .NET and Mono
Viewing all articles
Browse latest Browse all 576

New Post: SNMP Trap Data (sending)

$
0
0
Hi there,

i have a question regarding the isnmpdata interface when you try to send a trap.

Starting point is the call of this method

Messenger.SendTrapV1(new IPEndPoint(targetip, 162), IPAddress.Loopback, new OctetString("public"), oid, GenericCode.ColdStart, 0, 0,variables );

I want to give this trap a data string like "this is a test trap".

My idead was using the CreateSNMPData Method from the DataFactory, but i always get exceptions.

For example this code:

List<Variable> variables = new List<Variable>();
oid = new ObjectIdentifier(txt_oid.Text.Trim());
string test = "Test trap from .......";
byte[] content = StringToByteArray(test);
variables.Add(new Variable(oid,DataFactory.CreateSnmpData(content)));

But i only get an exception "unsupported data type: 84"

Anyone has a good example for actually sending data with "text" information?

Thank you in advance :)

Viewing all articles
Browse latest Browse all 576

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>