| Author | Forum: PowerSNMP for .NET Topic: How an agent manages the MIB values? |
| perevera From: Barcelona, Spain Posts: 10 Member Since: 12/15/08 |
posted January 14, 2010 5:09 AM I am trying to develop an agent application, for what I am looking at the sample named Agent and the Help files, but I don’t get the point... I don’t see a way to associate an agent to a MIB file. Yes, I can open a MIB file and associate it with a MibNodes object but then, how do I associate this object with the agent object? The Mib property does not do the trick, it is only for getting a MibNodes object (I don’t understand which one). So it looks like you have to use the Variables property but, in which way? I guess we need to navigate through all the objects in a Mib then add those variables to the Variables object? In any case, when testing the Agent sample, whenever a Get or Set message is received, the agent will always return a ”NoSuchName” response. |
| bhaviksuthar From: london, United Kingdom Posts: 3 Member Since: 12/02/09 |
posted January 18, 2010 9:56 AM I am also trying the same thing and well, I figured out the way that you have to iterate through the MibNodes and add it to the Variables collection. But still the original question remains that how should I make my agent to respond to request with specific OID. The support team will query the application with that only and haven't got a clue how u can prepare response to those specific request. Your help will be much appreciated as now there are two guys waiting for the same info :) |
| Jason Farrar (Admin) From: Oneida, NY USA Posts: 223 Member Since: 07/24/07 Extra Support Options Custom Application Development |
posted January 18, 2010 3:53 PM The first step, as mentioned in the previous post, is to add the variables from the MibNodes collection to the Agent Variables and also set the variable's starting values. You can find this demonstrated in the agent sample for the Set request table. You will also need to update these values as appropriate. Once you have done that you need to start up an AgentMessageReceived worker thread. Using the Agent's Start method. This is also demonstrated in the Agent sample, you can find it on line 57 of Main.cs. The actual code for worker thread starts on line 75 of Main.cs. Once you have done that, a new thread for processing the message will start when a message is received. If the variables have been added correctly the following lines of code will generate the correct response message for the request message and send it: ResponseMessage response = agent1.CreateDefaultResponse(request); agent1.send(response, request.Origin); I hope this helps resolve your issue. |
| Reply | PowerSNMP for .NET Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|