Purpose of this Article
In view of the fact that this development kit is not used in detail on the internet, I will share my experience here. Note: I found that some people are very fond of focusing on some less meaningful things, rather than taking the time to study those very difficult and in-depth problems. Here I will first declare that I will only talk about my practical experience on the snmpsharpnet development kit. Development Kit: Development.
Blocking Mode and non-blocking mode in snmpsharpnet
Because I am working on network management monitoring, real-time performance is essential. At first, I did not hesitate to adopt the non-blocking mode. However, in the experiment, I found that in the short term, when a large number of packets are sent, more packets are received than the sent packets. I was puzzled by this problem, but I had no answer on the Internet. Considering the uncertainty of the callback function, I gave up using this method after many attempts, instead, we adopt a multi-threaded approach to achieve "non-blocking ". I suggested that you do not use the non-blocking mode provided by snmpsharpnet. But today I read the previous stress test report again and found that there were still many problems in my tests, first, there is no field test. Only two devices can be used to simulate the test of hundreds of devices. More packets are received probably because the MIB library reading speed of the device is slow or because of other reasons. In the future, I will perform this test if conditions are met, and then I will post the results for discussion.
Currently, I am implementing the blocking mode. Here I want to explain that the snmpsharpnet Development Kit does not capture exceptions in the blocking mode. You need to capture and analyze the exceptions yourself. Not to mention, timeout generates snmp0000tin, while OID configuration errors generate non-snmpexception. Below is my monitoring partCodeExample:
SnmppacketResult;Try{Result = target. Request (PDU, Param );}Catch(Snmpexception) {Judgelevelsendmessage ("Access timeout");}Catch{Throw newValidationexcpetion("Please check the oId item configuration information! ");}
In other cases, someone may need it, but it must be a minority. I will not talk about it here. In this way, it is actually a small problem to judge that the device is not online. I changed the properties of a device during the test and found that the MIB library of the device was within a period of time (about 5 S) but Ping can be pinged. It is assumed that the MIB library of the device is temporarily closed to save new information or adjust the device.
For more information about how to encode the four methods of snmpsharpnet, see encoding. You only need to add value items to the vblist of the pdu.
OK, snmpsharpnet is actually that simple, just look at the development documentation of this package. If you have any questions, please advise. After all, this is my first practice of network management.
Copyright Notice
All original posts in this blogArticleThe author retains the copyright. This statement must be reprinted to ensure the completeness of this article, and the author s5279551 and the original address of this article should be indicated in the form of a hyperlink:
Http://www.cnblogs.com/s5279551/archive/2010/09/19/1831261.html