• msdn snmp trap 研究可否 重入 转《Multiple Trap Registrations》


    Multiple Trap Registrations

    Several options are available when a WinSNMP application registers a WinSNMP session for traps or notifications. Because of this, an application can call the SnmpRegister function multiple times,

    in effect defining a custom filter for the reception of traps and notifications. For example, you can register for one type of trap or notification, or for all traps and notifications, depending on the value of the notification parameter. Additionally, the application can specify values in other parameters to the SnmpRegister function to further define the traps and notifications that should reach an application. For more information, see Managing Traps and Notifications.

    Following are instances in which multiple calls to SnmpRegister are redundant. In these instances SnmpRegister returns SNMPAPI_SUCCESS if the function completes successfully, but the redundant registration is ineffective.

    1. A call to the SnmpRegister function requesting filtered delivery of traps and notifications to the session, after a previous call toSnmpRegister requesting delivery of all traps and notifications (unfiltered delivery). This call is redundant because the session is already receiving all traps and notifications, including the single type defined by the filter.
    1. A duplicate call to SnmpRegister, or one in which the parameter list is identical to the parameter list in a previous call to SnmpRegisterfor the session.
    1. A call to the SnmpRegister function requesting filtered delivery of traps and notifications based on an object identifier (OID) whose prefix is an OID specified in a previous call to SnmpRegister. For example, you can specify "1.3.6.1.4.1.311" in the notification parameter to receive notifications originating from any Microsoft SNMP agent entity. If you call SnmpRegister again and specify "1.3.6.1.4.1.311.1", the second call is redundant because the session is already receiving all traps and notifications that contain the OID prefix "1.3.6.1.4.1.311".

    To unregister the session, you must match each unique registration call to the SnmpRegister function. Call SnmpRegister to unregister the session, and ensure that the first five parameters to SnmpRegister are identical to those in the initial registration call. The only difference between the initial call and the unregistering call is that when registering you must specify the value SNMPAPI_ON in the status parameter, and when you call the function to unregister, you must specify SNMPAPI_OFF. You do not need to match redundant registration calls to theSnmpRegister function. You need only match the first unique registration call.

    To change filtering criteria, it may be necessary for an application to first unregister and disable delivery of certain traps or notifications. Then the application can create a new filter by calling SnmpRegister, passing appropriate values.

    小结:冗余

  • 相关阅读:
    CRM小结 – Account Management 1
    懂ABAP的好处
    Enhancement in Sales order 销售订单中的增强
    Account Classification
    关于Business Data Toolset
    Account Life Cycle Stage - 客户的生命周期管理
    使用维护Relationship
    Tansaction Variant and Screen Variant
    关于软件测试的认识与学习目标
    《ASP.NET MVC Music Store Tutorial》在Visual Studio 2008简体中文环境下的代码修订
  • 原文地址:https://www.cnblogs.com/titer1/p/2290395.html
Copyright © 2020-2023  润新知