views:

478

answers:

1

I have the an ASCII message of SNMP traps, how can i sent it to different IP address? i dont want to use email instead. Given a IP address and the port, of that receiver machine.

PLease tell me the solution or where can i get references to the command at least. coz i could find anything regarding it.

PLease...Hope someone can help me..

thank you very much.

regards,

dunk

A: 

I don't understand what is "an ASCII message of SNMP traps".

If you already have the bytes you would like to send, in VB.NET you can use Socket.SendTo method.

If you need to pack up TRAP messages, #SNMP Library exposes such API for .NET/Mono platform. http://sharpsnmplib.codeplex.com (using Messenger.SendTrap* methods).

Lex Li
thx for reply..IT's like this: SNMPTraps been captured, n result i saved in textfile. i have option either to send the txtFile directly or send the data and recipient can view using notepad.Again, my questions are, both can use Socket.SentTo Method? U knw whether it can do using VBScript or JScript??Thank you very much.
i already go tru wif the Socket.SentTo Methods. i even try to manipulate the code available in the internet.From the example in the internet, there are no errors but i cannot ensure that the other PC has receive my message.Here are the codes:Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);IPEndPoint iep = new IPEndPoint(IPAddress.Parse("192.168.1.150"), 162);byte[] data = Encoding.ASCII.GetBytes("This is a test message");Label1.Text = "File Sent";server.SendTo(data, iep);server.Close();thx..!!
If that's the code you use, and you want to use it for Internet, it is very likely to fail, as raw UDP traffic can be filtered out by intermediate network devices.
Lex Li
sory for late response..then, what else should i put in consideration if i wanna use this kind of approaches? tq
It is really hard to do an estimate, but if you pack the message in correct SNMP format, it may go through firewalls without a problem. That really depends on the network, not your code.
Lex Li