SNMP用VC开发

发布时间 : 星期五 文章SNMP用VC开发更新完毕开始阅读

Most of the discussion has been about agents and only touching on network management software. Command line programs can be used to poll agents and view responses, but the process is tedious since the operator needs to fully understand the structure of MIBs and each object's syntax. There are several commercial and some freeware software packages that will poll agents, set traps and receive and display trap responses while providing a more convenient user interface. Since SNMP was developed before the Worldwide Web protocols were developed, much of the data that is displayed is text-based.

Later versions of network management software take advantage of Windows functionality and provide greater versatility such as trending. It will take an operator some time to learn the intricacies of the program but from one workstation, an operator can view all SNMP compatible devices. With increasing interest in making a web browser the default operator interface for a system, can SNMP data be displayed on a browser screen? Some newer managed devices have built-in web servers that can serve up SNMP data. The advantage of a built-in web server is that it provides a convenient method of configuring the device and, an opportunity to verify that the device is functioning by being able to access it from the web. The other advantage is that the managed device with its internal web server can operate stand-alone without the need for any network management software.

The difficulties arise when several man- aged devices are to be viewed from one browser. There is no consistency of data presentation from the various vendors of web-based managed devices. It is also inconvenient to remember all the various URLs that must be selected to view individual managed devices.

For our industry, there is another approach. It is possible to have an OPC server running in the manager that understands the SNMP protocol and can query MIB data, but display the data in a format comfortable to the operator. If the operator is viewing a process automation screen displaying instruments, controllers and alarms, the information from managed devices can be included within the same screen making for a neat, uniform appearance. The operator does not need to run a totally different application program to monitor the health of his network. There are several vendors in our industry that provide such a product.

Conclusion

With more and more devices embracing Ethernet and Internet protocols, the addition of SNMP protocol support adds benefits to the device. Managed devices support the SNMP protocol and are called agents. Agents consist of a collection of managed objects that can be queried by a manager in order to determine the health of the network or the status of particular devices. By displaying this data in an easily understood format, operators and maintenance personnel, located at a central site, can monitor the performance of the entire network by observing selected devices and pinpointing potential problems before they become major ones. Although commercial and freeware network management software programs exist for this purpose, the trend is to use more web-based tools. SNMP is not restricted to just the management of switches and routers. Any industrial device can have SNMP support and could provide much aid in industrial applications.

References

1. Mauro, Douglas R. & Schmidt, Kevin J., Essential SNMP, O'Reilly & Associates, Inc., 2001

2. Open DeviceNet Vendors Association, DeviceNet Specifications,Volume 1, Release 2.0, 1995

3. Internet Engineering Task Force, RFC 1157 - A Simple Network Management Protocol (SNMP), 1990 4. Internet Engineering Task Force, RFC 1213 - Management Information Base II, 1990

George Thomas is president of Contemporary Controls

SNMP的学习笔记

(ccnupq http://blog.csdn.net/ccnupq/)

1 BRE编码(Basic Encoding Rule)

基本编码规则使用使用TLV 方式,即Type,Length,Value消息中所表达的信息都用一个Type 域标记一个Legnth 限定值然后是Value ,ASN.1是一种用来描述系统之间传递的信息格式的语言规范被广泛用在通信协议的规格定义中一句话理解ASN.1 和BER即是:“信息的描述基于ASN.1 语法”和“信息的编码基于BER方法”

2 SNMP报文的过程中我们经常用到的是下面的数据类型标识号

各种数据类型的解释

? INTEGER 一个变量虽然定义为整型,但也有多种形式。有些整型变量

没有范围限制,有些整型变量定义为特定的数值(例如,IP的转发标志就只有允许转发时的或者不允许转发时的这两种),有些整型变量定义一个特定的范围(例如,UDP和TCP的端口号就从0到65535)。

? OCTER STRING 0或多个8 bit字节,每个字节值在0~255之间。

对于这种数据类型和下一种数据类型的BER编码,字符串的字节个数要超过字符串本身的长度。这些字符串不是以NULL结尾的字符串。 ? DisplayString 0或多个8bit字节,但是每个字节必须是ASCII码。在

MIB-II中,所有该类型的变量不能超过255个字符(0个字符是可以的)。 ? OBJECT IDENTIFIER

? NULL 代表相关的变量没有值。例如,在get或get-next操作中,变

量的值就是NULL,因为这些值还有待到代理进程处去取。

? IpAddress 4字节长度的OCTER STRING,以网络序表示的IP地址。

每个字节代表IP地址的一个字段。

? PhysAddress OCTER STRING类型,代表物理地址(例如以太网物

理地址为6个字节长度)。

? Counter 非负的整数,可从0递增到232—1(4294976295)。达到最

大值后归0。

? Gauge 非负的整数,取值范围为从0到4294976295(或增或减)。达

到最大值后锁定直到复位。例如,MIB中的tcpCurrEstab就是这种类型的变量的一个例子,它代表目前在ESTABLISHED或CLOSE_WAIT状态的TCP连接数。

? TimeTicks 时间计数器,以0.01秒为单位递增,但是不同的变量可以

有不同的递增幅度。所以在定义这种类型的变量的时候,必须指定递增幅度。例如,MIB中的sysUpTime变量就是这种类型的变量,代表代理进程从启动开始的时间长度,以多少个百分之一秒的数目来表示。

联系合同范文客服:xxxxx#qq.com(#替换为@)