Network Working Group                                      S. Waldbusser
Request for Comments: 4011                                    Nextbeacon
Category: Standards Track                                     J. Saperia
                                                    JDS Consulting, Inc.
                                                               T. Hongal
                                               Riverstone Networks, Inc.
                                                              March 2005
        
Network Working Group                                      S. Waldbusser
Request for Comments: 4011                                    Nextbeacon
Category: Standards Track                                     J. Saperia
                                                    JDS Consulting, Inc.
                                                               T. Hongal
                                               Riverstone Networks, Inc.
                                                              March 2005
        

Policy Based Management MIB

基于策略的管理MIB

Status of This Memo

关于下段备忘

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (2005).

版权所有(C)互联网协会(2005年)。

Abstract

摘要

This memo defines a portion of the Management Information Base (MIB) for use with network management protocols in TCP/IP-based internets. In particular, this MIB defines objects that enable policy-based monitoring and management of Simple Network Management Protocol (SNMP) infrastructures, a scripting language, and a script execution environment.

此备忘录定义了管理信息库(MIB)的一部分,用于基于TCP/IP的Internet中的网络管理协议。特别是,此MIB定义的对象支持基于策略的监视和管理简单网络管理协议(SNMP)基础结构、脚本语言和脚本执行环境。

Table of Contents

目录

   1.  The Internet-Standard Management Framework ..................   3
   2.  Overview ....................................................   4
   3.  Policy-Based Management Architecture ........................   4
   4.  Policy-Based Management Execution Environment ...............  10
       4.1.  Terminology ...........................................  10
       4.2.  Execution Environment - Elements of Procedure .........  10
       4.3.  Element Discovery .....................................  11
             4.3.1.  Implementation Notes ..........................  12
       4.4.  Element Filtering .....................................  13
             4.4.1.  Implementation Notes ..........................  13
       4.5.  Policy Enforcement ....................................  13
             4.5.1.  Implementation Notes ..........................  14
   5.  The PolicyScript Language ...................................  14
       5.1.  Formal Definition .....................................  15
        
   1.  The Internet-Standard Management Framework ..................   3
   2.  Overview ....................................................   4
   3.  Policy-Based Management Architecture ........................   4
   4.  Policy-Based Management Execution Environment ...............  10
       4.1.  Terminology ...........................................  10
       4.2.  Execution Environment - Elements of Procedure .........  10
       4.3.  Element Discovery .....................................  11
             4.3.1.  Implementation Notes ..........................  12
       4.4.  Element Filtering .....................................  13
             4.4.1.  Implementation Notes ..........................  13
       4.5.  Policy Enforcement ....................................  13
             4.5.1.  Implementation Notes ..........................  14
   5.  The PolicyScript Language ...................................  14
       5.1.  Formal Definition .....................................  15
        
       5.2.  Variables .............................................  18
             5.2.1.  The Var Class .................................  19
       5.3.  PolicyScript QuickStart Guide .........................  23
             5.3.1.  Quickstart for C Programmers ..................  25
             5.3.2.  Quickstart for Perl Programmers ...............  25
             5.3.3.  Quickstart for TCL Programmers ................  25
             5.3.4.  Quickstart for Python Programmers .............  26
             5.3.5.  Quickstart for JavaScript/ECMAScript/JScript
                     Programmers ...................................  26
       5.4.  PolicyScript Script Return Values .....................  26
   6.  Index Information for `this element' ........................  27
   7.  Library Functions ...........................................  28
   8.  Base Function Library .......................................  29
       8.1.  SNMP Library Functions ................................  29
             8.1.1.  SNMP Operations on Non-Local Systems ..........  30
             8.1.2.  Form of SNMP Values ...........................  32
             8.1.3.  Convenience SNMP Functions ....................  34
                     8.1.3.1.  getVar() ............................  34
                     8.1.3.2.  exists() ............................  34
                     8.1.3.3.  setVar() ............................  35
                     8.1.3.4.  searchColumn() ......................  36
                     8.1.3.5.  setRowStatus() ......................  38
                     8.1.3.6.  createRow() .........................  39
                     8.1.3.7.  counterRate() .......................  42
             8.1.4.  General SNMP Functions ........................  44
                     8.1.4.1.  newPDU() ............................  45
                     8.1.4.2.  writeVar() ..........................  45
                     8.1.4.3.  readVar() ...........................  46
                     8.1.4.4.  snmpSend() ..........................  47
                     8.1.4.5.  readError() .........................  48
                     8.1.4.6.  writeBulkParameters() ...............  48
             8.1.5.  Constants for SNMP Library Functions ..........  49
       8.2.  Policy Library Functions ..............................  51
             8.2.1.  elementName() .................................  51
             8.2.2.  elementAddress() ..............................  51
             8.2.3.  elementContext() ..............................  52
             8.2.4.  ec() ..........................................  52
             8.2.5.  ev() ..........................................  52
             8.2.6.  roleMatch() ...................................  52
             8.2.7.  Scratchpad Functions ..........................  53
             8.2.8.  setScratchpad() ...............................  55
             8.2.9.  getScratchpad() ...............................  56
             8.2.10. signalError() .................................  57
             8.2.11. defer() .......................................  57
             8.2.12. fail() ........................................  58
             8.2.13. getParameters() ...............................  58
       8.3.  Utility Library Functions .............................  59
             8.3.1.  regexp() ......................................  59
        
       5.2.  Variables .............................................  18
             5.2.1.  The Var Class .................................  19
       5.3.  PolicyScript QuickStart Guide .........................  23
             5.3.1.  Quickstart for C Programmers ..................  25
             5.3.2.  Quickstart for Perl Programmers ...............  25
             5.3.3.  Quickstart for TCL Programmers ................  25
             5.3.4.  Quickstart for Python Programmers .............  26
             5.3.5.  Quickstart for JavaScript/ECMAScript/JScript
                     Programmers ...................................  26
       5.4.  PolicyScript Script Return Values .....................  26
   6.  Index Information for `this element' ........................  27
   7.  Library Functions ...........................................  28
   8.  Base Function Library .......................................  29
       8.1.  SNMP Library Functions ................................  29
             8.1.1.  SNMP Operations on Non-Local Systems ..........  30
             8.1.2.  Form of SNMP Values ...........................  32
             8.1.3.  Convenience SNMP Functions ....................  34
                     8.1.3.1.  getVar() ............................  34
                     8.1.3.2.  exists() ............................  34
                     8.1.3.3.  setVar() ............................  35
                     8.1.3.4.  searchColumn() ......................  36
                     8.1.3.5.  setRowStatus() ......................  38
                     8.1.3.6.  createRow() .........................  39
                     8.1.3.7.  counterRate() .......................  42
             8.1.4.  General SNMP Functions ........................  44
                     8.1.4.1.  newPDU() ............................  45
                     8.1.4.2.  writeVar() ..........................  45
                     8.1.4.3.  readVar() ...........................  46
                     8.1.4.4.  snmpSend() ..........................  47
                     8.1.4.5.  readError() .........................  48
                     8.1.4.6.  writeBulkParameters() ...............  48
             8.1.5.  Constants for SNMP Library Functions ..........  49
       8.2.  Policy Library Functions ..............................  51
             8.2.1.  elementName() .................................  51
             8.2.2.  elementAddress() ..............................  51
             8.2.3.  elementContext() ..............................  52
             8.2.4.  ec() ..........................................  52
             8.2.5.  ev() ..........................................  52
             8.2.6.  roleMatch() ...................................  52
             8.2.7.  Scratchpad Functions ..........................  53
             8.2.8.  setScratchpad() ...............................  55
             8.2.9.  getScratchpad() ...............................  56
             8.2.10. signalError() .................................  57
             8.2.11. defer() .......................................  57
             8.2.12. fail() ........................................  58
             8.2.13. getParameters() ...............................  58
       8.3.  Utility Library Functions .............................  59
             8.3.1.  regexp() ......................................  59
        
             8.3.2.  regexpReplace() ...............................  60
             8.3.3.  oidlen() ......................................  60
             8.3.4.  oidncmp() .....................................  60
             8.3.5.  inSubtree() ...................................  60
             8.3.6.  subid() .......................................  61
             8.3.7.  subidWrite() ..................................  61
             8.3.8.  oidSplice() ...................................  61
             8.3.9.  parseIndex() ..................................  62
             8.3.10. stringToDotted() ..............................  63
             8.3.11. integer() .....................................  64
             8.3.12. string() ......................................  64
             8.3.13. type() ........................................  64
             8.3.14. chr() .........................................  64
             8.3.15. ord() .........................................  64
             8.3.16. substr() ......................................  65
       8.4.  General Functions .....................................  65
   9.  International String Library ................................  65
       9.1.  stringprep() ..........................................  66
             9.1.1.  Stringprep Profile ............................  66
       9.2.  utf8Strlen() ..........................................  67
       9.3.  utf8Chr() .............................................  68
       9.4.  utf8Ord() .............................................  68
       9.5.  utf8Substr() ..........................................  68
   10. Schedule Table ..............................................  69
   11. Definitions .................................................  70
   12. Relationship to Other MIB Modules ........................... 113
   13. Security Considerations ..................................... 114
   14. IANA Considerations ......................................... 117
   15. Acknowledgements ............................................ 118
   16. References .................................................. 118
       16.1. Normative References .................................. 118
       16.2. Informative References ................................ 119
   Authors' Addresses .............................................. 120
   Full Copyright Statement ........................................ 121
        
             8.3.2.  regexpReplace() ...............................  60
             8.3.3.  oidlen() ......................................  60
             8.3.4.  oidncmp() .....................................  60
             8.3.5.  inSubtree() ...................................  60
             8.3.6.  subid() .......................................  61
             8.3.7.  subidWrite() ..................................  61
             8.3.8.  oidSplice() ...................................  61
             8.3.9.  parseIndex() ..................................  62
             8.3.10. stringToDotted() ..............................  63
             8.3.11. integer() .....................................  64
             8.3.12. string() ......................................  64
             8.3.13. type() ........................................  64
             8.3.14. chr() .........................................  64
             8.3.15. ord() .........................................  64
             8.3.16. substr() ......................................  65
       8.4.  General Functions .....................................  65
   9.  International String Library ................................  65
       9.1.  stringprep() ..........................................  66
             9.1.1.  Stringprep Profile ............................  66
       9.2.  utf8Strlen() ..........................................  67
       9.3.  utf8Chr() .............................................  68
       9.4.  utf8Ord() .............................................  68
       9.5.  utf8Substr() ..........................................  68
   10. Schedule Table ..............................................  69
   11. Definitions .................................................  70
   12. Relationship to Other MIB Modules ........................... 113
   13. Security Considerations ..................................... 114
   14. IANA Considerations ......................................... 117
   15. Acknowledgements ............................................ 118
   16. References .................................................. 118
       16.1. Normative References .................................. 118
       16.2. Informative References ................................ 119
   Authors' Addresses .............................................. 120
   Full Copyright Statement ........................................ 121
        
1. The Internet-Standard Management Framework
1. 因特网标准管理框架

For a detailed overview of the documents that describe the current Internet-Standard Management Framework, please refer to section 7 of RFC 3410 [16].

有关描述当前互联网标准管理框架的文件的详细概述,请参阅RFC 3410[16]第7节。

Managed objects are accessed via a virtual information store, termed the Management Information Base or MIB. MIB objects are generally accessed through the Simple Network Management Protocol (SNMP). Objects in the MIB are defined using the mechanisms defined in the Structure of Management Information (SMI). This memo specifies a MIB module that is compliant to the SMIv2, which is described in STD 58, RFC 2578 [2], STD 58, RFC 2579 [3], and STD 58, RFC 2580 [4].

托管对象通过虚拟信息存储(称为管理信息库或MIB)进行访问。MIB对象通常通过简单网络管理协议(SNMP)进行访问。MIB中的对象是使用管理信息结构(SMI)中定义的机制定义的。本备忘录规定了符合SMIv2的MIB模块,如STD 58、RFC 2578[2]、STD 58、RFC 2579[3]和STD 58、RFC 2580[4]所述。

2. Overview
2. 概述

Large IT organizations have developed management strategies to cope with the extraordinarily large scale and complexity of today's networks. In particular, they have tried to configure the network as a whole by describing and implementing high-level business policies, rather than manage device by device, where orders of magnitude more decisions (and mistakes) may be made.

大型IT组织已经制定了管理战略,以应对当今网络的超大规模和复杂性。特别是,他们试图通过描述和实施高级业务策略来配置整个网络,而不是逐个设备进行管理,因为在这些设备上可能会做出更多的决策(和错误)。

The following are examples of "business policies":

以下是“业务策略”的示例:

- All routers will run code version 6.2. - On-site contractors will only be connected to ports that are configured with special security restrictions. - All voice over cable ports in California must provide free local calling. - Apply special forwarding to all ports whose customers have paid for premium service.

- 所有路由器将运行代码版本6.2。-现场承包商只能连接到配置有特殊安全限制的端口。-加利福尼亚州的所有有线语音端口必须提供免费本地呼叫。-对其客户已支付特优服务费用的所有端口应用特殊转发。

Each of these policies could represent an action applied to hundreds of thousands of variables.

这些策略中的每一个都可以表示应用于数十万个变量的操作。

To automate this practice, customers need software tools that will implement business policies across their networks, as well as standard protocols that will ensure that policies can be applied to all of their devices, regardless of the vendor.

为了使这一做法自动化,客户需要能够在其网络上实施业务策略的软件工具,以及能够确保策略可以应用于其所有设备的标准协议,而不考虑供应商。

This practice is called Policy-Based Management. This document defines managed objects for the Simple Network Management Protocol that are used to distribute policies in a common form throughout the network.

这种做法被称为基于策略的管理。本文档定义了简单网络管理协议的托管对象,用于在整个网络中以通用形式分发策略。

3. Policy-Based Management Architecture
3. 基于策略的管理体系结构

Policy-based management is the practice of applying management operations globally on all managed elements that share certain attributes.

基于策略的管理是在共享某些属性的所有托管元素上全局应用管理操作的实践。

Policies are intended to express a notion of:

政策旨在表达以下概念:

if (an element has certain characteristics) then (apply an operation to that element)

如果(元素具有某些特征),则(对该元素应用操作)

Policies take the following normal form:

策略采用以下正常形式:

if (policyCondition) then (policyAction)

如果是(policyCondition),则是(policyAction)

A policyCondition is a script that results in a boolean to determine whether an element is a member of a set of elements upon which an action is to be performed.

policyCondition是一个脚本,它生成一个布尔值,以确定元素是否是要对其执行操作的一组元素的成员。

A policyAction is an operation performed on an element or a set of elements.

policyAction是对一个元素或一组元素执行的操作。

These policies are most often executed on or near managed devices where the elements live (and thus their characteristics may be easily inspected) and where operations on those elements will be performed.

这些策略通常在元素所在的受管设备上或附近执行(因此,可以很容易地检查它们的特性),并在这些设备上执行操作。

A management station is responsible for distributing an organization's policies to all the managed devices in the infrastructure. The pmPolicyTable provides managed objects for representing a policy on a managed device.

管理站负责将组织的策略分发到基础结构中的所有受管设备。pmPolicyTable提供用于在受管设备上表示策略的受管对象。

An element is an instance of a physical or logical entity and is embodied by a group of related MIB variables, such as all the variables for interface 7. This enables policies to be expressed more efficiently and concisely. Elements can also model circuits, CPUs, queues, processes, systems, etc.

元素是物理或逻辑实体的实例,由一组相关的MIB变量(例如接口7的所有变量)体现。这使策略能够更高效、简洁地表达。元素还可以对电路、CPU、队列、进程、系统等进行建模。

Conceptually, policies are executed in the following manner:

从概念上讲,策略的执行方式如下:

for each element for which policyCondition returns true, execute policyAction on that element

对于policyCondition返回true的每个元素,对该元素执行policyAction

For example:

例如:

If (interface is fast ethernet) then (apply full-duplex mode) If (interface is access) then (apply security filters) If (circuit w/gold service paid for) then (apply special queuing)

如果(接口为快速以太网)则(应用全双工模式)如果(接口为访问)则(应用安全过滤器)如果(电路w/付费黄金服务)则(应用特殊排队)

Each unique combination of policy and element is called an execution context. Within a particular execution context, the phrase 'this element' is often used to refer to the associated element, as most policy operations will be applied to 'this element'. The address of 'this element' contains the object identifier of any attribute of the element, the SNMP context the element was discovered in, and the address of the system on which the element was discovered.

策略和元素的每个唯一组合称为执行上下文。在特定的执行上下文中,短语“this element”通常用于指代关联的元素,因为大多数策略操作将应用于“this element”。“this element”的地址包含该元素的任何属性的对象标识符、在其中发现该元素的SNMP上下文以及在其上发现该元素的系统的地址。

Policies can manage elements on the same system:

策略可以管理同一系统上的元素:

         -----------------------------------------------------
         |                                                   |
         |              Managed System                       |
         |                                                   |
         |                                                   |
         |   ------------------             Managed Elements |
         |   |                |               interfaces     |
         |   | Policy Manager | manages...    circuits       |
         |   |                |               queues         |
         |   ------------------               processes      |
         |                                    ...            |
         |                                                   |
         -----------------------------------------------------
        
         -----------------------------------------------------
         |                                                   |
         |              Managed System                       |
         |                                                   |
         |                                                   |
         |   ------------------             Managed Elements |
         |   |                |               interfaces     |
         |   | Policy Manager | manages...    circuits       |
         |   |                |               queues         |
         |   ------------------               processes      |
         |                                    ...            |
         |                                                   |
         -----------------------------------------------------
        

or they can manage elements on other systems:

或者,他们可以管理其他系统上的元素:

                                            --------------------------
                                            |  Managed System        |
     --------------------------             |    Managed Elements    |
     |                        |             |      interfaces        |
     |  Management Station or |             |      circuits          |
     |    Mid-Level Manager   |             |      ...               |
     |                        |             --------------------------
     |   ------------------   | manages...
     |   | Policy Manager |   |             --------------------------
     |   ------------------   |             |  Managed System        |
     |                        |             |    Managed Elements    |
     --------------------------             |      interfaces        |
                                            |      circuits          |
                                            |      ...               |
                                            --------------------------
        
                                            --------------------------
                                            |  Managed System        |
     --------------------------             |    Managed Elements    |
     |                        |             |      interfaces        |
     |  Management Station or |             |      circuits          |
     |    Mid-Level Manager   |             |      ...               |
     |                        |             --------------------------
     |   ------------------   | manages...
     |   | Policy Manager |   |             --------------------------
     |   ------------------   |             |  Managed System        |
     |                        |             |    Managed Elements    |
     --------------------------             |      interfaces        |
                                            |      circuits          |
                                            |      ...               |
                                            --------------------------
        

...

...

PolicyConditions have the capability of performing comparison operations on SNMP variables, logical expressions, and other functions. Many device characteristics are already defined in MIB Modules and are easy to include in policyCondition expressions (ifType == ethernet, frCircuitCommittedBurst < 128K, etc). However, there are important characteristics that aren't currently in MIB objects, and, worse, it is not current practice to store this information on managed devices. Therefore, this document defines MIB objects for this information. To meet today's needs there are three missing areas: roles, capabilities, and time.

PolicyConditions能够对SNMP变量、逻辑表达式和其他函数执行比较操作。许多设备特性已经在MIB模块中定义,并且很容易包含在policyCondition表达式中(ifType==ethernet、frCircuitCommittedBurst<128K等)。但是,有一些重要的特性目前不在MIB对象中,更糟糕的是,目前还没有将这些信息存储在受管设备上的做法。因此,本文档为此信息定义了MIB对象。为了满足今天的需求,我们缺少三个方面:角色、能力和时间。

Roles

角色

A role is an administratively specified characteristic of a managed element. As a selector for policies, it determines the applicability of the policy to a particular managed element.

角色是托管元素的管理指定特征。作为策略的选择器,它确定策略对特定托管元素的适用性。

Some examples of roles are political, financial, legal, geographical, or architectural characteristics, typically not directly derivable from information stored on the managed system. For example, "paid for premium service" or "is plugged into a UPS" are examples of roles, whereas the "percent utilization of a link" would not be.

角色的一些示例是政治、财务、法律、地理或体系结构特征,通常不能直接从存储在托管系统上的信息派生。例如,“付费优质服务”或“插入UPS”是角色的示例,而“链接利用率”则不是。

Some types of information one would put into a role include the following:

一个人在担任某个角色时会用到的某些类型的信息包括:

political - describes the role of a person or group of people, or of a service that a group of people uses. Examples: executive, sales, outside-contractor, customer. If (attached user is executive) then (apply higher bandwidth) If (attached user is outside-contractor) then (restrict access)

政治-描述一个人或一群人的角色,或一群人使用的服务的角色。示例:主管、销售、外部承包商、客户。如果(附加用户是执行用户)那么(应用更高的带宽)如果(附加用户是外部承包商)那么(限制访问)

financial/legal - describes what financial consideration was received. Could also include contractual or legal considerations. Examples: paid, gold, free, trial, demo, lifeline. If (gold service paid for) then (apply special queuing)

财务/法律-描述收到的财务对价。还可以包括合同或法律方面的考虑。示例:付费、黄金、免费、试用、演示、生命线。如果(黄金服务付费),则(申请特殊排队)

geographical - describes the location of an element. Examples: California, Headquarters, insecure conduit. If (interface leaves the building) then (apply special security)

地理-描述元素的位置。例如:加利福尼亚、总部、不安全的管道。如果(接口离开建筑物),则(应用特殊安全)

architectural - describes the network architects "intent" for an element. Examples: backup, trunk. If (interface is backup) then (set ifAdminStatus = down)

体系结构-描述网络架构师对元素的“意图”。示例:备份、中继。如果(接口为备份),则(设置ifAdminStatus=down)

Roles in this model are human-defined strings that can be referenced by policy code. The role table in this MIB may be used to assign role strings to elements and to view all role string assignments. Implementation-specific mechanisms may also be used to assign role strings; however, these assignments must be visible in the role table. Multiple roles may be assigned to each element. Because policy code has access to data in MIB objects that represent the current state of the system and (in contrast) role strings are more static, it is recommended that role strings not duplicate information available in MIB objects. Role strings generally should be used to describe information not accessible in MIB objects.

此模型中的角色是可由策略代码引用的人工定义字符串。此MIB中的角色表可用于将角色字符串分配给元素并查看所有角色字符串分配。特定于实现的机制也可用于分配角色字符串;但是,这些分配必须在角色表中可见。可以为每个元素分配多个角色。由于策略代码可以访问代表系统当前状态的MIB对象中的数据,并且(相比之下)角色字符串更为静态,因此建议角色字符串不要复制MIB对象中可用的信息。角色字符串通常用于描述MIB对象中无法访问的信息。

Policy scripts may inspect role assignments to make decisions based on whether an element has a particular role assigned to it.

策略脚本可以检查角色分配,根据元素是否分配了特定角色来做出决策。

The pmRoleTable allows a management station to learn what roles exist on a managed system. The management station may choose not to install policies that depend on a role that does not exist on any elements in the system. The management station can then register for notifications of new roles. Upon receipt of a pmNewRoleNotification, it may choose to install new policies that make use of that new role.

pmRoleTable允许管理站了解受管系统上存在哪些角色。管理站可以选择不安装依赖于系统中任何元素上不存在的角色的策略。然后,管理站可以注册新角色的通知。收到pmNewRoleNotification后,它可以选择安装使用该新角色的新策略。

Capabilities

能力

The capabilities table allows a management station to learn what capabilities exist on a managed system. The management station may choose not to install policies that depend on a capability that does not exist on any elements in the system. The management station can then register for notifications of new capabilities. Upon receipt of a pmNewCapabilityNotification, it may choose to install new policies that make use of that new capability.

能力表允许管理站了解受管系统上存在的能力。管理站可以选择不安装依赖于系统中任何元素上不存在的功能的策略。然后,管理站可以注册新功能的通知。收到pmNewCapabilityNotification后,它可以选择安装使用该新功能的新策略。

Time

时间

Managers may wish to define policies that are intended to apply for certain periods of time. This might mean that a policy is installed and is dormant for a period of time, becomes ready, and then later goes dormant again. Sometimes these time periods will be regular (Monday-Friday 9-5), and sometimes ad hoc. This MIB provides a schedule table that can schedule when a policy is ready and when it is dormant.

管理者可能希望定义适用于特定时期的政策。这可能意味着策略已安装并休眠一段时间,准备就绪,然后稍后再次进入休眠状态。有时这些时间段是固定的(周一至周五9-5),有时是临时的。此MIB提供了一个调度表,可以调度策略何时准备就绪以及何时处于休眠状态。

A policy manager contains the following:

策略管理器包含以下内容:

         -------------------------------------------------------
         | Policy Manager                                      |
         |                                                     |
         |   ----------------------------------------          |
         |   | Agent                                |          |
         |   |                                      |          |
         |   |  ---------------------------------   |          |
         |   |  | Policy Download and Control   |   |          |
         |   |  |   pmPolicyTable               |   |          |
         |   |  |   pmElementTypeRegTable       |   |          |
         |   |  |   pmSchedTable                |   |          |
         |   |  ---------------------------------   |          |
         |   |                                      |          |
         |   |  ---------------------------------   |          |
         |   |  | Policy Environment Control    |   |          |
         |   |  |   pmRoleTable                 |   |          |
         |   |  |   pmCapabilitiesTables        |   |          |
         |   |  ---------------------------------   |          |
         |   |                                      |          |
         |   |  ---------------------------------   |          |
         |   |  | Policy Monitoring             |   |          |
         |   |  |   pmTrackingTables            |   |          |
         |   |  |   pmDebuggingTable            |   |          |
         |   |  ---------------------------------   |          |
         |   ----------------------------------------          |
         |                                                     |
         |   --------------------------------                  |
         |   | Execution Environment        |                  |
         |   |                              |                  |
         |   |  -----------------------     |                  |
         |   |  | Policy Scheduler    |     |                  |
         |   |  -----------------------     |                  |
         |   |  -----------------------     |                  |
         |   |  | Language            |     |                  |
         |   |  -----------------------     |                  |
         |   |  -----------------------     |                  |
         |   |  | Function Library    |     |                  |
         |   |  -----------------------     |                  |
         |   --------------------------------                  |
         -------------------------------------------------------
        
         -------------------------------------------------------
         | Policy Manager                                      |
         |                                                     |
         |   ----------------------------------------          |
         |   | Agent                                |          |
         |   |                                      |          |
         |   |  ---------------------------------   |          |
         |   |  | Policy Download and Control   |   |          |
         |   |  |   pmPolicyTable               |   |          |
         |   |  |   pmElementTypeRegTable       |   |          |
         |   |  |   pmSchedTable                |   |          |
         |   |  ---------------------------------   |          |
         |   |                                      |          |
         |   |  ---------------------------------   |          |
         |   |  | Policy Environment Control    |   |          |
         |   |  |   pmRoleTable                 |   |          |
         |   |  |   pmCapabilitiesTables        |   |          |
         |   |  ---------------------------------   |          |
         |   |                                      |          |
         |   |  ---------------------------------   |          |
         |   |  | Policy Monitoring             |   |          |
         |   |  |   pmTrackingTables            |   |          |
         |   |  |   pmDebuggingTable            |   |          |
         |   |  ---------------------------------   |          |
         |   ----------------------------------------          |
         |                                                     |
         |   --------------------------------                  |
         |   | Execution Environment        |                  |
         |   |                              |                  |
         |   |  -----------------------     |                  |
         |   |  | Policy Scheduler    |     |                  |
         |   |  -----------------------     |                  |
         |   |  -----------------------     |                  |
         |   |  | Language            |     |                  |
         |   |  -----------------------     |                  |
         |   |  -----------------------     |                  |
         |   |  | Function Library    |     |                  |
         |   |  -----------------------     |                  |
         |   --------------------------------                  |
         -------------------------------------------------------
        
4. Policy-Based Management Execution Environment
4. 基于策略的管理执行环境
4.1. Terminology
4.1. 术语

Active Schedule - A schedule specifies certain times that it will be considered active. A schedule is active during those times.

活动计划-计划指定其将被视为活动的特定时间。在这些时间内,日程表处于活动状态。

Valid Policy - A valid policy is a policy that is fully configured and enabled to run. A valid policy may run unless it is linked to a schedule entry that says the policy is not currently active.

有效策略-有效策略是完全配置并启用运行的策略。有效的策略可能会运行,除非它链接到表示该策略当前未处于活动状态的计划条目。

Ready Policy - A ready policy is a valid policy that either has no schedule or is linked to a schedule that is currently active.

就绪策略-就绪策略是没有计划或链接到当前活动计划的有效策略。

Precedence Group - Multiple policies can be assigned to a precedence group with the resulting behavior that for each element, of the ready policies that match the condition, only the one with the highest precedence value will be active. For example, if there is a default bronze policy that applies to any interface and a special policy for gold interfaces, the higher precedence of the gold policy will ensure that it is run on gold ports and that the bronze policy isn't.

优先级组-可以将多个策略分配给一个优先级组,其结果行为是,对于每个元素,在符合条件的就绪策略中,只有优先级值最高的一个将处于活动状态。例如,如果存在适用于任何接口的默认青铜策略和适用于黄金接口的特殊策略,黄金策略的更高优先级将确保其在黄金端口上运行,而青铜策略不会运行。

Active Execution Context - An active execution context is a pairing of a ready policy with an element that matches the element type filter and the policy condition. If there are multiple policies in the precedence group, it is also necessary that no higher precedence policy in the group match the policy condition.

活动执行上下文-活动执行上下文是就绪策略与匹配元素类型筛选器和策略条件的元素的配对。如果优先级组中有多个策略,则该组中没有更高优先级的策略与策略条件匹配也是必要的。

Run-Time Exception (RTE) - A run-time exception is a fatal error caused in language or function processing. If, during the invocation of a script, a run-time exception occurs, execution of that script is immediately terminated. If a policyCondition experiences a run-time exception while processing an element, the element is not matched by the condition and the associated action will not be run on that element. A run-time exception can cause an entry to be added to the pmDebuggingTable and will be reflected in the pmTrackingPEInfo object.

运行时异常(RTE)-运行时异常是在语言或函数处理中导致的致命错误。如果在脚本调用期间发生运行时异常,则立即终止该脚本的执行。如果policyCondition在处理元素时遇到运行时异常,则该元素与该条件不匹配,并且关联的操作将不会在该元素上运行。运行时异常可能会导致将条目添加到pmDebuggingTable,并将反映在pmTrackingPEInfo对象中。

4.2. Execution Environment - Elements of Procedure
4.2. 执行环境-过程要素

There are several steps performed in order to execute policies in this environment:

要在此环境中执行策略,需要执行几个步骤:

- Element Discovery - Element Filtering - Policy Enforcement

- 元素发现-元素筛选-策略实施

4.3. Element Discovery
4.3. 元素发现

An element is an instance of a physical or logical entity. Examples of elements include interfaces, circuits, queues, CPUs, and processes. Sometimes various attributes of an entity will be described through tables in several standard and proprietary MIB Modules. As long as the indexing is consistent between these tables, the entity can be modeled as one element. For example, the ifTable and the dot3Stats table both contain attributes of interfaces and share the same index (ifIndex), therefore they can be modeled as one element type.

元素是物理或逻辑实体的实例。元素的示例包括接口、电路、队列、CPU和进程。有时,实体的各种属性将通过几个标准和专有MIB模块中的表来描述。只要这些表之间的索引一致,就可以将实体建模为一个元素。例如,ifTable和dot3Stats表都包含接口的属性并共享相同的索引(ifIndex),因此可以将它们建模为一种元素类型。

The Element Type Registration table allows the manager to learn what element types are being managed by the system and to register new types, if necessary. An element type is registered by providing the OID of an SNMP object (i.e., without the instance). Each SNMP instance that exists under that object is a distinct element. The index part of the discovered OID will be supplied to policy conditions and actions so that this code can inspect and configure the element. The agent can determine the index portion of discovered OIDs based on the length of the pmElementTypeRegOIDPrefix for the portion of the MIB that is being retrieved. For example, if the OIDPrefix is 'ifEntry', which has 9 subids, the index starts on the 11th subid (skipping the subidentifier for the column; e.g., ifSpeed).

元素类型注册表允许管理员了解系统正在管理的元素类型,并在必要时注册新类型。通过提供SNMP对象的OID(即,没有实例)来注册元素类型。该对象下存在的每个SNMP实例都是一个不同的元素。发现的OID的索引部分将提供给策略条件和操作,以便此代码可以检查和配置元素。代理可以根据正在检索的MIB部分的pElementTypeRegoidPrefix的长度来确定已发现OID的索引部分。例如,如果OID前缀为“ifEntry”,它有9个子ID,则索引从第11个子ID开始(跳过列的子标识符;例如ifSpeed)。

For each element that is discovered, the policy condition is called with the element's name as an argument to see whether the element is a member of the set the policy acts upon.

对于发现的每个元素,将使用元素的名称作为参数调用策略条件,以查看该元素是否是策略所作用的集合的成员。

Note that agents may automatically configure entries in this table for frequently used element types (interfaces, circuits, etc.). In particular, it may configure elements for which discovery is optimized in one or both of the following ways:

请注意,代理可以自动配置此表中经常使用的元素类型(接口、电路等)的条目。具体而言,它可以通过以下一种或两种方式配置发现优化的元素:

1. The agent may discover elements by scanning internal data structures as opposed to issuing local SNMP requests. It is possible to recreate the exact semantics described in this table even if local SNMP requests are not issued.

1. 代理可以通过扫描内部数据结构而不是发出本地SNMP请求来发现元素。即使未发出本地SNMP请求,也可以重新创建此表中描述的确切语义。

2. The agent may receive asynchronous notification of new elements (for example, "card inserted") and use that information to create elements instantly rather than through polling. A similar feature might be available for the deletion of elements.

2. 代理可以接收新元素的异步通知(例如,“插入的卡”),并使用该信息即时创建元素,而不是通过轮询。可以使用类似的功能删除元素。

Note that upon restart, the disposition of agent-installed entries is described by the pmPolicyStorageType object.

请注意,重新启动时,pmPolicyStorageType对象描述了代理安装项的处置。

A special element type "0.0" represents the "system element". "0.0" represents the single instance of the system itself and provides an execution context for policies to operate on "the system" and on MIB objects modeled as scalars. For example, "0.0" gives an execution context for policy-based selection of the operating system code version (likely modeled as a scalar MIB object). The element type "0.0" always exists. As a consequence, no actual discovery will take place and the pmElementTypeRegMaxLatency object will have no effect for the "0.0" element type. However, if the "0.0" element type is not registered in the table, policies will not be executed on the "0.0" element.

特殊元素类型“0.0”表示“系统元素”。“0.0”表示系统本身的单个实例,并为策略提供执行上下文,以便在“系统”和建模为标量的MIB对象上操作。例如,“0.0”为基于策略的操作系统代码版本选择(可能建模为标量MIB对象)提供了执行上下文。元素类型“0.0”始终存在。因此,不会发生实际的发现,pmElementTypeRegMaxLatency对象对“0.0”元素类型没有影响。但是,如果表中未注册“0.0”元素类型,则不会对“0.0”元素执行策略。

If the agent is discovering elements by polling, it should check for new elements no less frequently than pmElementTypeRegMaxLatency would dictate. When an element is first discovered, all policyConditions are run immediately, and policyConditions that match will have the associated policyAction run immediately. Subsequently, the policyCondition will be run regularly for the element, with no more than pmPolicyConditionMaxLatency milliseconds elapsing between each invocation. Note that if an implementation has the ability to be alerted immediately when a particular type of element is created, it is urged to discover that type of element in this fashion rather than through polling, resulting in immediate configuration of the discovered element.

如果代理通过轮询发现元素,它应该检查新元素的频率不低于pmElementTypeRegMaxLatency指定的频率。首次发现元素时,所有policyConditions都将立即运行,匹配的policyConditions将立即运行关联的policyAction。随后,将定期为元素运行policyCondition,每次调用之间的间隔不超过pmPolicyConditionMaxLatency毫秒。请注意,如果实现能够在创建特定类型的元素时立即发出警报,则会敦促它以这种方式而不是通过轮询来发现该类型的元素,从而立即配置所发现的元素。

4.3.1. Implementation Notes
4.3.1. 实施说明

Note that although the external behavior of this registration process is defined in terms of the walking of MIB tables, implementation strategies may differ. For example, commonly used element types (such as interface) may have purpose-built element discovery capability built-in and advertised to managers through an entry in the pmElementTypeRegTable.

请注意,尽管此注册过程的外部行为是根据MIB表的遍历定义的,但实现策略可能有所不同。例如,常用的元素类型(如接口)可能内置了专门构建的元素发现功能,并通过pmElementTypeRegTable中的条目向管理员发布。

Before registering an element type, a manager is responsible for inspecting the table to see whether it is already registered (either by the agent or by another manager). Note that entries that differ only in the last subid (which specifies which object is an entry) are effectively duplicates and should be treated as such by the manager.

在注册元素类型之前,管理器负责检查表是否已注册(由代理或其他管理器注册)。请注意,仅在最后一个子ID(指定哪个对象是条目)中不同的条目实际上是重复的,管理器应将其视为重复条目。

The system that implements the Policy-Based Management MIB may not have knowledge of the format of object identifiers in other MIB Modules. Therefore it is inappropriate for it to check these OIDs for errors. It is the responsibility of the management station to register well-formed object identifiers. For example, if an extra sub-identifier is supplied when the ifTable is registered, no

实现基于策略的管理MIB的系统可能不知道其他MIB模块中对象标识符的格式。因此,它不适合检查这些OID是否存在错误。管理站负责注册格式良好的对象标识符。例如,如果在注册ifTable时提供了额外的子标识符,则不会

elements will be discovered. Similarly, if a sub-identifier is missing, every element will be discovered numerous times (once per column) and none of the element addresses will be well formed.

元素将被发现。类似地,如果缺少子标识符,每个元素都会被发现很多次(每列一次),并且没有一个元素地址格式正确。

4.4. Element Filtering
4.4. 元素过滤

The first step in executing a policy is to see whether the policy is ready to run based on its schedule. If the pmPolicySchedule object is equal to zero, there is no schedule defined, and the policy is always ready. If the pmPolicySchedule object is non-zero, then the policy is ready only if the referenced schedule group contains at least one valid schedule entry that is active at the current time.

执行策略的第一步是查看策略是否已准备好根据其计划运行。如果pmPolicySchedule对象等于零,则没有定义计划,并且策略始终处于就绪状态。如果pmPolicySchedule对象为非零,则仅当引用的计划组包含至少一个当前处于活动状态的有效计划条目时,策略才处于就绪状态。

If the policy is ready, the next step in executing a policy is to see which elements match the policy condition. The policy condition is called once for each element and runs to completion. The element's name is the only argument that is passed to the condition code for each invocation. No state is remembered within the policy script from the previous invocation of 'this element' or from the previous invocation of the policy condition, except for state accessible through library functions. Two notable examples of these are the scratchpad functions, which explicitly provide for storing state, and the SNMP functions, which can store state in local or remote MIB objects. If any run-time exception occurs, the condition will terminate immediately for 'this element'. If the condition returns non-zero, the corresponding policy action will be executed for 'this element'.

如果策略准备就绪,执行策略的下一步是查看哪些元素与策略条件匹配。对每个元素调用一次策略条件,并运行到完成。元素的名称是传递给每个调用的条件代码的唯一参数。在策略脚本中,不会记住以前调用“this element”或以前调用策略条件时的状态,通过库函数访问的状态除外。其中两个显著的例子是scratchpad函数,它显式地提供了存储状态的功能,以及SNMP函数,它可以在本地或远程MIB对象中存储状态。如果发生任何运行时异常,则“this element”的条件将立即终止。如果条件返回非零,则将对“this element”执行相应的策略操作。

If an element matches a condition and it had not matched that condition the last time it was checked (or if it is a newly discovered element), the associated policyAction will be executed immediately. If the element had matched the condition at the last check, it will remain in the set of elements whose policyAction will be run within the policyActionMaxLatency.

如果某个元素与某个条件匹配,而在上次检查该元素时它没有与该条件匹配(或者如果它是新发现的元素),则关联的policyAction将立即执行。如果元素在上次检查时已匹配条件,则它将保留在其policyAction将在policyActionMaxLatency内运行的元素集中。

4.4.1. Implementation Notes
4.4.1. 实施说明

Whether policy conditions are multi-tasked is an implementation-dependent matter. Each condition/element combination is conceptually its own process and can be scheduled sequentially, or two or more could be run simultaneously.

策略条件是否是多任务的取决于实现。每个条件/元素组合在概念上都是自己的流程,可以按顺序安排,也可以同时运行两个或多个。

4.5. Policy Enforcement
4.5. 政策执行

For each element that has returned non-zero from the policy condition, the corresponding policy action is called. The element's name is the only argument that is passed to the policy action for each invocation. Except for state accessible from library functions,

对于从策略条件返回非零的每个元素,将调用相应的策略操作。元素的名称是每次调用传递给策略操作的唯一参数。除了可从库函数访问的状态,

no state is remembered from the policy condition evaluation, or from the previous condition/action invocation of 'this element' or from the previous invocation of the policy condition or action on any other element. If any run-time exception occurs, the action will terminate immediately for 'this element'.

从策略条件评估、或从“this element”的上一次条件/操作调用、或从任何其他元素的上一次策略条件或操作调用中,不会记住任何状态。如果发生任何运行时异常,则“this element”的操作将立即终止。

4.5.1. Implementation Notes
4.5.1. 实施说明

How policy actions are multi-tasked is an implementation-dependent matter. Each condition/element combination is conceptually its own process and can be scheduled sequentially, or two or more could be run simultaneously.

政策行动如何多任务执行是一个依赖于实施的问题。每个条件/元素组合在概念上都是自己的流程,可以按顺序安排,也可以同时运行两个或多个。

5. The PolicyScript Language
5. PolicyScript语言

Policy conditions and policy actions are expressed with the PolicyScript language. The PolicyScript language is designed to be a small interpreted language that is simple to understand and implement; it is designed to be appropriate for writing small scripts that make up policy conditions and actions.

策略条件和策略操作用PolicyScript语言表示。PolicyScript语言设计为一种易于理解和实现的小型解释语言;它适合于编写构成策略条件和操作的小脚本。

PolicyScript is intended to be familiar to programmers that know one of several common languages, including Perl and C. Nominally, policyScript is a subset of the C language; however, it was desirable to have access to C++'s operator overloading (solely to aid in documenting the language). Therefore, PolicyScript is defined formally as a subset of the C++ language in which many of the operators are overloaded as part of the "var" class. Note, however, that a PolicyScript program cannot further overload operators, as the syntax to specify overloading is not part of the PolicyScript syntax. A subset was used to provide for easy development of low-cost interpreters of PolicyScript and to take away language constructs that are peculiar to the C/C++ languages. For example, it is expected that both C and Perl programmers will understand the constructs allowed in PolicyScript.

PolicyScript的目的是让熟悉几种常见语言之一(包括Perl和C)的程序员熟悉。名义上,PolicyScript是C语言的一个子集;然而,最好能够访问C++的运算符重载(仅用于帮助记录语言)。因此,策略脚本被正式定义为C++语言的子集,其中许多操作符被重载为“var”类的一部分。但是,请注意,PolicyScript程序不能进一步重载运算符,因为指定重载的语法不是PolicyScript语法的一部分。一个子集用于方便地开发低成本的PolicyScript解释器,并去除C/C++语言特有的语言结构。例如,C和Perl程序员都应该理解PolicyScript中允许的结构。

Some examples of the C/C++ features that are not available are function definitions, pointer variables, structures, enums, typedefs, floating point and pre-processor functions (except for comments).

一些C/C++功能不可用的示例包括函数定义、指针变量、结构、枚举、typedef、浮点和预处理器函数(注释除外)。

This language is formally defined as a subset of ISO C++ [10] but only allows constructs that may be expressed in the Extended Backus-Naur Form (EBNF) documented here. This is because although EBNF doesn't fully specify syntactical rules (it allows constructs that are invalid) and doesn't specify semantic rules, it can successfully be used to define the subset of the language that is required for

这种语言被正式定义为ISO C++的子集[10 ],但只允许在扩展巴科斯NoURR表单(EBNF)中表达的构造。这是因为尽管EBNF没有完全指定语法规则(它允许无效的构造),也没有指定语义规则,但它可以成功地用于定义所需的语言子集

conformance to this specification. Unless explicitly described herein, the meaning of any construct expressed in the EBNF can be found by reference to the ISO C++ standard.

符合本规范。除非本文中明确描述,EBNF中表达的任何构造的含义可以通过参照ISOC++标准找到。

The use of comments and newlines are allowed and encouraged in order to promote readability of PolicyScript code. Comments begin with '/*' and end with '*/' or begin with '//' and go until the end of the line.

为了提高PolicyScript代码的可读性,允许并鼓励使用注释和换行符。注释以“/*”开头,以“*/”结尾,或以“//”开头,一直到行尾。

One subset is not expressible in the EBNF syntax: all variables within an instance of a PolicyScript script are within the same scope. In other words, variables defined in a block delimited with '{' and '}' are not in a separate scope from variables in the enclosing block.

一个子集在EBNF语法中不可表达:PolicyScript脚本实例中的所有变量都在同一范围内。换句话说,在以“{”和“}”分隔的块中定义的变量与封闭块中的变量不在单独的作用域中。

PolicyScript code must be expressed in the ASCII character set.

PolicyScript代码必须以ASCII字符集表示。

In the EBNF used here, terminals are character set members (singly or in a sequence) that are enclosed between two single-quote characters or described as a phrase between '<' and '>' characters. Nonterminals are a sequence of letters and underscore characters. A colon (:) following a nonterminal introduces its definition, a production. In a production, a '|' character separates alternatives. The '(' and ')' symbols group the enclosed items. The '[' and ']' symbols indicate that the enclosed items are optional. A '?' symbol following an item indicates that the item is optional. A '*' symbol following an item indicates that the item is repeated zero, one, or more times. A '+' symbol following an item indicates that the item is repeated one or more times. The symbol '--' begins a comment that ends at the end of the line.

在这里使用的EBNF中,终端是字符集成员(单个或按顺序),包含在两个单引号字符之间或描述为“<”和“>”字符之间的短语。非终结符是一系列字母和下划线字符。非终结符后面的冒号(:)引入了它的定义,即产生式。在产品中,一个“|”字符分隔备选方案。“(”和“)”符号将所附项目分组。“[”和“]”符号表示所附项目是可选的。项目后面的“?”符号表示该项目是可选的。项目后面的“*”符号表示该项目重复了零次、一次或多次。项目后面的“+”符号表示该项目重复一次或多次。符号“--”开始一条注释,该注释在行的末尾结束。

5.1. Formal Definition
5.1. 形式定义

The PolicyScript language follows the syntax and semantics of ISO C++ [10], but is limited to that which can be expressed in the EBNF below.

策略脚本语言遵循ISOC++(10)的语法和语义,但限于在EBNF下面可以表达的语言。

The following keywords are reserved words and cannot be used in any policy script. This prevents someone from using a common keyword in another language as an identifier in a script, thereby confusing the meaning of the script. The reserved words are:

以下关键字是保留字,不能在任何策略脚本中使用。这可以防止有人在脚本中使用另一种语言中的公共关键字作为标识符,从而混淆脚本的含义。保留字为:

auto, case, char, const, default, do, double, enum, extern, float, goto, inline, int, long, register, short, signed, sizeof, static, struct, switch, typedef, union, unsigned, void, and volatile.

auto、case、char、const、default、do、double、enum、extern、float、goto、inline、int、long、register、short、sizeof、static、struct、switch、typedef、union、unsigned、void和volatile。

Any syntax error, use of a reserved keyword, reference to an unknown identifier, improper number of function arguments, error in coercing an argument to the proper type, exceeding local limitations on string length, or exceeding local limitations on the total amount of storage used by local variables will cause an RTE.

任何语法错误、使用保留关键字、引用未知标识符、函数参数数量不正确、将参数强制为正确类型时出错、字符串长度超过本地限制或本地变量使用的存储总量超过本地限制,都将导致RTE。

PolicyScript permits comments using the comment delimiters, '/*' to '*/', or the start of comment symbol '//'.

PolicyScript允许使用注释分隔符“/*”到“*/”或注释开头符号“//”进行注释。

-- Lexical Grammar

--词汇语法

   letter:       '_' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
               | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm'
               | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't'
               | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'
               | 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
               | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M'
               | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T'
               | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'
        
   letter:       '_' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
               | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm'
               | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't'
               | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'
               | 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
               | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M'
               | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T'
               | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'
        

digit: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'

数字:“0”|“1”|“2”|“3”|“4”|“5”|“6”|“7”|“8”|“9”

non_zero: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'

非零:“1”|“2”|“3”|“4”|“5”|“6”|“7”|“8”|“9”

oct_digit: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7'

十月数字:“0”|“1”|“2”|“3”|“4”|“5”|“6”|“7”

hex_digit: digit | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F'

十六进制数字:数字|“a”|“b”|“c”|“d”|“e”|“f”|“a”|“b”|“c”|“d”|“e”|“f”

   escape_seq:    '\''   |   '\"'   |   '\?'   |   '\\'
                | '\a'   |   '\b'   |   '\f'   |   '\n'
                | '\r'   |  '\t'    |   '\v'
                | '\' oct_digit+    | '\x' hex_digit+
        
   escape_seq:    '\''   |   '\"'   |   '\?'   |   '\\'
                | '\a'   |   '\b'   |   '\f'   |   '\n'
                | '\r'   |  '\t'    |   '\v'
                | '\' oct_digit+    | '\x' hex_digit+
        

non_quote: Any character in the ASCII character set except single quote ('), double quote ("), backslash ('\'), or newline.

非引号:ASCII字符集中除单引号(')、双引号(“)、反斜杠(“\”)或换行符以外的任何字符。

c_char: non_quote | '"' | escape_seq

c|char:non|quote |'“| escape|seq

string_literal: '"' s_char* '"'

字符串_literal:“'s_char*””

s_char: non_quote | ''' | escape_seq

s|char:non|quote |“”| escape|seq

char_constant: ''' c_char '''

字符常量:“”“c字符”

decimal_constant: non_zero digit*

十进制常数:非零位*

octal_constant: '0' oct_digit*

八进制常数:“0”oct\u位*

hex_constant: ( '0x' | '0X' ) hex_digit+

十六进制常数:('0x'|'0x')十六进制数字+

integer_constant: decimal_constant | octal_constant | hex_constant

整数常数:十进制常数|八进制常数|十六进制常数

identifier: letter ( letter | digit )*

标识符:字母(字母|数字)*

-- Phrase Structure Grammar

--短语结构语法

-- Expressions

--表情

primary_expr: identifier | integer_constant | char_constant | string_literal | '(' expression ')'

主表达式:标识符|整数|常量|字符|常量|字符串|文本|'(“表达式”)'

   postfix_expr:      primary_expr
                    | identifier '(' argument_expression_list? ')'
                    | postfix_expr '++'
                    | postfix_expr '--'
                    | postfix_expr '[' expression ']'
        
   postfix_expr:      primary_expr
                    | identifier '(' argument_expression_list? ')'
                    | postfix_expr '++'
                    | postfix_expr '--'
                    | postfix_expr '[' expression ']'
        

argument_expression_list: assignment_expr | argument_expression_list ',' assignment_expr

参数表达式列表:赋值表达式列表、参数表达式列表、赋值表达式列表

unary_expr: postfix_expr | unary_op unary_expr

一元表达式:后缀

   unary_op:          '+' | '-' | '~' | '!' | '++' | '--'
        
   unary_op:          '+' | '-' | '~' | '!' | '++' | '--'
        

binary_expr: unary_expr | binary_expr binary_op unary_expr

二进制表达式:一元表达式|二进制表达式二进制表达式

   binary_op:       '||' | '&&' | '|'  | '^'  | '&'  | '!='
                  | '==' | '>=' | '<=' | '>'  | '<'  | '>>'
                  | '<<' |  '-' | '+'  | '%'  | '/'  |  '*'
        
   binary_op:       '||' | '&&' | '|'  | '^'  | '&'  | '!='
                  | '==' | '>=' | '<=' | '>'  | '<'  | '>>'
                  | '<<' |  '-' | '+'  | '%'  | '/'  |  '*'
        

assignment_expr: binary_expr | unary_expr assignment_op assignment_expr

赋值表达式:二进制表达式|一元表达式赋值运算赋值表达式

   assignment_op:     '=' | '*='  | '/=' | '%=' | '+=' | '-='
                  | '<<=' | '>>=' | '&=' | '^=' | '|='
        
   assignment_op:     '=' | '*='  | '/=' | '%=' | '+=' | '-='
                  | '<<=' | '>>=' | '&=' | '^=' | '|='
        

expression: assignment_expr | expression ',' assignment_expr

表达式:赋值表达式“表达式”,“赋值表达式”

-- Declarations

--声明

declaration: 'var' declarator_list ';'

声明:“var”声明器_列表“;”

declarator_list: init_declarator | declarator_list ',' init_declarator

声明器列表:init_声明器、声明器列表、init_声明器

init_declarator: identifier [ '=' assignment_expr ]

init_声明符:标识符['='赋值\u expr]

-- Statements

--声明

   statement:   declaration
              | compound_statement
              | expression_statement
              | selection_statement
              | iteration_statement
              | jump_statement
        
   statement:   declaration
              | compound_statement
              | expression_statement
              | selection_statement
              | iteration_statement
              | jump_statement
        
   compound_statement:    '{' statement* '}'
        
   compound_statement:    '{' statement* '}'
        

expression_statement: expression? ';'

表达式\语句:表达式?;'

selection_statement: 'if' '(' expression ')' statement | 'if' '(' expression ')' statement 'else' statement

选择_语句:“if”(“表达式”)语句|“if”(“表达式”)语句“else”语句

iteration_statement: 'while' '(' expression ')' statement | 'for' '(' expression? ';' expression? ';' expression? ')' statement

迭代_语句:“while”“(“表达式”)”语句|”“for”“(“表达式”;“表达式”;“表达式”)”语句

jump_statement: 'continue' ';' | 'break' ';' | 'return' expression? ';'

跳转语句:“继续”;|”打断“;”|”返回'expression';'

-- Root production

--根系生产

PolicyScript: statement*

PolicyScript:statement*

5.2. Variables
5.2. 变量

To promote shorter scripts and ease in writing them, PolicyScript provides a loosely typed data class, "var", that can store both integer and string values. The native C++ types (char, int, etc.) are thus unnecessary and have not been carried into the subset that comprises this language. The semantics of the "var" type are modeled after those of ECMAScript[17].

为了推广较短的脚本并简化它们的编写,PolicyScript提供了一个松散类型的数据类“var”,它可以存储整型值和字符串值。因此,本机C++类型(char,int等)不需要,并且没有被包含到包含该语言的子集中。“var”类型的语义是按照ECMAScript的语义建模的[17]。

For example:

例如:

         var number = 0, name = "IETF";
        
         var number = 0, name = "IETF";
        

This language will be executed in an environment where the following typedef is declared. (Note that this typedef will not be visible in the policyCondition or policyAction code.)

此语言将在声明以下typedef的环境中执行。(请注意,此typedef在policyCondition或policyAction代码中不可见。)

typedef ... var;

类型定义。。。var;

Although this declaration is expressed here as a typedef, the 'typedef' keyword itself is not available to be used in PolicyScript code.

尽管此声明在此处表示为typedef,但“typedef”关键字本身不能在PolicyScript代码中使用。

5.2.1. The Var Class
5.2.1. Var类

A value is an entity that takes on one of two types: string or integer.

值是采用以下两种类型之一的实体:字符串或整数。

The String type is the set of all finite ordered sequences of zero or more 8-bit unsigned integer values ("elements"). The string type can store textual data as well as binary data sequences. Each element is considered to occupy a position within the sequence. These positions are indexed with nonnegative integers. The first element (if any) is at position 0, the next element (if any) at position 1, and so on. The length of a string is the number of elements (i.e., 8-bit values) within it. The empty string has length zero and therefore contains no elements.

字符串类型是零个或多个8位无符号整数值(“元素”)的所有有限有序序列的集合。字符串类型可以存储文本数据以及二进制数据序列。每个元素被认为在序列中占据一个位置。这些位置用非负整数索引。第一个元素(如果有)位于位置0,下一个元素(如果有)位于位置1,依此类推。字符串的长度是其中的元素数(即8位值)。空字符串的长度为零,因此不包含任何元素。

The integer type is the set of all integer values in the range -9223372036854775808 (-2^63) to 18446744073709551615 (2^64-1). If an integer operation would cause a (positive) overflow, then the result is returned modulo 2^64. If an integer operation would cause a (negative) underflow, then the result is undefined. Integer division rounds toward zero.

整数类型是-9223372036854775808(-2^63)到18446744073709551615(2^64-1)范围内所有整数值的集合。如果整数运算会导致(正)溢出,则返回的结果为模2^64。如果整数运算会导致(负)下溢,则结果未定义。整数除法向零舍入。

Prior to initialization, a var object has type String and a length of zero.

在初始化之前,var对象的类型为String,长度为零。

The policy script runtime system performs automatic type conversion as needed. To clarify the semantics of certain constructs it is useful to define a set of conversion operators: ToInteger(), ToString(), ToBoolean(), and Type(). These operators are not a part of the language; they are defined here to aid the specification of the semantics of the language. The conversion operators are polymorphic; that is, they can accept a value of any standard type.

策略脚本运行时系统根据需要执行自动类型转换。为了澄清某些构造的语义,定义一组转换运算符非常有用:ToInteger()、ToString()、ToBoolean()和Type()。这些运算符不是语言的一部分;这里定义它们是为了帮助说明语言的语义。转换算子是多态的;也就是说,它们可以接受任何标准类型的值。

ToInteger

托因特尔

The operator ToInteger converts its argument to a value of type Integer according to the following table:

运算符ToInteger根据下表将其参数转换为整型值:

Integer The result equals the input argument (no conversion). String See grammar and note below. integer_constant The result equals the input argument (no conversion). string_literal See grammar and note below. char_constant See grammar and note below.

整数结果等于输入参数(无转换)。字符串请参见下面的语法和注释。整数_常量结果等于输入参数(无转换)。字符串文字请参见下面的语法和注释。char_常量见下面的语法和注释。

ToInteger Applied to Strings

应用于字符串的ToInteger

ToInteger applied to the String Type string_literal and to char_constants applies the following grammar to the input. If the grammar cannot interpret the string as an expansion of numeric_string, then an RTE is generated. Note that a numeric_string that is empty or contains only white space is converted to 0.

应用于字符串类型String_literal和char_常量的ToInteger将以下语法应用于输入。如果语法无法将字符串解释为数字字符串的扩展,则生成RTE。请注意,空的或仅包含空白的数字_字符串将转换为0。

-- EBNF for numeric_string

--数字字符串的EBNF

   numeric_string : white_space* numeric? white_space*
        
   numeric_string : white_space* numeric? white_space*
        
   white_space :      <TAB> |  <SP> |  <NBSP> |  <FF> |  <VT>
                    | <CR>  |  <LF> |  <LS>   |  <PS> |  <USP>
        
   white_space :      <TAB> |  <SP> |  <NBSP> |  <FF> |  <VT>
                    | <CR>  |  <LF> |  <LS>   |  <PS> |  <USP>
        

numeric : signed_decimal | hex_constant | octal_constant | enum_decimal

数字:有符号十进制数|十六进制常数|八进制常数|枚举十进制数

signed_decimal: [ '-' | '+' ] decimal_constant

有符号小数:['-'|'+']十进制常数

   enum_decimal:    [ letter | digit | '-' ]* '(' decimal_constant ')'
        
   enum_decimal:    [ letter | digit | '-' ]* '(' decimal_constant ')'
        
   -- decimal_constant, hex_constant, and octal_constant are defined
   -- in the PolicyScript EBNF described earlier.
        
   -- decimal_constant, hex_constant, and octal_constant are defined
   -- in the PolicyScript EBNF described earlier.
        

Note that when the enum_decimal form is converted, the sequence of characters before the parenthesis and the pair of parenthesis themselves are completely ignored, and the decimal_constant inside the parenthesis is converted. Thus, "frame-relay(32)" translates to the integer 32.

请注意,转换enum_十进制形式时,括号前的字符序列和括号对本身将被完全忽略,括号内的十进制_常量将被转换。因此,“帧中继(32)”转换为整数32。

Although this will make the script more readable than using the constant "32", the burden is on the code writer to be accurate, as "ethernet-csmacd(32)" and "frame-relay(999)" will also be accepted.

虽然这将使脚本比使用常量“32”更具可读性,但代码编写者的负担是准确,因为“以太网csmacd(32)”和“帧中继(999)”也将被接受。

ToString

托斯特林

The operator ToString converts its argument to a value of type String according to the following table:

运算符ToString根据下表将其参数转换为String类型的值:

Integer Return the string containing the decimal representation of the input argument in the form of signed_decimal, except that no leading '+' will be used. String Return the input argument (no conversion) integer_constant Return the string containing the decimal representation of the input argument in the form of signed_decimal except that no leading '+' will be used. string_literal Return the input argument (no conversion) char_constant Return the string of length one containing the value of the input argument.

Integer返回包含输入参数的十进制表示形式的字符串,形式为带符号的_decimal,但不使用前导“+”。String Return输入参数(无转换)integer_常量以有符号_decimal的形式返回包含输入参数十进制表示形式的字符串,但不使用前导“+”。string_literal返回输入参数(无转换)char_常量返回包含输入参数值的长度为1的字符串。

ToBoolean

托布利安

The operator ToBoolean converts its argument to a value of type Integer according to the following table:

运算符ToBoolean根据下表将其参数转换为整型值:

Integer The result is 0 if the argument is 0. Otherwise the result is 1. String The results is 0 if the argument is the empty string. Otherwise the result is 1. integer_constant The result is 0 if the argument is 0. Otherwise the result is 1. string_literal The result is 0 if the argument is the empty string. Otherwise the result is 1. char_constant The result is 1.

整数如果参数为0,则结果为0。否则,结果为1。字符串如果参数为空字符串,则结果为0。否则,结果为1。整数\常量如果参数为0,则结果为0。否则,结果为1。string\u literal如果参数为空字符串,则结果为0。否则,结果为1。char_常数结果为1。

Operators

操作员

The rules below specify the type conversion rules for the various operators.

下面的规则指定了各种运算符的类型转换规则。

      A++:   A = ToInteger(A); A++;
      A--:   A = ToInteger(A); A--;
      ++A:   A = ToInteger(A); ++A;
      --A:   A = ToInteger(A); --A;
      +A:    ToInteger(A);
      -A:     -1 * ToInteger(A);
      ~A:    ToInteger(A);
      !A:    !ToBoolean(A);
      A * B, A - B, A & B, A ^ B , A | B, A << B, A >> B:
             ToInteger(A) <operator> ToInteger(B)
        
      A++:   A = ToInteger(A); A++;
      A--:   A = ToInteger(A); A--;
      ++A:   A = ToInteger(A); ++A;
      --A:   A = ToInteger(A); --A;
      +A:    ToInteger(A);
      -A:     -1 * ToInteger(A);
      ~A:    ToInteger(A);
      !A:    !ToBoolean(A);
      A * B, A - B, A & B, A ^ B , A | B, A << B, A >> B:
             ToInteger(A) <operator> ToInteger(B)
        

A / B, A % B: if (ToInteger(B) == 0) RTE, terminate; else ToInteger(A) <operator> ToInteger(B) A + B: if (Type(A) == String || Type(B) == String) ToString(A) concatenated with ToString(B) else A + B Compound Assignment (<operator>=): Simply follow rules above. Note that type of LHS (Left Hand Side) may be changed as a result.

A/B,A%B:如果(ToInteger(B)==0)RTE,则终止;else-ToInteger(A)<operator>ToInteger(B)A+B:if(Type(A)==String | | Type(B)==String)ToString(A)与ToString(B)相连,else-A+B复合赋值(<operator>=):只需遵循上述规则即可。请注意,LHS(左侧)的类型可能会因此发生变化。

      A < B, A > B, A <= B, A >= B, A == B, A != B:
             if (Type(A) == String && Type(B) == String)
                 lexically compare strings with strcmp() logic
             else
                 ToInteger(A) <operator> ToInteger(B)
       A && B:
              if (ToBoolean(A))
                  ToBoolean(B);
              else
                  false;
       A || B:
              if (ToBoolean(A))
                  true;
        
      A < B, A > B, A <= B, A >= B, A == B, A != B:
             if (Type(A) == String && Type(B) == String)
                 lexically compare strings with strcmp() logic
             else
                 ToInteger(A) <operator> ToInteger(B)
       A && B:
              if (ToBoolean(A))
                  ToBoolean(B);
              else
                  false;
       A || B:
              if (ToBoolean(A))
                  true;
        

else ToBoolean(B);

否则,ToBoolean(B);

if(A): if (ToBoolean(A)) while(A): while(ToBoolean(A)) for(...; A; ...): for(...; ToBoolean(A); ...)

if(A):if(ToBoolean(A))while(ToBoolean(A))for(…;A;…):for(…;ToBoolean(A);…)

       A[B] as a RHS (Right Hand Side) value:
             if (Type(A) != String
                  || ToInteger(B) >= strlen(A))
                RTE, terminate;
             A[ ToInteger(B) ]
             The contents are returned as a string of length one
        
       A[B] as a RHS (Right Hand Side) value:
             if (Type(A) != String
                  || ToInteger(B) >= strlen(A))
                RTE, terminate;
             A[ ToInteger(B) ]
             The contents are returned as a string of length one
        
        A[B] = C as a LHS value:
             if (Type(A) != String
                  || ToInteger(B) >= strlen(A))
        
        A[B] = C as a LHS value:
             if (Type(A) != String
                  || ToInteger(B) >= strlen(A))
        
                RTE, terminate;
             if (strlen(ToString(C)) == 0)
                RTE, terminate
             A[ ToInteger(B) ] = First octet of ToString(C)
        
                RTE, terminate;
             if (strlen(ToString(C)) == 0)
                RTE, terminate
             A[ ToInteger(B) ] = First octet of ToString(C)
        

Note that this is only applicable in a simple assignment.

请注意,这仅适用于简单的赋值。

For example, in the expression

例如,在表达式中

"getVar("ifSpeed.1") < 128000"

“getVar(“ifSpeed.1”)<128000”

getVar always returns a string and '128000' is implicitly an integer. The rules for '<' dictate that if either argument is an integer then a 'numeric less than' is performed on ToInteger(A) and ToInteger(B).

getVar始终返回字符串,“128000”隐式为整数。“<”的规则规定,如果任一参数是整数,则对ToInteger(a)和ToInteger(B)执行“数值小于”。

If "getVar("ifSpeed.1")" returns "64000", the expression can be translated to:

如果“getVar(“ifSpeed.1”)”返回“64000”,则表达式可以转换为:

        ToInteger("64000") < ToInteger(128000); or,
        64000 < 128000; or,
        True
        
        ToInteger("64000") < ToInteger(128000); or,
        64000 < 128000; or,
        True
        
5.3. PolicyScript QuickStart Guide
5.3. PolicyScript快速入门指南

PolicyScript is designed so that programmers fluent in other languages can quickly begin to write scripts.

PolicyScript的设计目的是让精通其他语言的程序员能够快速开始编写脚本。

One way to become familiar with a language is to see it in action. The following nonsensical script exercises most of the PolicyScript constructs (though it skips some usage options and many arithmetic operators).

熟悉一门语言的一种方法是观察它的实际运用。下面的无意义脚本练习了大部分PolicyScript构造(尽管它跳过了一些使用选项和许多算术运算符)。

      var x, index = 7, str = "Hello World", oid = "ifSpeed.";
        
      var x, index = 7, str = "Hello World", oid = "ifSpeed.";
        
      x = 0;
      while(x < 10){
          if (str < "Goodbye") /* string comparison */
              continue;
          else
              break;
          x++;
      }
      if (oidlen(oid) == 10)
          oid += "." + index; // append index to oid
      for(x = 0; x < 7; x++){
            str += "a";
        
      x = 0;
      while(x < 10){
          if (str < "Goodbye") /* string comparison */
              continue;
          else
              break;
          x++;
      }
      if (oidlen(oid) == 10)
          oid += "." + index; // append index to oid
      for(x = 0; x < 7; x++){
            str += "a";
        
            var y = 12;
            index = ((x * 7) + y) % 3;
            if (str[6] == 'W')
                return index;
      }
      return;
        
            var y = 12;
            index = ((x * 7) + y) % 3;
            if (str[6] == 'W')
                return index;
      }
      return;
        

The following examples are more practical:

以下示例更为实用:

   For a condition:
      // Return 1 if this is an interface and it is tagged
      // with the role "gold"
      return (inSubtree(elementName(), "ifEntry")
          && roleMatch("gold"))
        
   For a condition:
      // Return 1 if this is an interface and it is tagged
      // with the role "gold"
      return (inSubtree(elementName(), "ifEntry")
          && roleMatch("gold"))
        

A condition/action pair: First, register the Host Resources MIB hrSWRunEntry as a new element in the pmElementTypeRegTable. This will cause the policy to run for every process on the system. The token '$*' will be replaced by the script interpreter with a process index (see Section 7 for a definition of the '$*' token).

条件/操作对:首先,在pmElementTypeRegTable中将主机资源MIB hrSWRunEntry注册为新元素。这将导致为系统上的每个进程运行策略。令牌“$*”将由脚本解释器替换为进程索引(有关“$*”令牌的定义,请参阅第7节)。

   The condition:
      // if it's a process and it's an application and it's
      // consumed more than 5 minutes of CPU time
      return (inSubtree(elementName(), "hrSWRunEntry")
              && getVar("hrSWRunType.$*") == 4  // app, not OS or driver
              && getVar("hrSWRunPerfCPU.$*") > 30000) // 300 seconds
        
   The condition:
      // if it's a process and it's an application and it's
      // consumed more than 5 minutes of CPU time
      return (inSubtree(elementName(), "hrSWRunEntry")
              && getVar("hrSWRunType.$*") == 4  // app, not OS or driver
              && getVar("hrSWRunPerfCPU.$*") > 30000) // 300 seconds
        
   The action:
      // Kill it
      setVar("hrSWRunStatus.$*", 4, Integer); // invalid(4) kills it
        
   The action:
      // Kill it
      setVar("hrSWRunStatus.$*", 4, Integer); // invalid(4) kills it
        

A more substantial action to start an RMON2 host table on interfaces that match the condition:

在符合条件的接口上启动RMON2主机表的更重要的操作:

var pdu, index;

var-pdu,指数;

      pdu = newPDU();
      writeVar(pdu, 0, "hlHostControlDataSource.*",
               "ifIndex." + ev(0), Oid);
      writeVar(pdu, 1, "hlHostControlNlMaxDesiredEntries.*", 1000,
               Integer);
      writeVar(pdu, 2, "hlHostControlAlMaxDesiredEntries.*", 1000,
               Integer);
      writeVar(pdu, 3, "hlHostControlOwner.*", "policy", String);
        
      pdu = newPDU();
      writeVar(pdu, 0, "hlHostControlDataSource.*",
               "ifIndex." + ev(0), Oid);
      writeVar(pdu, 1, "hlHostControlNlMaxDesiredEntries.*", 1000,
               Integer);
      writeVar(pdu, 2, "hlHostControlAlMaxDesiredEntries.*", 1000,
               Integer);
      writeVar(pdu, 3, "hlHostControlOwner.*", "policy", String);
        
      writeVar(pdu, 4, "hlHostControlStatus.*", "active(1)", Integer);
      if (createRow(pdu, 5, 4, 20, 65535, index) == 0
          || index == -1)
          return;
        
      writeVar(pdu, 4, "hlHostControlStatus.*", "active(1)", Integer);
      if (createRow(pdu, 5, 4, 20, 65535, index) == 0
          || index == -1)
          return;
        

Because PolicyScript is a least common denominator, it contains nothing that would astonish programmers familiar with C, C++, Perl, Tcl, JavaScript, or Python. Although a new programmer may attempt to use language constructs that aren't available in PolicyScript, s/he should be able to understand any existing PolicyScript and will likely know how to use anything that is valid in PolicyScript. The lists below quickly enumerate the changes of note for programmers coming from some particular languages. These lists won't describe the unavailable constructs, but it is easy to see from the definition above what is available.

因为策略脚本是最不常见的分母,它包含的东西不会让熟悉C、C++、Perl、Tcl、JavaScript或Python的程序员感到惊讶。尽管新程序员可能会尝试使用PolicyScript中不可用的语言结构,但他/她应该能够理解任何现有的PolicyScript,并且可能知道如何使用PolicyScript中有效的任何内容。下面的列表快速列举了来自某些特定语言的程序员需要注意的变化。这些列表不会描述不可用的构造,但从上面的定义可以很容易地看出哪些是可用的。

5.3.1. Quickstart for C Programmers
5.3.1. C程序员的快速入门

- Character constants (i.e., 'c') are treated as one-character strings, not as integers. So operations such as ('M' - 'A') or (x + 'A') will not perform as expected. - Functions can change the value of arguments even though they are not pointers (or called like '&arg'). - All variables are in the same scope.

- 字符常量(即“c”)被视为一个字符串,而不是整数。因此,诸如('M'-'A')或(x+'A')之类的操作将无法按预期执行。-函数可以更改参数的值,即使它们不是指针(或像“&arg”一样调用)所有变量都在同一范围内。

5.3.2. Quickstart for Perl Programmers
5.3.2. Perl程序员的快速入门

- Comments are '/* comment */' and '// till end of line', not '#'. - No need to put a '$' in front of variables. - Strings are compared with ==, <=, <, etc. (details in Sec. 6.2.1). - Strings are concatenated with '+' (details in Sec. 6.2.1). - No variable substitution in "" strings. '' strings are 1 char only. - Variables must be declared before use (but no type is necessary). - All variables are in the same scope.

- 注释是“/*注释*/”和“//直到行末”,而不是“#”。-不需要在变量前面加“$”。-字符串与==、<=、<等进行比较(详情见第6.2.1节)字符串与“+”相连(详情见第6.2.1节)“字符串”中没有变量替换字符串仅为1个字符。-使用前必须声明变量(但不需要类型)。-所有变量都在同一范围内。

5.3.3. Quickstart for TCL Programmers
5.3.3. TCL程序员快速入门

- Comments are '/* comment */' and '// till end of line', not '#'. - No need to put a '$' in front of variables. - Function calls are func-name(arg1, arg2, ...). - Square braces [] don't interpret their contents. - Double quotes "" surround a string, but no substitutions are performed ("" is like { } in TCL ). - Statements are terminated by a semicolon (;). - Instead of "Set a b", use "b = a;". - Strings are concatenated with '+' (details in Sec. 6.2.1). - All variables are in the same scope.

- 注释是“/*注释*/”和“//直到行末”,而不是“#”。-不需要在变量前面加“$”。-函数调用是函数名(arg1,arg2,…)-方括号[]不解释其内容。-双引号“”环绕字符串,但不执行替换(“”类似于TCL中的{})。-语句以分号(;)结尾使用“b=a;”,而不是“设置b”——字符串与“+”相连(详情见第6.2.1节)所有变量都在同一范围内。

5.3.4. Quickstart for Python Programmers
5.3.4. Python程序员的快速入门

- Comments are '/* comment */' and '// till end of line', not '#'. - Single quotes can be used only for single-character strings ('a'). - Indentation doesn't matter. Braces { } define blocks. - Variables must be declared before use (but no type is necessary). - The expressions for if and while are always surrounded by parenthesis, as in "if (x < 5)". - 'for' syntax is "for(expression; expression; expression)" (see EBNF). - All variables are in the same scope.

- 注释是“/*注释*/”和“//直到行末”,而不是“#”。-单引号只能用于单字符串('a')。-缩进没关系。大括号{}定义块。-使用前必须声明变量(但不需要类型)。-if和while的表达式总是用括号括起来,如“if(x<5)”。-'for'语法为“for(expression;expression;expression)”(参见EBNF)所有变量都在同一范围内。

5.3.5. Quickstart for JavaScript/ECMAScript/JScript Programmers
5.3.5. JavaScript/ECMAScript/JScript程序员快速入门

- Variables must be declared before use. - Functions can change the value of arguments. - All variables are in the same scope.

- 变量必须在使用前声明。-函数可以更改参数的值。-所有变量都在同一范围内。

5.4. PolicyScript Script Return Values
5.4. PolicyScript脚本返回值

A PolicyScript script execution is normally ended by the execution of a return statement, or by having the flow of execution reach the end of the final statement in the script. A normal script execution always returns a Boolean value. If no explicit value is specified in the return statement, or if the flow of control proceeds through the end of the script, the return value is implicitly zero. If an expression is provided with the return statement, the expression is evaluated, and the result of the expression is implicitly converted with the ToBoolean operator before being returned to the script execution environment.

PolicyScript脚本的执行通常通过执行return语句结束,或者通过让执行流到达脚本中final语句的末尾结束。正常脚本执行始终返回布尔值。如果在return语句中没有指定显式值,或者如果控制流在脚本末尾继续,则返回值隐式为零。如果表达式随return语句一起提供,则将对表达式求值,并在将表达式的结果返回到脚本执行环境之前,使用ToBoolean运算符隐式转换表达式的结果。

The return value of a policyCondition script is used to determine whether the associated policyAction script is executed. If the returned value is zero, the associated policyAction script is not executed. If the returned value is one, the associated policyAction script will be executed.

policyCondition脚本的返回值用于确定是否执行关联的policyAction脚本。如果返回值为零,则不执行关联的policyAction脚本。如果返回值为1,则将执行关联的policyAction脚本。

The return value of a policyAction script is ignored.

忽略policyAction脚本的返回值。

An RTE or invocation of the fail() function will cause the return value of the script to be set to zero. Note however, that execution of the defer() or fail() functions may set the defer attribute so that the lower precedence script may be executed. This is independent of the return value of the policy script execution.

RTE或调用fail()函数将导致脚本的返回值设置为零。但是请注意,执行defer()或fail()函数可能会设置defer属性,以便执行优先级较低的脚本。这与策略脚本执行的返回值无关。

6. Index Information for 'this element'
6. “此元素”的索引信息

PolicyScript code needs a convenient way to get the components of the index for 'this element' so that they can perform SNMP operations on it or on related elements.

PolicyScript代码需要一种方便的方法来获取“this element”索引的组件,以便它们可以对其或相关元素执行SNMP操作。

Two mechanisms are provided.

提供了两种机制。

1. For all OID input parameters to all SNMP Library Functions (but not OID utility functions), the token "$n" ('$' followed by an integer between 0 and 128) can be used in place of any decimal sub-identifier. This token is expanded by the agent at execution time to contain the nth subid of the index for the current element. For example, if the element is interface 7, and the objectIdentifier is "1.3.6.1.2.1.2.2.1.3.$0", it will be expanded to "1.3.6.1.2.1.2.2.1.3.7". The special token "$*" is expanded to contain all of the subidentifiers of the index of the current element, separated by '.' characters.

1. 对于所有SNMP库函数(但不是OID实用程序函数)的所有OID输入参数,可以使用标记“$n”(“$”后跟0到128之间的整数)代替任何十进制子标识符。代理在执行时扩展此标记,以包含当前元素索引的第n个子ID。例如,如果元素为接口7,objectIdentifier为“1.3.6.1.2.1.2.2.1.3.$0”,则它将扩展为“1.3.6.1.2.1.2.2.1.3.7”。特殊标记“$*”扩展为包含当前元素索引的所有子标识符,以“.”字符分隔。

It is an RTE if a token is specified that is beyond the length of the index for the current element.

如果指定的标记超出当前元素的索引长度,则为RTE。

Note that the "$n" convention is only active within strings.

请注意,“$n”约定仅在字符串中有效。

2. The ec() and ev() functions allow access to the components of the index for 'this element'. ec() takes no argument and returns the number of index components that exist. ev() takes an integer argument specifying which component of the index (numbered starting at 0) and returns an integer containing the value of the n'th subidentifier. Refer to the Library functions section for the complete definition of ec() and ev().

2. ec()和ev()函数允许访问“this element”的索引组件。ec()不带参数,返回存在的索引组件数。ev()接受一个整数参数,指定索引的哪个部分(编号从0开始),并返回一个包含第n个子标识符值的整数。有关ec()和ev()的完整定义,请参阅“库函数”部分。

For example, if 'this element' is frCircuitDLCI.5.57 (ifIndex = 5, DLCI = 57) then ec() returns 2 ev(0) returns 5 ev(1) returns 57

例如,如果“this element”是frCircuitDLCI.5.57(ifIndex=5,DLCI=57),则ec()返回2 ev(0)返回5 ev(1)返回57

This is helpful when one wishes to address a related element. Extending the previous example, to find the port speed of the port, the circuit (above) runs over:

当您希望处理相关元素时,这会很有帮助。扩展上一个示例,要查找端口的端口速度,电路(上图)将覆盖:

         portSpeed = getVar("ifSpeed." + ev(0));
        
         portSpeed = getVar("ifSpeed." + ev(0));
        

A script may check the type of 'this element' by calling the elementName() function. Although it is possible to write a script that will work with different types of elements, many scripts will

脚本可以通过调用elementName()函数来检查“this element”的类型。尽管可以编写一个脚本来处理不同类型的元素,但许多脚本都可以

assume a particular element type and will work incorrectly if used on different element types.

假设一个特定的元素类型,并且如果在不同的元素类型上使用,则将无法正常工作。

7. Library Functions
7. 图书馆职能

Library functions are built-in functions available primarily to provide access to information on the local system or to manipulate this information more efficiently. A group of functions is organized into a library, the unit of conformance for function implementation. In order to claim conformance to a library, an implementation must implement all functions in a library to the specifications of the library.

库函数是内置函数,主要用于提供对本地系统信息的访问或更有效地处理这些信息。一组函数被组织到一个库中,库是函数实现的一致性单元。为了声明与库的一致性,实现必须按照库的规范实现库中的所有函数。

In order for a management station or a condition or action to understand whether a certain library of functions is implemented, each library will have a name that it registers in the role table as a characteristic of the system element ("0.0") in the default SNMP context. Thus, conformance to a library can be tested with the roleMatch library function (in the base library) with the call roleMatch ("libraryName", "0.0").

为了让管理站或条件或操作了解是否实现了某个函数库,每个库都将有一个名称,作为默认SNMP上下文中系统元素的特征(“0.0”)在角色表中注册。因此,可以通过调用roleMatch(“libraryName”、“0.0”)使用roleMatch库函数(在基本库中)来测试与库的一致性。

Note that in the descriptions of these functions below, the function prototype describes the type of argument expected. Even though variables are not declared with a particular type, their contents must be appropriate for each function argument. If the type is variable, the keyword 'var' will be used. If only a string is appropriate, the keyword 'string' will be used. If only an integer is appropriate, the keyword 'integer' will be used. If the argument is declared as 'string' or 'integer' and a value of a different type is passed, the argument will be coerced with ToInteger() or ToString(). Any failure of this coercion will cause an RTE (in particular for ToInteger(), which will fail if its string-valued argument is not a well-formed integer).

请注意,在下面这些函数的描述中,函数原型描述了预期的参数类型。即使变量不是用特定类型声明的,它们的内容也必须适合于每个函数参数。如果类型为变量,则将使用关键字“var”。如果只有一个字符串是合适的,则将使用关键字“string”。如果只有一个整数是合适的,则将使用关键字“integer”。如果参数声明为“string”或“integer”,并且传递了不同类型的值,则将使用ToInteger()或ToString()强制该参数。此强制的任何失败都将导致RTE(特别是对于ToInteger(),如果其字符串值参数不是格式正确的整数,则RTE将失败)。

In the function prototype, if the '&' character precedes the identifier for an argument, that argument may be modified by the function (e.g., "integer &result, ...)"). Arguments without the '&' character cannot be modified by the function. In a script, modifiable arguments don't have to be preceded by a '&'. It is an RTE if a constant is passed to a modifiable function argument (regardless of whether the function actually writes to the argument).

在函数原型中,如果参数的标识符前面有“&”字符,则该参数可由函数修改(例如,“integer&result,…”)。函数无法修改不带“&”字符的参数。在脚本中,可修改的参数前面不必加“&”。如果将常量传递给可修改的函数参数(无论函数是否实际写入参数),则为RTE。

In the function prototype, the '[' and ']' characters surround arguments that are optional. In PolicyScript code, the optional argument may only be included if all optional arguments to the left of it are included. The function may place restrictions on when an optional argument must, or must not, be included.

在函数原型中,“[”和“]”字符围绕可选参数。在PolicyScript代码中,仅当包含其左侧的所有可选参数时,才可以包含可选参数。该函数可以限制何时必须包含或不包含可选参数。

In the function prototype, if a type is listed before the name of the function, the function returns a value of that type. If no type is listed, the function returns no value.

在函数原型中,如果在函数名之前列出类型,则函数返回该类型的值。如果未列出任何类型,则函数不返回任何值。

8. Base Function Library
8. 基函数库

A standard base library of functions is available to all systems that implement this specification. This library is registered with the name "pmBaseFunctionLibrary". Although the specification of this library is modularized into 4 separate sections, conformance to the library requires implementation of all functions in all sections.

实现本规范的所有系统都可以使用标准的基本函数库。此库以名称“pmBaseFunctionLibrary”注册。尽管该库的规范被模块化为4个单独的部分,但要符合该库的要求,需要在所有部分中实现所有功能。

The sections are:

这些章节包括:

- SNMP library functions - Policy library functions - Utility functions - Library Functions

- SNMP库函数-策略库函数-实用程序函数-库函数

8.1. SNMP Library Functions
8.1. SNMP库函数

Two sets of SNMP Library functions are available with different situations in mind:

考虑到不同的情况,有两组SNMP库函数可用:

- Convenience SNMP Functions

- 方便的SNMP功能

In an effort to keep simple things simple, these functions are easy to use and code that is easy to understand. These functions will suffice for the majority of situations, where a single variable is referenced and the desired error recovery is simply (and immediately) to give up (and move to the next policy-element combination). In more complex cases, the General SNMP Functions can be used at the cost of several times the code complexity.

为了使简单的事情保持简单,这些函数易于使用,代码易于理解。这些函数足以满足大多数情况,其中引用了单个变量,并且所需的错误恢复只是(立即)放弃(并移动到下一个策略元素组合)。在更复杂的情况下,可以使用常规SNMP功能,但代价是代码复杂度的几倍。

The convenience SNMP functions are getVar, exists, setVar, setRowStatus, createRow, counterRate, and searchColumn.

方便的SNMP函数有getVar、exists、setVar、setRowStatus、createRow、counterRate和searchColumn。

- General SNMP Functions

- 一般SNMP功能

The General SNMP functions allow nearly any legal SNMP Message to be generated, including those with multiple varbinds, getNext operations, notifications, and messages with explicit addressing or security specifications.

通用SNMP函数允许生成几乎任何合法的SNMP消息,包括具有多个varbind、getNext操作、通知以及具有显式寻址或安全规范的消息。

The general SNMP functions are writeVar, readVar, snmpSend, readError, and writeBulkParameters.

一般的SNMP函数有writeVar、readVar、snmpSend、readError和writeBulkParameters。

8.1.1. SNMP Operations on Non-Local Systems
8.1.1. 非本地系统上的SNMP操作

From time to time, a script may have to perform an operation on a different SNMP system than that on which 'this element' resides. Scripts may also have to specify the use of alternate security parameters. In order to do this, the following optional arguments are provided for the SNMP library functions:

有时,脚本可能必须在与“this element”所在的SNMP系统不同的SNMP系统上执行操作。脚本可能还必须指定备用安全参数的使用。为此,为SNMP库函数提供以下可选参数:

snmp-function(...[, integer mPModel, string tDomain, string tAddress, integer secModel, string secName, integer secLevel, string contextEngineID ])

snmp函数(…[,integer-mPModel,string-tDomain,string-tAddress,integer-secModel,string-secName,integer-secLevel,string-contextEngineID])

For example:

例如:

getVar("sysDescr.0", "", SNMPv3, "transportDomainUdpIpv4", "192.168.1.1:161", USM, "joe", NoAuthNoPriv);

getVar(“sysDescr.0”,SNMPv3,“transportDomainUdpIpv4”,“192.168.1.1:161”,USM,“joe”,NoAuthNoPriv);

The use of these arguments is denoted in function definitions by the keyword 'NonLocalArgs'. The definitions of these arguments are as follows:

这些参数的使用在函数定义中由关键字“NonLocalArgs”表示。这些参数的定义如下:

'mPModel' is the integer value of the SnmpMessageProcessingModel to use for this operation.

“mPModel”是用于此操作的SnmpMessageProcessingModel的整数值。

'tDomain' is a string containing an ASCII dotted-decimal object identifier representing the transport domain to use for this operation.

“tDomain”是一个字符串,包含ASCII点十进制对象标识符,表示用于此操作的传输域。

'tAddress' is a string containing the transport address formatted according to the 'tDomain' argument. The ASCII formats for various values of 'tDomain' are defined by the DISPLAY-HINT for a TEXTUAL-CONVENTION that represents an address of that type. The DISPLAY-HINTs used are:

“tAddress”是一个字符串,包含根据“tDomain”参数格式化的传输地址。各种“tDomain”值的ASCII格式由表示该类型地址的文本约定的DISPLAY-HINT定义。使用的显示提示包括:

         tDomain                    Source of DISPLAY-HINT [5] [11]
         -------                    ----------------------
         transportDomainUdpIpv4     TransportAddressIPv4
         transportDomainUdpIpv6     TransportAddressIPv6
         transportDomainUdpDns      TransportAddressDns
         snmpCLNSDomain             snmpOSIAddress
         snmpCONSDomain             snmpOSIAddress
         snmpDDPDomain              snmpNBPAddress
         snmpIPXDomain              snmpIPXAddress
         rfc1157Domain              snmpUDPAddress
         Other                      Use DISPLAY-HINT "1x:"
        
         tDomain                    Source of DISPLAY-HINT [5] [11]
         -------                    ----------------------
         transportDomainUdpIpv4     TransportAddressIPv4
         transportDomainUdpIpv6     TransportAddressIPv6
         transportDomainUdpDns      TransportAddressDns
         snmpCLNSDomain             snmpOSIAddress
         snmpCONSDomain             snmpOSIAddress
         snmpDDPDomain              snmpNBPAddress
         snmpIPXDomain              snmpIPXAddress
         rfc1157Domain              snmpUDPAddress
         Other                      Use DISPLAY-HINT "1x:"
        

'secModel' is the integer value of the SnmpSecurityModel to use for this operation.

“secModel”是用于此操作的SnmpSecurityModel的整数值。

'secName' is a string value representing the SnmpSecurityName to use for this operation.

“secName”是一个字符串值,表示用于此操作的SnmpSecurityName。

'secLevel' is the integer value of the SnmpSecurityLevel to use for this operation.

“secLevel”是用于此操作的SnmpSecurityLevel的整数值。

An SNMP operation will be sent to the target system by using security parameters retrieved from a local configuration datastore based on 'secModel', 'secName', and 'secLevel'. It is the responsibility of the agent to ensure that sensitive information in the local configuration datastore is used on behalf of the correct principals, as identified by the security credentials of the last entity to modify the pmPolicyAdminStatus for a policy.

SNMP操作将通过使用基于“secModel”、“secName”和“secLevel”从本地配置数据存储检索的安全参数发送到目标系统。代理有责任确保本地配置数据存储中的敏感信息代表正确的主体使用,如最后一个实体修改策略的pmPolicyAdminStatus的安全凭据所标识的。

To illustrate how this must be configured, consider an example in which 'joe' installs a policy on 'PMAgent' that will periodically configure objects on 'TargetAgent' with the credentials of 'Operator'. The following conditions must be true for this policy to execute with the proper privileges:

为了说明如何配置这一点,请考虑一个例子,其中“乔”在PMAGENT上安装一个策略,该策略将定期使用“操作员”的凭据配置“TAGTAGER”上的对象。要以适当的权限执行此策略,必须满足以下条件:

- 'Operator's security credentials for TargetAgent must be installed in PMAgent's local configuration datastore (e.g., usmUserTable [6]) indexed by TargetAgent's engineID and 'Operator'. - VACM [9] must be configured on PMAgent so that 'joe' has access to the above entry in the appropriate MIB for the local configuration datastore (e.g., usmUserTable). - 'joe' must be the last user to modify the pmPolicyAdminStatus object for the policy.

- “TargetAgent的操作员安全凭据必须安装在由TargetAgent的engineID和“操作员”索引的PMAgent本地配置数据存储(例如usmUserTable[6])必须在pAgent上配置VACM[9],以便“joe”能够访问本地配置数据存储(例如usmUserTable)的适当MIB中的上述条目joe'必须是最后一个修改策略的pmPolicyAdminStatus对象的用户。

See the Security Considerations section for more information.

有关更多信息,请参阅安全注意事项部分。

For convenience, constants for 'mPModel', 'secModel', and 'secLevel' are defined in the "Constants" section below.

为方便起见,“mPModel”、“secModel”和“secLevel”的常量在下面的“常量”部分中定义。

'contextEngineID' is a string representing the contextEngineID of the SNMP entity targeted by this operation. It is encoded as a pair of hex digits (upper- and lowercase are valid) for each octet of the contextEngineID. If 'tDomain' and 'tAddress' are provided but 'contextEngineID' is not, then the operation will be directed to the SNMP entity reachable at 'tDomain' and 'tAddress'.

“contextEngineID”是一个字符串,表示此操作所针对的SNMP实体的contextEngineID。它被编码为contextEngineID的每个八位字节的一对十六进制数字(大写和小写有效)。如果提供了'tDomain'和'tAddress',但未提供'contextEngineID',则操作将定向到可在'tDomain'和'tAddress'访问的SNMP实体。

In order for PolicyScript code to use any of these arguments, all optional arguments to the left must be included. 'mPModel', 'tDomain', 'tAddress', 'secModel', 'secName', and 'secLevel' must

为了使PolicyScript代码使用这些参数中的任何一个,必须包括左侧的所有可选参数。”mPModel、tDomain、TadAddress、secModel、secName和secLevel必须

be used as a group; if one is specified, they must all be. 'contextEngineID' may only be specified if all others are specified.

作为一个群体使用;如果指定了一个,则必须全部指定。”仅当指定了所有其他项时,才可以指定contextEngineID。

Note that a function that uses NonLocalArgs must provide a parameter for the contextName that will be required when the NonLocalArgs are present. Many functions will have the following logic:

请注意,使用非LocalArgs的函数必须为存在非LocalArgs时所需的contextName提供参数。许多功能将具有以下逻辑:

ContextName NonLocalArgs Supplied Supplied

提供了ContextName非本地参数

No No Addressed to default context on local system. Yes No Addressed to named context on local system. Yes Yes Addressed to named context on potentially remote system. No Yes Not allowed.

本地系统上没有寻址到默认上下文。是否地址为本地系统上的命名上下文。“是”“是”“寻址到潜在远程系统上的命名上下文。”。不,不允许。

8.1.2. Form of SNMP Values
8.1.2. SNMP值的形式

Many of the library functions have input or output parameters that may be one of the many SMI data types. The actual type is not encoded in the value but is specified elsewhere, possibly by nature of the situation in which it is used. The exact usage for input and output is as follows:

许多库函数的输入或输出参数可能是许多SMI数据类型之一。实际类型不在值中编码,而是在别处指定,可能是根据使用它的情况的性质指定的。输入和输出的确切用法如下:

Any Integer value (INTEGER, Integer32, Counter32, Counter64, Gauge32, Unsigned32, TimeTicks, Counter64):

任意整数值(整数、整数32、计数器32、计数器64、量规32、无符号32、时间刻度、计数器64):

On input: An Integer or a String that can be successfully coerced to an Integer with the ToInteger() operator. It is an RTE if a string is passed that cannot be converted by ToInteger() into an integer.

输入时:可以使用ToInteger()运算符成功强制为整数的整数或字符串。如果传递的字符串不能由ToInteger()转换为整数,则为RTE。

A string of the form

表单的字符串

enum_decimal: [ letter | digit | '-' ]* '(' decimal_constant ')'

枚举小数:[字母|数字|'-']*'(“十进制常数”)'

will also be accepted. In this case the sequence of characters before the parentheses and the parentheses themselves are completely ignored, and the decimal_constant inside the parentheses is converted. Thus, "frame-relay(32)" translates to the integer 32.

也将被接受。在这种情况下,将完全忽略括号前的字符序列和括号本身,并转换括号内的十进制_常量。因此,“帧中继(32)”转换为整数32。

On output: An Integer containing the returned value.

输出时:包含返回值的整数。

Octet String On input: Either a String or an Integer. If an Integer, it will be coerced to a String with the ToString() function. This string will be used as an unencoded representation of the octet string value.

输入八位字符串:字符串或整数。如果是整数,则使用ToString()函数将其强制为字符串。此字符串将用作八位字节字符串值的未编码表示形式。

On output: A String containing the unencoded value of the octet string.

输出时:包含八位字节字符串的未编码值的字符串。

Object Identifier On input and on output: A String containing a decimal ASCII encoded object identifier of the following form:

输入和输出的对象标识符:一个字符串,包含以下形式的十进制ASCII编码对象标识符:

oid: subid [ '.' subid ]* [ '.' ] subid: '0' | decimal_constant

oid:subid['.'subid]*['.]subid:'0'|十进制常数

It is an RTE if an Object Identifier argument is not in the form above. Note that a trailing '.' is acceptable and will simply be ignored. (Note, however, that a trailing dot could cause a strncmp() comparison of two otherwise-identical OIDs to fail; instead, use oidncmp().)

如果对象标识符参数不符合上述格式,则为RTE。请注意,尾随“.”是可以接受的,将被忽略。(但是,请注意,尾随点可能会导致两个相同OID的strncmp()比较失败;相反,请使用oidncmp()

Note that ASCII descriptors (e.g., "ifIndex") are never used in these encodings "over the wire". They are never returned from library functions; nor are they ever accepted by them. NMS user interfaces are encouraged to allow humans to view object identifiers with ASCII descriptors, but they must translate those descriptors to dotted-decimal format before sending them in MIB objects to policy agents.

请注意,ASCII描述符(例如,“ifIndex”)从未在这些“在线”编码中使用。它们永远不会从库函数返回;他们也从来没有接受过。鼓励NMS用户界面允许用户使用ASCII描述符查看对象标识符,但在将这些描述符以MIB对象的形式发送给策略代理之前,必须将其转换为点十进制格式。

Null On input: The input is ignored.

输入为空:忽略输入。

On output: A zero length string.

输出:长度为零的字符串。

8.1.3. Convenience SNMP Functions
8.1.3. 方便的SNMP功能
8.1.3.1. getVar()
8.1.3.1. getVar()

The getVar() function is used to retrieve the value of an SNMP MIB object instance.

函数的作用是:检索SNMP MIB对象实例的值。

string getVar(string oid [, string contextName, NonLocalArgs])

字符串getVar(字符串oid[,字符串contextName,非本地参数])

'oid' is a string containing an ASCII dotted-decimal representation of an object identifier (e.g., "1.3.6.1.2.1.1.1.0").

“oid”是一个字符串,包含对象标识符的ASCII点十进制表示形式(例如,“1.3.6.1.2.1.1.1.0”)。

The optional 'contextName' argument contains the SNMP context on which to operate. If 'contextName' is not present, the contextName of 'this element' will be used. If 'contextName' is the zero-length string, the default context is used.

可选的“contextName”参数包含要在其上操作的SNMP上下文。如果“contextName”不存在,则将使用“this element”的contextName。如果“contextName”是长度为零的字符串,则使用默认上下文。

The optional 'NonLocalArgs' provide addressing and security information to perform an SNMP operation on a system different from that of 'this element'.

可选的“NonLocalArgs”提供寻址和安全信息,以便在不同于“this element”的系统上执行SNMP操作。

It is an RTE if the queried object identifier value does not exist.

如果查询的对象标识符值不存在,则为RTE。

This function returns a string containing the returned value, encoded according to the returned type. Note that no actual SNMP PDU has to be generated and parsed when the policy MIB agent resides on the same system as the managed elements.

此函数返回一个包含返回值的字符串,该值根据返回的类型进行编码。请注意,当策略MIB代理与托管元素驻留在同一系统上时,不必生成和解析实际的SNMP PDU。

It is recommended that NMS user interfaces display and allow input of MIB object names by their descriptor values, followed by the index in dotted-decimal form (e.g., "ifType.7").

建议NMS用户界面通过描述符值显示并允许输入MIB对象名称,后跟点十进制形式的索引(例如,“ifType.7”)。

8.1.3.2. exists()
8.1.3.2. 存在()

The exists() function is used to verify the existence of an SNMP MIB object instance.

函数的作用是:验证SNMP MIB对象实例是否存在。

integer exists(string oid [, string contextName, NonLocalArgs])

整数存在(字符串oid[,字符串contextName,非本地参数])

'oid' is a string containing an ASCII dotted-decimal representation of an object identifier (e.g., "1.3.6.1.2.1.1.1.0").

“oid”是一个字符串,包含对象标识符的ASCII点十进制表示形式(例如,“1.3.6.1.2.1.1.1.0”)。

The optional 'contextName' argument contains the SNMP context on which to operate. If 'contextName' is not present, the contextName of 'this element' will be used. If 'contextName' is the zero-length string, the default context is used.

可选的“contextName”参数包含要在其上操作的SNMP上下文。如果“contextName”不存在,则将使用“this element”的contextName。如果“contextName”是长度为零的字符串,则使用默认上下文。

The optional 'NonLocalArgs' provide addressing and security information to perform an SNMP operation on a system different from that of 'this element'.

可选的“NonLocalArgs”提供寻址和安全信息,以便在不同于“this element”的系统上执行SNMP操作。

This function returns the value 1 if the SNMP instance exists and 0 if it doesn't exist. Note that no actual SNMP PDU has to be generated and parsed when the policy MIB agent resides on the same system as the managed elements.

如果SNMP实例存在,则此函数返回值1;如果SNMP实例不存在,则返回值0。请注意,当策略MIB代理与托管元素驻留在同一系统上时,不必生成和解析实际的SNMP PDU。

It is recommended that NMS user interfaces display and allow input of MIB object names by their descriptor values, followed by the index in dotted-decimal form (e.g., "ifType.7").

建议NMS用户界面通过描述符值显示并允许输入MIB对象名称,后跟点十进制形式的索引(例如,“ifType.7”)。

8.1.3.3. setVar()
8.1.3.3. setVar()

The setVar() function is used to set a MIB object instance to a certain value. The setVar() function is only valid in policyActions.

函数的作用是:将MIB对象实例设置为某个值。setVar()函数仅在policyActions中有效。

setVar(string oid, var value, integer type [, string contextName, NonLocalArgs] )

setVar(字符串oid,变量值,整数类型[,字符串contextName,非本地参数])

'oid' is a string containing an ASCII dotted-decimal representation of an object identifier (e.g., "1.3.6.1.2.1.1.1.0").

“oid”是一个字符串,包含对象标识符的ASCII点十进制表示形式(例如,“1.3.6.1.2.1.1.1.0”)。

'value' is a string encoded in the format appropriate to the 'type' parameter. The agent will set the variable specified by 'oid' to the value specified by 'value'.

“value”是一个字符串,其编码格式适合于“type”参数。代理将“oid”指定的变量设置为“value”指定的值。

'type' will be the type of the 'value' parameter and will be set to one of the values for DataType Constants.

“type”将是“value”参数的类型,并将设置为数据类型常量的值之一。

The optional 'contextName' argument contains the SNMP context on which to operate. If 'contextName' is not present, the contextName of 'this element' will be used. If 'contextName' is the zero length string, the default context is used.

可选的“contextName”参数包含要在其上操作的SNMP上下文。如果“contextName”不存在,则将使用“this element”的contextName。如果“contextName”是长度为零的字符串,则使用默认上下文。

The optional 'NonLocalArgs' provide addressing and security information to perform an SNMP operation on a system different from that of 'this element'. Note that no actual SNMP PDU has to be generated and parsed when the policy MIB agent resides on the same system as the managed elements.

可选的“NonLocalArgs”提供寻址和安全信息,以便在不同于“this element”的系统上执行SNMP操作。请注意,当策略MIB代理与托管元素驻留在同一系统上时,不必生成和解析实际的SNMP PDU。

It is an RTE if the set encounters any error.

如果集合遇到任何错误,则为RTE。

It is recommended that NMS user interfaces display and allow input of MIB object names by their descriptor values, followed by the index in dotted-decimal form (e.g., "ifType.7").

建议NMS用户界面通过描述符值显示并允许输入MIB对象名称,后跟点十进制形式的索引(例如,“ifType.7”)。

8.1.3.4. searchColumn()
8.1.3.4. searchColumn()

integer searchColumn(string columnoid, string &oid, string pattern, integer mode [, string contextName, NonLocalArgs])

整数搜索列(字符串列型、字符串和oid、字符串模式、整数模式[、字符串上下文名称、非本地参数])

searchColumn performs an SNMP walk on a portion of the MIB searching for objects with values equal to the 'pattern' parameter.

searchColumn对MIB的一部分执行SNMP漫游,搜索值等于“pattern”参数的对象。

'columnoid' constrains the search to those variables that share the same OID prefix (i.e., those that are beneath it in the OID tree).

“columnoid”将搜索限制为共享相同OID前缀的变量(即OID树中位于其下方的变量)。

A getnext request will be sent requesting the object identifier 'oid'. If 'oid' is an empty string, the value of 'columnoid' will be sent.

将发送getnext请求,请求对象标识符“oid”。如果“oid”是空字符串,则将发送“columnoid”的值。

The value returned in each response packet will be transformed to a string representation of the value of the returned variable. The string representation of the value will be formed by putting the value in the form dictated by the "Form of SNMP Values" rules, and then by performing the ToString() function on this value, forming 'SearchString'.

每个响应数据包中返回的值将转换为返回变量值的字符串表示形式。值的字符串表示形式将通过以下方式形成:将值置于“SNMP值的形式”规则指定的形式,然后对该值执行ToString()函数,形成“SearchString”。

The 'mode' value controls what type of match to perform on this 'SearchString' value. There are 6 possibilities for mode:

“mode”值控制对此“SearchString”值执行何种类型的匹配。模式有6种可能:

Mode Search Action ExactMatch Case sensitive exact match of 'pattern' and 'SearchString'. ExactCaseMatch Case insensitive exact match of 'pattern' and 'SearchString'. SubstringMatch Case sensitive substring match, finding 'pattern' in 'SearchString'. SubstringCaseMatch Case insensitive substring match, finding 'pattern' in 'SearchString'. RegexpMatch Case sensitive regular expression match, searching 'SearchString' for the regular expression given in 'pattern'.

模式搜索操作ExactMatch区分大小写精确匹配“模式”和“搜索字符串”。ExactCaseMatch不区分大小写精确匹配“pattern”和“SearchString”。SubstringMatch区分大小写的子字符串匹配,在“SearchString”中查找“pattern”。SubstringCaseMatch不区分大小写的子字符串匹配,在“SearchString”中找到“pattern”。RegexpMatch区分大小写的正则表达式匹配,搜索“模式”中给定的正则表达式的“SearchString”。

RegexpCaseMatch Case insensitive regular expression match, searching 'SearchString' for the regular expression given in 'pattern'.

RegexpCaseMatch不区分大小写的正则表达式匹配,搜索“模式”中给定的正则表达式的“SearchString”。

Constants for the values of 'mode' are defined in the 'Constants' section below.

“模式”值的常量在下面的“常量”部分中定义。

searchColumn uses the POSIX extended regular expressions defined in POSIX 1003.2.

searchColumn使用POSIX 1003.2中定义的POSIX扩展正则表达式。

The optional 'contextName' argument contains the SNMP context on which to operate. If 'contextName' is not present, the contextName of 'this element' will be used. If 'contextName' is the zero-length string, the default context is used.

可选的“contextName”参数包含要在其上操作的SNMP上下文。如果“contextName”不存在,则将使用“this element”的contextName。如果“contextName”是长度为零的字符串,则使用默认上下文。

The optional 'NonLocalArgs' provide addressing and security information to perform SNMP operations on a system different from that of 'this element'.

可选的“NonLocalArgs”提供寻址和安全信息,以便在不同于“this element”的系统上执行SNMP操作。

If a match is found, 'oid' is set to the OID of the matched value, and 1 is returned. If the search traverses beyond columnoid or returns an error without finding a match, zero is returned, and 'oid' isn't modified.

如果找到匹配项,则将“oid”设置为匹配值的oid,并返回1。如果搜索遍历columnoid之外的内容或返回错误而未找到匹配项,则返回零,并且不会修改“oid”。

To find the first match, the caller should set 'oid' to the empty string. To find additional matches, subsequent calls to searchColumn should have 'oid' set to the OID of the last match, an operation that searchColumn performs automatically.

要查找第一个匹配项,调用方应将“oid”设置为空字符串。要查找其他匹配项,对searchColumn的后续调用应将“oid”设置为最后一个匹配项的oid,这是searchColumn自动执行的操作。

         For example:
             To find an ethernet interface
             oid = "";
             searchColumn("ifType", oid, "6", 0);
        
         For example:
             To find an ethernet interface
             oid = "";
             searchColumn("ifType", oid, "6", 0);
        

This sends a getnext request for ifType and continues to walk the tree until a value matching 6 is found or a variable returns that is not in the 'ifType' subtree.

这将发送ifType的getnext请求,并继续遍历树,直到找到与6匹配的值或返回不在“ifType”子树中的变量。

To find the next ethernet interface, assuming that interface 3 was discovered to be the first:

要查找下一个以太网接口,假设发现接口3是第一个:

             oid = "ifType.3";
             searchColumn("ifType", oid, "6", 0);
        
             oid = "ifType.3";
             searchColumn("ifType", oid, "6", 0);
        

In a loop to determine all the ethernet interfaces, this looks as follows:

在确定所有以太网接口的循环中,如下所示:

             oid = "";
             while(searchColumn("ifType", oid, "6", 0)){
               /* Do something with oid */
             }
        
             oid = "";
             while(searchColumn("ifType", oid, "6", 0)){
               /* Do something with oid */
             }
        

Note that in the preceding examples, "ifType" is used as a notational convenience, and the actual code downloaded to the policy MIB agent must use the string "1.3.6.1.2.1.2.2.1.3" as there may be no MIB compiler (or MIB file) available on the policy MIB agent.

请注意,在前面的示例中,“ifType”用作符号方便,下载到策略MIB代理的实际代码必须使用字符串“1.3.6.1.2.1.2.2.1.3”,因为策略MIB代理上可能没有可用的MIB编译器(或MIB文件)。

Note that if the value of 'columnoid' is too short and thus references too much of the object identifier tree (e.g., "1.3.6"), 'columnoid' could end up searching a huge number of variables (if the value was "1.3.6", it would search ALL variables on the agent). It is the responsibility of the caller to make sure that 'columnoid' is set appropriately.

请注意,如果“columnoid”的值太短,因此引用了太多的对象标识符树(例如,“1.3.6”),“columnoid”可能会搜索大量变量(如果值为“1.3.6”,它将搜索代理上的所有变量)。调用者有责任确保“columnoid”设置正确。

8.1.3.5. setRowStatus()
8.1.3.5. setRowStatus()

integer setRowStatus(string oid, integer maxTries [, integer freeOnException , integer seed , string contextName, NonLocalArgs])

整数setRowStatus(字符串oid、整数maxTries[、整数FreeOneException、整数种子、字符串contextName、非本地参数])

setRowStatus is used to automate the process of finding an unused row in a read-create table that uses RowStatus whose index contains an arbitrary integer component for uniqueness.

setRowStatus用于在使用RowStatus的读创建表中自动查找未使用的行,该表的索引包含用于唯一性的任意整数组件。

'oid' is a string containing an ASCII dotted-decimal representation of an object identifier, with one of the subids replaced with a '*' character (e.g., "1.3.6.1.3.1.99.1.2.1.9.*"). 'oid' must reference an 'instance' of the RowStatus object, and the '*' must replace any integer index item that may be set to some random value.

“oid”是一个字符串,包含对象标识符的ASCII点十进制表示形式,其中一个子ID替换为“*”字符(例如,“1.3.6.1.3.1.99.1.2.1.9.*)。”oid必须引用RowStatus对象的“实例”,并且“*”必须替换可能设置为某个随机值的任何整数索引项。

setRowStatus will come up with a number for the selected index item and will attempt to create the instance with the createAndWait state. If the attempt fails, it will retry with a different random index value. It will attempt this no more than 'maxTries' times.

setRowStatus将为所选索引项提供一个数字,并将尝试使用createAndWait状态创建实例。如果尝试失败,它将使用不同的随机索引值重试。它尝试此操作的次数不超过“最大”次。

If the optional 'freeOnException' argument is present and equal to 1, the agent will free this row by setting RowStatus to 'destroy' if, later in the same script invocation, this script

如果可选的“freeOnException”参数存在且等于1,则代理将通过将RowStatus设置为“destroy”释放此行,如果稍后在同一脚本调用中,此脚本

dies with a run-time exception or by a call to fail(). Note that this does not apply to exceptions experienced in subsequent invocations of the script.

由于运行时异常或调用fail()而死亡。请注意,这不适用于脚本后续调用中遇到的异常。

If the optional 'seed' argument is present, the initial index will be set to 'seed'. Otherwise it will be random. 'seed' may not be present if the 'freeOnException' argument is not present.

如果存在可选的“seed”参数,则初始索引将设置为“seed”。否则它将是随机的。”如果“FreeOneException”参数不存在,则“种子”可能不存在。

The optional 'contextName' argument contains the SNMP context on which to operate. If 'contextName' is not present, the contextName of 'this element' will be used. If 'contextName' is the zero-length string, the default context is used.

可选的“contextName”参数包含要在其上操作的SNMP上下文。如果“contextName”不存在,则将使用“this element”的contextName。如果“contextName”是长度为零的字符串,则使用默认上下文。

The optional 'NonLocalArgs' provide addressing and security information to perform an SNMP operation on a system different from that of 'this element'.

可选的“NonLocalArgs”提供寻址和安全信息,以便在不同于“this element”的系统上执行SNMP操作。

setRowStatus returns the successful integer value for the index. If it is unsuccessful after 'maxTries', or if zero or more than one '*' is in OID, -1 will be returned.

setRowStatus返回索引的成功整数值。如果在“maxTries”之后失败,或者如果OID中有零个或多个“*”,则将返回-1。

The createRow function (below) can also be used when adding rows to tables. Although createRow has more functionality, setRowStatus may be preferable in certain situations (for example, to have the opportunity to inspect default values created by the agent).

向表中添加行时,也可以使用createRow函数(如下)。尽管createRow具有更多功能,但在某些情况下(例如,有机会检查代理创建的默认值),setRowStatus可能更可取。

8.1.3.6. createRow()
8.1.3.6. createRow()

integer createRow(integer reqPDU, integer reqNumVarbinds, integer statusColumn, integer maxTries, integer indexRange, integer &respPDU, integer &respNumVarbinds, integer &index [, integer freeOnException, string contextName, NonLocalArgs])

integer createRow(integer reqPDU、integer ReqNumValbinds、integer statusColumn、integer MaxTry、integer indexRange、integer和respPDU、integer和RespnumValbinds、integer和index[、integer FreeOneException、string contextName、NonLocalArgs])

createRow is used to automate the process of creating a row in a read-create table whose index contains an arbitrary integer component for uniqueness. In particular, it encapsulates the algorithm behind either the createAndWait or createAndGo mechanism and the algorithm for finding an unused row in the table. createRow is not useful for creating rows in tables whose indexes don't contain an arbitrary integer component.

createRow用于自动化在读创建表中创建行的过程,该表的索引包含用于唯一性的任意整数组件。特别是,它封装了createAndWait或createAndGo机制背后的算法以及查找表中未使用行的算法。createRow对于在索引不包含任意整数组件的表中创建行不有用。

createRow will perform the operation by sending 'reqPDU' and returning the results in 'respPDU'. Both 'reqPDU' and

createRow将通过发送“reqPDU”并在“respPDU”中返回结果来执行该操作。“reqPDU”和

'respPDU' must previously have been allocated with newPDU. 'reqPDU' and 'respPDU' may both contain the same PDU handle, in which case the 'reqPDU' is sent and then replaced with the contents of the received PDU.

“respPDU”以前必须与newPDU一起分配“reqPDU”和“respPDU”可能都包含相同的PDU句柄,在这种情况下,发送“reqPDU”,然后替换为接收到的PDU的内容。

'reqNumVarbinds' is an integer greater than zero that specifies which varbinds in the PDU will be used in this operation. The first 'reqNumVarbinds' in the PDU are used. Each such varbind must be of a special form in which the object name must have one of its subids replaced with a '*' character (e.g., "1.3.6.1.3.1.99.1.2.1.9.*"). The subid selected to be replaced will be an integer index item that may be set to some random value. The same subid should be selected in each varbind in the PDU.

“ReqNumValbinds”是一个大于零的整数,用于指定在此操作中将使用PDU中的哪些变量绑定。使用PDU中的第一个“ReqNumValbind”。每个这样的varbind必须是一种特殊形式,其中对象名必须有一个子ID替换为“*”字符(例如,“1.3.6.1.3.1.99.1.2.1.9.*”)。选择要替换的子ID将是一个整数索引项,可以设置为某个随机值。应在PDU中的每个varbind中选择相同的子ID。

'respNumVarbinds' will be modified to contain the number of varbinds received in the last response PDU.

“respNumVarbinds”将被修改为包含上次响应PDU中接收到的varbinds数。

'statusColumn' identifies which varbind in 'pdu' should be treated as the RowStatus column, where 0 identifies the 1st varbind.

“statusColumn”标识“pdu”中的哪个varbind应被视为RowStatus列,其中0标识第一个varbind。

createRow will come up with a random integer index value and will substitute that value in place of the '*' subid in each varbind. It will then set the value of the RowStatus column to select the 'createAndGo' mechanism and execute the set. If the attempt fails due to the unavailability of the 'createAndGo' mechanism, it will retry with the 'createAndWait' mechanism selected. If the attempt fails because the chosen index value is already in use, the operation will be retried with a different random index value. It will continue to retry different index values until it succeeds, until it has made 'maxTries' attempts, or until it encounters an error. The value of 'maxTries' should be chosen to be high enough to minimize the chance that as the table fills up an attempt to create a new entry will 'collide' too often and fail.

createRow将产生一个随机整数索引值,并将用该值替换每个varbind中的“*”子ID。然后,它将设置RowStatus列的值,以选择“createAndGo”机制并执行该设置。如果由于“createAndGo”机制不可用而导致尝试失败,则将选择“createAndWait”机制重试。如果由于所选索引值已在使用而导致尝试失败,则将使用其他随机索引值重试该操作。它将继续重试不同的索引值,直到成功,直到进行了“最大尝试”尝试,或者直到遇到错误。“maxTries”的值应选择得足够高,以最大限度地减少在表填充时创建新条目的尝试频繁“冲突”并失败的可能性。

All random index values must be between 1 and 'indexRange', inclusive. This is so that values are not attempted for an index that fall outside of that index's restricted range (e.g., 1..65535).

所有随机索引值必须介于1和'indexRange'之间,包括1和'indexRange'。这是为了不尝试为超出该索引限制范围(例如,1..65535)的索引提供值。

If the optional 'freeOnException' argument is present and equal to 1, the agent will free this row by setting RowStatus to 'destroy' if, later in the same script invocation, this script dies with a run-time exception or by a call to fail(). Note that this does not apply to exceptions experienced in subsequent invocations of the script.

如果可选的“freeOnException”参数存在且等于1,则代理将通过将RowStatus设置为“destroy”来释放此行,如果稍后在同一脚本调用中,此脚本因运行时异常或调用fail()而死亡。请注意,这不适用于脚本后续调用中遇到的异常。

The optional 'contextName' argument contains the SNMP context on which to operate. If 'contextName' is not present, the contextName of 'this element' will be used. If 'contextName' is the zero-length string, the default context is used.

可选的“contextName”参数包含要在其上操作的SNMP上下文。如果“contextName”不存在,则将使用“this element”的contextName。如果“contextName”是长度为零的字符串,则使用默认上下文。

The optional 'NonLocalArgs' provide addressing and security information to perform an SNMP operation on a system different from that of 'this element'.

可选的“NonLocalArgs”提供寻址和安全信息,以便在不同于“this element”的系统上执行SNMP操作。

Note that no actual SNMP PDU has to be generated and parsed when the policy MIB agent resides on the same system as the managed elements. If no PDU is generated, the agent must correctly simulate the behavior of the SNMP Response PDU, particularly in case of an error.

请注意,当策略MIB代理与托管元素驻留在同一系统上时,不必生成和解析实际的SNMP PDU。如果未生成PDU,则代理必须正确模拟SNMP响应PDU的行为,尤其是在发生错误的情况下。

This function returns zero unless an error occurs, in which case it returns the proper SNMP Error Constant. If an error occurred, respPDU will contain the last response PDU as received from the agent unless no response PDU was received, in which case respNumVarbinds will be 0. In any event, readError may be called on the PDU to determine error information for the transaction.

除非发生错误,否则此函数将返回零,在这种情况下,它将返回正确的SNMP错误常量。如果发生错误,respPDU将包含从代理收到的最后一个响应PDU,除非未收到响应PDU,在这种情况下,RespNumValbinds将为0。在任何情况下,都可以在PDU上调用readError来确定事务的错误信息。

The 'index' parameter returns the chosen index. If successful, 'index' will be set to the successful integer index. If no SNMP error occurs but the operation does not succeed due to the following reasons, 'index' will be set to -1:

“index”参数返回所选的索引。如果成功,“索引”将设置为成功的整数索引。如果没有发生SNMP错误,但由于以下原因操作未成功,“索引”将设置为-1:

1) Unsuccessful after 'maxTries'. 2) An object name had no '*' in it. 3) An object name had more than one '*' in it.

1) “最大尝试”后失败。2) 对象名称中没有“*”。3) 对象名称中有多个“*”。

For example, createRow() might be used as follows:

例如,createRow()可以按如下方式使用:

         var index, pdu = newPDU(), nVars = 0;
        
         var index, pdu = newPDU(), nVars = 0;
        
         writeVar(pdu, nVars++, "hlHostControlDataSource.*",
                  "ifIndex." + ev(0), Oid);
         writeVar(pdu, nVars++, "hlHostControlNlMaxDesiredEntries.*",
                  1000, Integer);
         writeVar(pdu, nVars++, "hlHostControlAlMaxDesiredEntries.*",
                  1000, Integer);
         writeVar(pdu, nVars++, "hlHostControlOwner.*", "policy",
                  String);
         writeVar(pdu, nVars++, "hlHostControlStatus.*", "active(1)",
                  Integer);
         if (createRow(pdu, nVars, 4, 20, 65535,
                       pdu, nVars, index) != 0
        
         writeVar(pdu, nVars++, "hlHostControlDataSource.*",
                  "ifIndex." + ev(0), Oid);
         writeVar(pdu, nVars++, "hlHostControlNlMaxDesiredEntries.*",
                  1000, Integer);
         writeVar(pdu, nVars++, "hlHostControlAlMaxDesiredEntries.*",
                  1000, Integer);
         writeVar(pdu, nVars++, "hlHostControlOwner.*", "policy",
                  String);
         writeVar(pdu, nVars++, "hlHostControlStatus.*", "active(1)",
                  Integer);
         if (createRow(pdu, nVars, 4, 20, 65535,
                       pdu, nVars, index) != 0
        
             || index == -1)
             return;
         // index now contains index of new row
        
             || index == -1)
             return;
         // index now contains index of new row
        
8.1.3.7. counterRate()
8.1.3.7. 抵消

When a policy wishes to make a decision based on the rate of a counter, it faces a couple of problems:

当一项政策希望根据计数器的速率做出决策时,它会面临两个问题:

1. It may have to run every X minutes but have to make decisions on rates calculated over at least Y minutes, where Y > X. This would require the complexity of managing a queue of old counter values.

1. 它可能必须每X分钟运行一次,但必须决定至少Y分钟内计算的速率,其中Y>X。这将需要管理旧计数器值队列的复杂性。

2. The policy script has no control over exactly when it will run.

2. 策略脚本无法控制其运行的确切时间。

The counterRate() function is designed to surmount these problems easily.

counterRate()函数旨在轻松克服这些问题。

integer counterRate(string oid, integer minInterval [, integer 64bit, string discOid, integer discMethod, string contextName, NonLocalArgs])

整数计数器速率(字符串oid、整数最小区间[、整数64位、字符串DISCID、整数discMethod、字符串contextName、非本地参数])

'counterRate' retrieves the variable specified by oid once per invocation. It keeps track of timestamped values retrieved on previous invocations by this execution context so that it can calculate a rate over a period longer than that since the last invocation.

“counterRate”每次调用检索oid指定的变量一次。它跟踪此执行上下文在以前的调用中检索到的时间戳值,以便计算比上次调用后更长的时间段内的速率。

'oid' is the object identifier of the counter value that will be retrieved. The most recent previously saved value of the same object identifier that is at least 'minInterval' seconds old will be subtracted from the newly retrieved value, yielding a delta. If 'minInterval' is zero, this delta will be returned. Otherwise, this delta will be divided by the number of seconds elapsed between the two retrievals, and the integer-valued result will be returned (rounding down when necessary).

“oid”是将检索的计数器值的对象标识符。将从新检索的值中减去之前保存的同一对象标识符的最新值,该值至少为“minInterval”秒,从而生成增量。如果“minInterval”为零,将返回此增量。否则,此增量将除以两次检索之间经过的秒数,并返回整数值结果(必要时向下舍入)。

If there was no previously saved retrieval older than 'minInterval' seconds, then -1 will be returned. It is an RTE if the query returns noSuchName, noSuchInstance, or noSuchObject or an object that is not of type Counter32 or Counter64.

如果以前没有保存的检索时间早于“minInterval”秒,则将返回-1。如果查询返回noSuchName、noSuchInstance或noSuchObject,或者返回的对象不属于Counter32或Counter64类型,则为RTE。

The delta calculation will allow for 32-bit counter semantics if it encounters rollover between the two retrievals, unless the optional argument '64bit' is present and equal to 1, in which case it will allow for 64-bit counter semantics.

如果增量计算在两次检索之间遇到滚动,则它将允许32位计数器语义,除非可选参数“64bit”存在且等于1,在这种情况下,它将允许64位计数器语义。

'discOid' and 'discMethod' may only be present together. 'discOid' contains an object identifier of a discontinuity indicator value that will be retrieved simultaneously with each counter value:

“discOid”和“discMethod”只能同时出现。”discOid'包含不连续指示器值的对象标识符,该值将与每个计数器值同时检索:

1. If 'discMethod' is equal to 1 and the discontinuity indicator is less than the last one retrieved, then a discontinuity is indicated. 2. If 'discMethod' is equal to 2 and the discontinuity indicated is different from the last one retrieved, then a discontinuity is indicated.

1. 如果“discMethod”等于1,且不连续指示器小于最后检索到的指示器,则表示不连续。2.如果“discMethod”等于2,且显示的不连续性与上次检索的不连续性不同,则显示不连续性。

If this value indicates a discontinuity, this counter value (and its timestamp) will be stored, but all previously stored counter values will be invalidated and -1 will be returned.

如果此值指示不连续,则将存储此计数器值(及其时间戳),但所有先前存储的计数器值将无效,并返回-1。

The implementation will have to store a number of timestamped counter values. The implementation must keep all values that are newer than minInterval seconds, plus the newest value that is older than minInterval seconds. Other than this one value that is older than minInterval seconds, the implementation should discard any older values.

实现将必须存储大量时间戳计数器值。实现必须保留所有比minInterval秒更新的值,以及比minInterval秒旧的最新值。除了这一个早于最小间隔秒的值之外,实现应该放弃任何旧值。

For example: Policy that executes every 60 seconds: rate = counterRate("ifInOctets.$*", 300); if (rate > 1000000) ...

例如:每60秒执行一次的策略:速率=计数器速率(“ifInOctets.$*”,300);如果(利率>1000000)。。。

Another example, with a discontinuity indicator:

另一个示例,使用不连续指示器:

Policy that executes every 60 seconds: rate = counterRate("ifInOctets.$*", 300, 0, "sysUpTime.0", 1); if (rate > 1000000) ...

每60秒执行一次的策略:速率=计数器速率(“IFinoctes.$*”,300,0,“sysUpTime.0”,1);如果(利率>1000000)。。。

Another example, with zero minInterval: Policy that executes every 60 seconds: delta = counterRate("ifInErrors.$*", 0); if (delta > 100) ...

另一个示例,使用零最小间隔:每60秒执行一次的策略:delta=counterate(“ifInErrors.$*”,0);如果(增量>100)。。。

The optional 'contextName' argument contains the SNMP context on which to operate. If 'contextName' is not present, the contextName of 'this element' will be used. If 'contextName' is the zero-length string, the default context is used.

可选的“contextName”参数包含要在其上操作的SNMP上下文。如果“contextName”不存在,则将使用“this element”的contextName。如果“contextName”是长度为零的字符串,则使用默认上下文。

8.1.4. General SNMP Functions
8.1.4. 一般SNMP功能

It is desirable that a general SNMP interface have the ability to perform SNMP operations on multiple variables at once and that it allow multiple varbind lists to exist at once. The newPdu, readVar, and writeVar functions exist to provide these facilities in a language without pointers, arrays, and memory allocators.

希望通用SNMP接口能够同时对多个变量执行SNMP操作,并允许同时存在多个varbind列表。newPdu、readVar和writeVar函数的存在是为了在没有指针、数组和内存分配器的语言中提供这些功能。

newPDU is called to allocate a PDU and return an integer handle to it. As PDUs are automatically freed when the script exits and can be reused during execution, there is no freePDU().

调用newPDU来分配一个PDU并向其返回一个整数句柄。由于PDU在脚本退出时自动释放,并且可以在执行期间重用,因此没有freePDU()。

readVar and writeVar access a variable length varbind list for a PDU. The PDU handle and the index of the variable within that PDU are specified in every readVar and writeVar operation. Once a PDU has been fully specified by one or more calls to writeVar, it is passed to snmpSend (by referencing the PDU handle) and the number of varbinds to be included in the operation. When a response is returned, the contents of the response are returned in another PDU and may be read by one or more calls to readVar. Error information may be read from the PDU with the readError function. Because GetBulk PDUs send additional information in the SNMP header, the writeBulkParameters function is provided to configure these parameters.

readVar和writeVar访问PDU的可变长度varbind列表。在每个readVar和writeVar操作中指定PDU句柄和该PDU内变量的索引。一旦通过一个或多个对writeVar的调用完全指定了PDU,它将被传递到snmpSend(通过引用PDU句柄)以及操作中要包含的varbind数。当返回响应时,响应的内容将在另一个PDU中返回,并且可以通过对readVar的一个或多个调用来读取。可以使用readError功能从PDU读取错误信息。由于GetBulk PDU在SNMP标头中发送附加信息,因此提供了writeBulkParameters函数来配置这些参数。

Varbinds in this data store are created automatically whenever they are written by any writeVar or snmpSend operation.

每当任何writeVar或snmpSend操作写入此数据存储中的变量绑定时,都会自动创建它们。

   For example:
     var pdu = newPDU();
     var nVars = 0, oid, type, value;
        
   For example:
     var pdu = newPDU();
     var nVars = 0, oid, type, value;
        
     writeVar(pdu, nVars++, "sysDescr.0", "", Null);
     writeVar(pdu, nVars++, "sysOID.0", "", Null);
     writeVar(pdu, nVars++, "ifNumber.0", "", Null);
     if (snmpSend(pdu, nVars, Get, pdu, nVars))
         return;
     readVar(pdu, 0, oid, value, type);
     readVar(pdu, 1, oid, value, type);
     readVar(pdu, 2, oid, value, type);
     ...
        
     writeVar(pdu, nVars++, "sysDescr.0", "", Null);
     writeVar(pdu, nVars++, "sysOID.0", "", Null);
     writeVar(pdu, nVars++, "ifNumber.0", "", Null);
     if (snmpSend(pdu, nVars, Get, pdu, nVars))
         return;
     readVar(pdu, 0, oid, value, type);
     readVar(pdu, 1, oid, value, type);
     readVar(pdu, 2, oid, value, type);
     ...
        
   or,
     var pdu = newPDU();
     var nVars = 0, oid1, oid2;
        
   or,
     var pdu = newPDU();
     var nVars = 0, oid1, oid2;
        
     writeVar(pdu, nVars++, "ifIndex", "", Null);
     writeVar(pdu, nVars++, "ifType", "", Null);
     while(!done){
       if (snmpSend(pdu, nVars, Getnext, pdu, nVars))
           continue;
       readVar(pdu, 0, oid1, value, type);
       readVar(pdu, 1, oid2, value, type);
       /* leave OIDs alone, now PDU #0 is set up for next step
          in table walk. */
       if (oidncmp(oid1, "ifIndex", oidlen("ifIndex")))
         done = 0;
       ...
     }
        
     writeVar(pdu, nVars++, "ifIndex", "", Null);
     writeVar(pdu, nVars++, "ifType", "", Null);
     while(!done){
       if (snmpSend(pdu, nVars, Getnext, pdu, nVars))
           continue;
       readVar(pdu, 0, oid1, value, type);
       readVar(pdu, 1, oid2, value, type);
       /* leave OIDs alone, now PDU #0 is set up for next step
          in table walk. */
       if (oidncmp(oid1, "ifIndex", oidlen("ifIndex")))
         done = 0;
       ...
     }
        

Note that in the preceding examples, descriptors such as ifType and sysDescr are used in object identifiers solely as a notational convenience. The actual code downloaded to the policy MIB agent must use a dotted decimal notation only, as there may be no MIB compiler (or MIB file) available on the policy MIB agent.

请注意,在前面的示例中,在对象标识符中使用ifType和sysDescr之类的描述符仅仅是为了便于使用符号。下载到策略MIB代理的实际代码必须仅使用点十进制表示法,因为策略MIB代理上可能没有可用的MIB编译器(或MIB文件)。

To conform to this specification, implementations must allow each policy script invocation to allocate at least 5 PDUs with at least 64 varbinds per list. It is suggested that implementations limit the total number of PDUs per invocation to protect other script invocations from a malfunctioning script (e.g., a script that calls newPDU() in a loop).

为了符合此规范,实现必须允许每个策略脚本调用分配至少5个PDU,每个列表至少有64个varbind。建议实现限制每次调用的PDU总数,以保护其他脚本调用不受故障脚本(例如,在循环中调用newPDU()的脚本)的影响。

8.1.4.1. newPDU()
8.1.4.1. newPDU()

integer newPDU()

整数newPDU()

newPDU will allocate a new PDU and return a handle to the PDU. If no PDU could be allocated, -1 will be returned. The PDU's initial values of nonRepeaters and maxRepetitions will be zero.

newPDU将分配一个新的PDU并向PDU返回一个句柄。如果无法分配PDU,将返回-1。PDU的非重复和最大重复的初始值将为零。

8.1.4.2. writeVar()
8.1.4.2. writeVar()

writeVar(integer pdu, integer varBindIndex, string oid, var value, integer type)

writeVar(整数pdu、整数varBindIndex、字符串oid、变量值、整数类型)

writeVar will store 'oid', 'value', and 'type' in the specified varbind.

writeVar将在指定的varbind中存储“oid”、“value”和“type”。

'pdu' is the handle to a PDU allocated by newPDU().

“pdu”是newPDU()分配的pdu的句柄。

'varBindIndex' is a non-negative integer that identifies the varbind within the specified PDU modified by this call. The first varbind is number 0.

“varBindIndex”是一个非负整数,用于标识此调用修改的指定PDU中的varbind。第一个varbind是数字0。

'oid' is a string containing an ASCII dotted-decimal representation of an object identifier (e.g., "1.3.6.1.2.1.1.1.0").

“oid”是一个字符串,包含对象标识符的ASCII点十进制表示形式(例如,“1.3.6.1.2.1.1.1.0”)。

'value' is the value to be stored, of a type appropriate to the 'type' parameter.

“value”是要存储的值,其类型适合于“type”参数。

'type' will be the type of the value parameter and will be set to one of the values for DataType Constants.

“type”将是value参数的类型,并将设置为DataType常量的值之一。

It is an RTE if any of the parameters don't conform to the rules above.

如果任何参数不符合上述规则,则为RTE。

8.1.4.3. readVar()
8.1.4.3. readVar()

readVar(integer pdu, integer varBindIndex, string &oid, var &value, integer &type)

readVar(整数pdu、整数VARBindex、字符串和oid、变量和值、整数和类型)

readVar will retrieve the oid, the value, and its type from the specified varbind.

readVar将从指定的varbind检索oid、值及其类型。

'pdu' is the handle to a PDU allocated by newPDU().

“pdu”是newPDU()分配的pdu的句柄。

'varBindIndex' is a non-negative integer that identifies the varbind within the specified PDU read by this call. The first varbind is number 0.

“varBindIndex”是一个非负整数,用于标识此调用读取的指定PDU中的varbind。第一个varbind是数字0。

The object identifier value of the referenced varbind will be copied into the 'oid' parameter, formatted in an ASCII dotted-decimal representation (e.g., "1.3.6.1.2.1.1.1.0").

引用的varbind的对象标识符值将被复制到“oid”参数中,并以ASCII点十进制表示形式格式化(例如,“1.3.6.1.2.1.1.1.0”)。

'value' is the value retrieved, of a type appropriate to the 'type' parameter.

“value”是检索到的值,其类型适合于“type”参数。

'type' is the type of the value parameter and will be set to one of the values for DataType Constants.

“type”是value参数的类型,将被设置为DataType常量的值之一。

It is an RTE if 'pdu' doesn't reference a valid PDU or 'varBindIndex' doesn't reference a valid varbind.

如果“pdu”未引用有效的pdu或“varBindIndex”未引用有效的varbind,则为RTE。

8.1.4.4. snmpSend()
8.1.4.4. snmpSend()

integer snmpSend(integer reqPDU, integer reqNumVarbinds, integer opcode, integer &respPDU, integer &respNumVarbinds, [, string contextName , NonLocalArgs] )

整数snmpSend(整数reqPDU、整数reqNumVarbinds、整数操作码、整数和respPDU、整数和respNumVarbinds、[、字符串contextName、非本地参数])

snmpSend will perform an SNMP operation by sending 'reqPDU' and returning the results in 'respPDU'. Both 'reqPDU' and 'respPDU' must previously have been allocated with newPDU. 'reqPDU' and 'respPDU' may both contain the same PDU handle, in which case the 'reqPDU' is sent and then replaced with the contents of the received PDU. If the opcode specifies a Trap or V2trap, 'respPDU' will not be modified.

snmpSend将通过发送“reqPDU”并在“respPDU”中返回结果来执行SNMP操作。“reqPDU”和“respPDU”之前必须与newPDU一起分配。”“reqPDU”和“respPDU”可能都包含相同的PDU句柄,在这种情况下,发送“reqPDU”,然后替换为接收到的PDU的内容。如果操作码指定陷阱或V2trap,则不会修改“respPDU”。

'reqNumVarbinds' is an integer greater than zero that specifies which varbinds in the PDU will be used in this operation. The first 'reqNumVarbinds' in the PDU are used. 'respNumVarbinds' will be modified to contain the number of varbinds received in the response PDU, which, in the case of GetBulk or an error, may be substantially different from reqNumVarbinds.

“ReqNumValbinds”是一个大于零的整数,用于指定在此操作中将使用PDU中的哪些变量绑定。使用PDU中的第一个“ReqNumValbind”respNumVarbinds'将被修改,以包含响应PDU中接收到的varbinds的数量,在GetBulk或错误的情况下,这可能与Reknumvarbinds有很大不同。

'opcode' is the type of SNMP operation to perform and must be one of the values for SNMP Operation Constants listed in the 'Constants' section below.

“操作码”是要执行的SNMP操作类型,必须是下面“常量”部分中列出的SNMP操作常量值之一。

The optional 'contextName' argument contains the SNMP context on which to operate. If 'contextName' is not present, the contextName of 'this element' will be used. If 'contextName' is the zero-length string, the default context is used.

可选的“contextName”参数包含要在其上操作的SNMP上下文。如果“contextName”不存在,则将使用“this element”的contextName。如果“contextName”是长度为零的字符串,则使用默认上下文。

Note that no actual SNMP PDU has to be generated and parsed when the policy MIB agent resides on the same system as the managed elements. If no PDU is generated, the agent must correctly simulate the behavior of the SNMP Response PDU, particularly in case of an error.

请注意,当策略MIB代理与托管元素驻留在同一系统上时,不必生成和解析实际的SNMP PDU。如果未生成PDU,则代理必须正确模拟SNMP响应PDU的行为,尤其是在发生错误的情况下。

This function returns zero unless an error occurs, in which case it returns the proper SNMP Error Constant. If an error occurred, respPDU will contain the response PDU as received from the agent, unless no response PDU was received, in which case respNumVarbinds will be 0. In any event, readError may be called on the PDU to determine error information for the transaction.

除非发生错误,否则此函数将返回零,在这种情况下,它将返回正确的SNMP错误常量。如果发生错误,respPDU将包含从代理收到的响应PDU,除非未收到响应PDU,在这种情况下,RespNumValbinds将为0。在任何情况下,都可以在PDU上调用readError来确定事务的错误信息。

If an SNMP Version 1 trap is requested (the opcode is Trap(4)), then SNMP Version 2 trap parameters are supplied and converted according to the rules of RFC 3584 [8], section 3.2. The first

如果请求SNMP版本1陷阱(操作码为陷阱(4)),则根据RFC 3584[8]第3.2节的规则提供并转换SNMP版本2陷阱参数。第一

variable binding must be sysUpTime.0, and the second must be snmpTrapOID.0, as per RFC 3416 [7], section 4.2.6. Subsequent variable bindings are copied to the SNMP Version 1 trap PDU in the usual fashion.

根据RFC 3416[7],第4.2.6节,变量绑定必须是sysUpTime.0,第二个必须是snmpTrapOID.0。随后的变量绑定以通常的方式复制到SNMP版本1陷阱PDU。

8.1.4.5. readError()
8.1.4.5. readError()

readError(integer pdu, integer numVarbinds, integer &errorStatus, integer &errorIndex, integer &hasException)

readError(integer pdu、integer numVarbinds、integer&errorStatus、integer&errorIndex、integer&hasException)

Returns the error information in a PDU.

返回PDU中的错误信息。

'errorStatus' contains the error-status field from the response PDU or a local error constant if the error was generated locally. If no error was experienced or no PDU was ever copied into this PDU, this value will be 0.

“errorStatus”包含响应PDU中的错误状态字段,如果错误是在本地生成的,则包含本地错误常量。如果未发生错误或从未将任何PDU复制到此PDU,则此值将为0。

'errorIndex' contains the error-index field from the response PDU. If no PDU was ever copied into this PDU, this value will be 0.

“errorIndex”包含响应PDU中的错误索引字段。如果从未将任何PDU复制到此PDU,则此值将为0。

'hasException' will be 1 if any of the first 'numVarbinds' varbinds in the PDU contain an exception (Nosuchobject, Nosuchinstance, Endofmibview); otherwise it will be 0.

如果PDU中的任何第一个'numvarbind'变量绑定包含异常(Nosuchobject、Nosuchinstance、Endofmibview),则'hasException'将为1;否则将为0。

It is an RTE if 'pdu' does not reference a valid PDU or if 'numVarbinds' references varbinds that aren't valid.

如果“pdu”未引用有效的pdu或“numVarbinds”引用无效的varbinds,则为RTE。

8.1.4.6. writeBulkParameters()
8.1.4.6. writeBulkParameters()

writeBulkParameters(integer pdu, integer nonRepeaters, integer maxRepetitions)

writeBulkParameters(整数pdu、整数非重复、整数最大重复)

Modifies the parameters in a PDU in any subsequent GetBulk operation sent by the PDU. 'nonRepeaters' will be copied into the PDU's non-repeaters field, and 'maxRepetitions' into the max-repetitions field.

在PDU发送的任何后续GetBulk操作中修改PDU中的参数。'“非重复”将复制到PDU的“非重复”字段中,“最大重复”将复制到“最大重复”字段中。

This function may be called before or after writeVar is called to add varbinds to the PDU, but it must be called before the PDU is sent; otherwise, it will have no effect. A new PDU is initialized with nonRepeaters set to zero and maxRepetitions set to zero. If a Bulk PDU is sent before writeBulkParameters is called, these default values will be used. If writeBulkParameters is called to modify a PDU, it is acceptable if this PDU is later sent as a type other than bulk. The writeBulkParameters call will only affect subsequent sends of Bulk PDUs. If a PDU is used to receive the contents of a

可以在调用writeVar之前或之后调用此函数,以将varbinds添加到PDU,但必须在发送PDU之前调用此函数;否则,它将没有任何效果。新PDU初始化时,非重复项设置为零,最大重复项设置为零。如果在调用writeBulkParameters之前发送批量PDU,则将使用这些默认值。如果调用writeBulkParameters来修改PDU,则可以接受此PDU以后作为批量以外的类型发送。writeBulkParameters调用只会影响批量PDU的后续发送。如果PDU用于接收

response, the values of nonRepeaters and maxRepetitions are never modified.

响应时,从不修改非重复项和最大重复项的值。

8.1.5. Constants for SNMP Library Functions
8.1.5. SNMP库函数的常量

The following constants are defined for use with all SNMP Library Functions. Policy code will be executed in an environment where the following constants are declared. (Note that the constant declarations below will not be visible in the policyCondition or policyAction code.) These constants are reserved words and cannot be used for any variable or function name.

以下常量定义用于所有SNMP库函数。策略代码将在声明以下常量的环境中执行。(请注意,下面的常量声明在policyCondition或policyAction代码中不可见。)这些常量是保留字,不能用于任何变量或函数名。

Although these declarations are expressed here as C 'const's, the 'const' construct itself is not available to be used in policy code.

尽管这些声明在这里表示为C'const's,但在策略代码中不能使用'const'构造本身。

// Datatype Constants

//数据类型常数

   // From RFC 2578 [2]
   const integer Integer       = 2;
   const integer Integer32     = 2;
   const integer String        = 4;
   const integer Bits          = 4;
   const integer Null          = 5;
   const integer Oid           = 6;
   const integer IpAddress     = 64;
   const integer Counter32     = 65;
   const integer Gauge32       = 66;
   const integer Unsigned32    = 66;
   const integer TimeTicks     = 67;
   const integer Opaque        = 68;
   const integer Counter64     = 70;
        
   // From RFC 2578 [2]
   const integer Integer       = 2;
   const integer Integer32     = 2;
   const integer String        = 4;
   const integer Bits          = 4;
   const integer Null          = 5;
   const integer Oid           = 6;
   const integer IpAddress     = 64;
   const integer Counter32     = 65;
   const integer Gauge32       = 66;
   const integer Unsigned32    = 66;
   const integer TimeTicks     = 67;
   const integer Opaque        = 68;
   const integer Counter64     = 70;
        
   // SNMP Exceptions from RFC 3416 [7]
   const integer NoSuchObject         = 128;
   const integer NoSuchInstance       = 129;
   const integer EndOfMibView         = 130;
        
   // SNMP Exceptions from RFC 3416 [7]
   const integer NoSuchObject         = 128;
   const integer NoSuchInstance       = 129;
   const integer EndOfMibView         = 130;
        
   // SNMP Error Constants from RFC 3416 [7]
   const integer NoError              = 0;
   const integer TooBig               = 1;
   const integer NoSuchName           = 2;
   const integer BadValue             = 3;
   const integer ReadOnly             = 4;
   const integer GenErr               = 5;
   const integer NoAccess             = 6;
   const integer WrongType            = 7;
   const integer WrongLength          = 8;
   const integer WrongEncoding        = 9;
        
   // SNMP Error Constants from RFC 3416 [7]
   const integer NoError              = 0;
   const integer TooBig               = 1;
   const integer NoSuchName           = 2;
   const integer BadValue             = 3;
   const integer ReadOnly             = 4;
   const integer GenErr               = 5;
   const integer NoAccess             = 6;
   const integer WrongType            = 7;
   const integer WrongLength          = 8;
   const integer WrongEncoding        = 9;
        
   const integer WrongValue           = 10;
   const integer NoCreation           = 11;
   const integer InconsistentValue    = 12;
   const integer ResourceUnavailable  = 13;
   const integer CommitFailed         = 14;
   const integer UndoFailed           = 15;
   const integer AuthorizationError   = 16;
   const integer NotWritable          = 17;
   const integer InconsistentName     = 18;
        
   const integer WrongValue           = 10;
   const integer NoCreation           = 11;
   const integer InconsistentValue    = 12;
   const integer ResourceUnavailable  = 13;
   const integer CommitFailed         = 14;
   const integer UndoFailed           = 15;
   const integer AuthorizationError   = 16;
   const integer NotWritable          = 17;
   const integer InconsistentName     = 18;
        
   // "Local" Errors
   // These are also possible choices for errorStatus returns
   // For example: unknown PDU, maxVarbinds is bigger than number
   // written with writeVar, unknown opcode, etc.
   const integer BadParameter         = 1000;
        
   // "Local" Errors
   // These are also possible choices for errorStatus returns
   // For example: unknown PDU, maxVarbinds is bigger than number
   // written with writeVar, unknown opcode, etc.
   const integer BadParameter         = 1000;
        
   // Request would have created a PDU larger than local limitations
   const integer TooLong              = 1001;
        
   // Request would have created a PDU larger than local limitations
   const integer TooLong              = 1001;
        
   // A response to the request was received but errors were encountered
   // when parsing it.
   const integer ParseError           = 1002;
        
   // A response to the request was received but errors were encountered
   // when parsing it.
   const integer ParseError           = 1002;
        
   // Local system has complained of an authentication failure
   const integer AuthFailure          = 1003;
        
   // Local system has complained of an authentication failure
   const integer AuthFailure          = 1003;
        
   // No valid response was received in a timely fashion
   const integer TimedOut             = 1004;
        
   // No valid response was received in a timely fashion
   const integer TimedOut             = 1004;
        
   // General local failure including lack of resources
   const integer GeneralFailure       = 1005;
        
   // General local failure including lack of resources
   const integer GeneralFailure       = 1005;
        
   // SNMP Operation Constants from RFC 3416 [7]
   const integer Get                  = 0;
   const integer Getnext              = 1;
   const integer Set                  = 3;
   const integer Trap                 = 4;
   const integer Getbulk              = 5;
   const integer Inform               = 6;
   const integer V2trap               = 7;
        
   // SNMP Operation Constants from RFC 3416 [7]
   const integer Get                  = 0;
   const integer Getnext              = 1;
   const integer Set                  = 3;
   const integer Trap                 = 4;
   const integer Getbulk              = 5;
   const integer Inform               = 6;
   const integer V2trap               = 7;
        
   // Constants from RFC 3411 [1] for SnmpMessageProcessingModel
   const integer SNMPv1              = 0;
   const integer SNMPv2c             = 1;
   const integer SNMPv3              = 3;
        
   // Constants from RFC 3411 [1] for SnmpMessageProcessingModel
   const integer SNMPv1              = 0;
   const integer SNMPv2c             = 1;
   const integer SNMPv3              = 3;
        
   // Constants from RFC 3411 [1] for SnmpSecurityModel
   const integer SNMPv1              = 1;
   const integer SNMPv2c             = 2;
   const integer USM                 = 3;
        
   // Constants from RFC 3411 [1] for SnmpSecurityModel
   const integer SNMPv1              = 1;
   const integer SNMPv2c             = 2;
   const integer USM                 = 3;
        
   // SnmpSecurityLevel Constants from RFC 3411 [1]
   const integer NoAuthNoPriv        = 1;
   const integer AuthNoPriv          = 2;
   const integer AuthPriv            = 3;
        
   // SnmpSecurityLevel Constants from RFC 3411 [1]
   const integer NoAuthNoPriv        = 1;
   const integer AuthNoPriv          = 2;
   const integer AuthPriv            = 3;
        
   // Constants for use with searchColumn
   const integer ExactMatch          = 0;
   const integer ExactCaseMatch      = 1;
   const integer SubstringMatch      = 2;
   const integer SubstringCaseMatch  = 3;
   const integer RegexpMatch         = 4;
   const integer RegexpCaseMatch     = 5;
        
   // Constants for use with searchColumn
   const integer ExactMatch          = 0;
   const integer ExactCaseMatch      = 1;
   const integer SubstringMatch      = 2;
   const integer SubstringCaseMatch  = 3;
   const integer RegexpMatch         = 4;
   const integer RegexpCaseMatch     = 5;
        
8.2. Policy Library Functions
8.2. 策略库功能

Policy Library Functions provide access to information specifically related to the execution of policies.

策略库功能提供对与策略执行具体相关的信息的访问。

8.2.1. elementName()
8.2.1. elementName()

The elementName() function is used to determine what the current element is and can be used to provide information about the type of element and how it is indexed.

elementName()函数用于确定当前元素是什么,并可用于提供有关元素类型及其索引方式的信息。

string elementName()

字符串elementName()

elementName returns a string containing an ASCII dotted-decimal representation of an object identifier (e.g., 1.3.6.1.2.1.1.1.0). This object identifier identifies an instance of a MIB object that is an attribute of 'this element'.

elementName返回一个字符串,该字符串包含对象标识符的ASCII点十进制表示形式(例如,1.3.6.1.2.1.1.1.0)。此对象标识符标识作为“This element”属性的MIB对象的实例。

8.2.2. elementAddress()
8.2.2. elementAddress()

elementAddress(&tDomain, &tAddress)

元素地址(&T地址,&T地址)

elementAddress finds a domain/address pair that can be used to access 'this element' and returns the values in 'tDomain' and 'tAddress'.

elementAddress查找可用于访问“this element”的域/地址对,并返回“tDomain”和“tAddress”中的值。

8.2.3. elementContext()
8.2.3. elementContext()

string elementContext()

string elementContext()

elementContext() returns a string containing the SNMP contextName of 'this element'.

elementContext()返回一个包含“this element”的SNMP contextName的字符串。

8.2.4. ec()
8.2.4. ec()

The ec() (element count) and ev() (element value) functions provide convenient access to the components of the index for 'this element'. Typical uses will be in creating the index to other, related elements.

ec()(元素计数)和ev()(元素值)函数提供了对“this element”索引组件的方便访问。典型的用途是创建其他相关元素的索引。

integer ec()

整数ec()

ec() returns an integer count of the number of index subidentifiers that exist in the index for 'this element'.

ec()返回“this element”索引中存在的索引子标识符数的整数计数。

8.2.5. ev()
8.2.5. ev()

integer ev(integer n)

整数ev(整数n)

ev() returns the value of the nth subidentifier in the index for 'this element'. The first subidentifier is indexed at 0. It is an RTE if n specifies a subidentifier beyond the last subidentifier.

ev()返回“this element”索引中第n个子标识符的值。第一个子标识符在0处编制索引。如果n在最后一个子标识符之外指定子标识符,则为RTE。

8.2.6. roleMatch()
8.2.6. 角色匹配()

The roleMatch() function is used to check whether an element has been assigned a particular role.

函数的作用是:检查一个元素是否被分配了特定的角色。

integer roleMatch(string roleString [, string element, string contextName, string contextEngineID])

整数角色匹配(字符串roleString[,字符串元素,字符串contextName,字符串contextEngineID])

'roleString' is a string. The optional argument 'element' contains the OID name of an element, defaulting to the current element if 'element' is not supplied. If roleString exactly matches (content and length) any role assigned to the specified element, the function returns 1. If no roles match, the function returns 0.

“roleString”是一个字符串。可选参数“element”包含元素的OID名称,如果未提供“element”,则默认为当前元素。如果roleString与分配给指定元素的任何角色(内容和长度)完全匹配,则函数返回1。如果没有匹配的角色,则函数返回0。

The optional 'contextName' argument contains the SNMP context on which to operate. If 'contextName' is not present, the contextName of 'this element' will be used. If 'contextName' is the zero-length string, the default context is used.

可选的“contextName”参数包含要在其上操作的SNMP上下文。如果“contextName”不存在,则将使用“this element”的contextName。如果“contextName”是长度为零的字符串,则使用默认上下文。

'contextEngineID' contains the contextEngineID of the remote system on which 'element' resides. It is encoded as a pair of hex digits (upper- and lowercase are valid) for each octet of the contextEngineID. If 'contextEngineID' is not present, the contextEngineID of 'this element' will be used. 'contextEngineID' may only be present if the 'element' and 'context' arguments are present.

“contextEngineID”包含“元素”所在的远程系统的contextEngineID。它被编码为contextEngineID的每个八位字节的一对十六进制数字(大写和小写有效)。如果“contextEngineID”不存在,则将使用“this element”的contextEngineID只有在“元素”和“上下文”参数存在时,contextEngineID才可能存在。

8.2.7. Scratchpad Functions
8.2.7. 草稿行功能

Every maxLatency time period, every policy runs once for each element. When the setScratchpad function executes, it stores a value named by a string that can be retrieved with getScratchpad() even after this policy execution code exits. This allows sharing of data between a condition and an action, two conditions executing on different elements, or even different policies altogether.

每个maxLatency时间段,每个策略对每个元素运行一次。执行setScratchpad函数时,它存储一个以字符串命名的值,即使在该策略执行代码退出后,也可以使用getScratchpad()检索该值。这允许在一个条件和一个操作之间共享数据,在不同元素上执行两个条件,或者甚至是完全不同的策略。

The value of 'scope' controls which policy/element combinations can retrieve this 'varName'/'value' pair. The following are options for 'scope':

“scope”的值控制哪些策略/元素组合可以检索此“varName”/“value”对。以下是“范围”的选项:

Global The 'varName'/'value' combination will be available in the condition or action of any policy while it is executing on any element. Note that any information placed here will be visible to all other scripts on this system regardless of their authority. Sensitive information should not be placed in global scratchpad variables.

全局“varName”/“value”组合在任何元素上执行时,在任何策略的条件或操作中都可用。请注意,此处放置的任何信息都将对该系统上的所有其他脚本可见,无论其权限如何。敏感信息不应放在全局草稿行变量中。

Policy The 'varName'/'value' combination will be available in any future execution of the condition or action of the current policy (regardless of what element the policy is executing on). If a policy is ever deleted, or if its condition or action code is modified, all values in its 'Policy' scope will be deleted.

策略“varName”/“value”组合将在当前策略的条件或操作的任何未来执行中可用(无论策略在哪个元素上执行)。如果策略被删除,或者其条件或操作代码被修改,则其“策略”范围内的所有值都将被删除。

PolicyElement The 'varName'/'value' combination will be available in future executions of the condition or action of the current policy, but only when the policy is executing on the current element. If a policy is ever deleted, or if its condition or action code is modified, all values in its 'PolicyElement' scope will be deleted. The agent may also periodically delete values in a 'PolicyElement' scope if the corresponding element does not exist (in other words, if an element disappears for a period and reappears, values in its 'PolicyElement' scope may or may not be deleted).

PolicyElement“varName”/“value”组合将在未来执行当前策略的条件或操作时可用,但仅当策略在当前元素上执行时可用。如果策略被删除,或者其条件或操作代码被修改,则其“PolicyElement”范围内的所有值都将被删除。如果“PolicyElement”范围内不存在相应的元素,则代理还可以定期删除“PolicyElement”范围内的值(换句话说,如果元素在一段时间内消失并重新出现,则其“PolicyElement”范围内的值可以删除,也可以不删除)。

setScratchpad's 'storageType' argument allows the script to control the lifetime of a variable stored in the scratchpad. If the storageType is equal to the constant 'volatile', then this variable must be deleted on a reboot. If it is equal to 'nonVolatile', then this variable should be stored in non-volatile storage, where it will be available after a reboot. If the 'storageType' argument is not present, the variable will be volatile and will be erased on reboot.

setScratchpad的“storageType”参数允许脚本控制存储在草稿行中的变量的生存期。如果storageType等于常量“volatile”,则必须在重新启动时删除此变量。如果该变量等于“非易失性”,则该变量应存储在非易失性存储器中,在重新启动后该变量将可用。如果“storageType”参数不存在,则该变量将不稳定,并将在重新启动时擦除。

If the optional 'freeOnException' argument is present and equal to 1, the agent will free this variable if, later in the same script invocation, this script dies with a run-time exception or by a call to fail(). (Note that this does not apply to exceptions experienced in subsequent invocations of the script.)

如果可选的“freeOnException”参数存在且等于1,则如果稍后在同一脚本调用中,此脚本因运行时异常或调用fail()而死亡,则代理将释放此变量。(请注意,这不适用于脚本后续调用中遇到的异常。)

Note that there may be implementation-specific limits on the number of scratchpad variables that can be allocated. The limit of unique scratchpad variables may be different for each scope or storageType. It is suggested that implementations limit the total number of scratchpad variables per script to protect other scripts from a malfunctioning script. In addition, compliant implementations must support at least 50 Global variables, 5 Policy variables per policy, and 5 PolicyElement variables per policy-element pair.

请注意,可以分配的草稿行变量的数量可能有特定于实现的限制。对于每个作用域或存储类型,唯一草稿行变量的限制可能不同。建议实现限制每个脚本的scratchpad变量总数,以保护其他脚本不受故障脚本的影响。此外,兼容实现必须支持至少50个全局变量、每个策略5个策略变量和每个策略元素对5个策略元素变量。

Scratchpad Usage Examples

草稿行使用示例

   Policy  Element    Action
   A       ifIndex.1  setScratchpad(Global, "foo", "55")
   A       ifIndex.1  getScratchpad(Global, "foo", val) --> 55
   A       ifIndex.2  getScratchpad(Global, "foo", val) --> 55
   B       ifIndex.2  getScratchpad(Global, "foo", val) --> 55
   B       ifIndex.2  setScratchpad(Global, "foo", "16")
   A       ifIndex.1  getScratchpad(Global, "foo", val) --> 16
        
   Policy  Element    Action
   A       ifIndex.1  setScratchpad(Global, "foo", "55")
   A       ifIndex.1  getScratchpad(Global, "foo", val) --> 55
   A       ifIndex.2  getScratchpad(Global, "foo", val) --> 55
   B       ifIndex.2  getScratchpad(Global, "foo", val) --> 55
   B       ifIndex.2  setScratchpad(Global, "foo", "16")
   A       ifIndex.1  getScratchpad(Global, "foo", val) --> 16
        
   Policy  Element    Action
   A       ifIndex.1  setScratchpad(Policy, "bar", "75")
   A       ifIndex.1  getScratchpad(Policy, "bar", val) --> 75
   A       ifIndex.2  getScratchpad(Policy, "bar", val) --> 75
   B       ifIndex.1  getScratchpad(Policy, "bar", val) not found
   B       ifIndex.1  setScratchpad(Policy, "bar", "20")
   A       ifIndex.2  getScratchpad(Policy, "bar", val) --> 75
   B       ifIndex.2  getScratchpad(Policy, "bar", val) --> 20
        
   Policy  Element    Action
   A       ifIndex.1  setScratchpad(Policy, "bar", "75")
   A       ifIndex.1  getScratchpad(Policy, "bar", val) --> 75
   A       ifIndex.2  getScratchpad(Policy, "bar", val) --> 75
   B       ifIndex.1  getScratchpad(Policy, "bar", val) not found
   B       ifIndex.1  setScratchpad(Policy, "bar", "20")
   A       ifIndex.2  getScratchpad(Policy, "bar", val) --> 75
   B       ifIndex.2  getScratchpad(Policy, "bar", val) --> 20
        

Policy Element Action A ifIndex.1 setScratchpad(PolicyElement, "baz", "43") A ifIndex.1 getScratchpad(PolicyElement, "baz", val) --> 43 A ifIndex.2 getScratchpad(PolicyElement, "baz", val) not found B ifIndex.1 getScratchpad(PolicyElement, "baz", val) not found A ifIndex.2 setScratchpad(PolicyElement, "baz", "54")

策略元素操作A ifIndex.1设置ScratchPad(策略元素,“baz”,“43”)A ifIndex.1获取ScratchPad(策略元素,“baz”,val)-->43 A ifIndex.2获取ScratchPad(策略元素,“baz”,val)未找到B ifIndex.1设置ScratchPad(策略元素,“baz”,val)未找到ifIndex.2设置ScratchPad(策略元素,“baz”,“54”)

   B       ifIndex.1  setScratchpad(PolicyElement, "baz", "65")
   A       ifIndex.1  getScratchpad(PolicyElement, "baz", val) --> 43
   A       ifIndex.2  getScratchpad(PolicyElement, "baz", val) --> 54
   B       ifIndex.1  getScratchpad(PolicyElement, "baz", val) --> 65
        
   B       ifIndex.1  setScratchpad(PolicyElement, "baz", "65")
   A       ifIndex.1  getScratchpad(PolicyElement, "baz", val) --> 43
   A       ifIndex.2  getScratchpad(PolicyElement, "baz", val) --> 54
   B       ifIndex.1  getScratchpad(PolicyElement, "baz", val) --> 65
        
   Policy  Element    Action
   A       ifIndex.1  setScratchpad(PolicyElement, "foo", "11")
   A       ifIndex.1  setScratchpad(Global,        "foo", "22")
   A       ifIndex.1  getScratchpad(PolicyElement, "foo", val) --> 11
   A       ifIndex.1  getScratchpad(Global,        "foo", val) --> 22
        
   Policy  Element    Action
   A       ifIndex.1  setScratchpad(PolicyElement, "foo", "11")
   A       ifIndex.1  setScratchpad(Global,        "foo", "22")
   A       ifIndex.1  getScratchpad(PolicyElement, "foo", val) --> 11
   A       ifIndex.1  getScratchpad(Global,        "foo", val) --> 22
        

Constants

常数

The following constants are defined for use with the scratchpad functions. Policy code will be executed in an environment where the following constants are declared. (Note that these constant declarations will not be visible in the policyCondition or policyAction MIB objects.)

以下常量定义用于scratchpad函数。策略代码将在声明以下常量的环境中执行。(请注意,这些常量声明在policyCondition或policyAction MIB对象中不可见。)

Although these declarations are expressed here as C 'const's, the 'const' construct itself is not available to be used inside of policy code.

尽管这些声明在这里表示为C'const's,但在策略代码中不能使用'const'构造本身。

// Scratchpad Constants

//草稿行常数

   // Values of scope
   const integer Global           = 0;
   const integer Policy           = 1;
   const integer PolicyElement    = 2;
        
   // Values of scope
   const integer Global           = 0;
   const integer Policy           = 1;
   const integer PolicyElement    = 2;
        
   // Values of storageType
   const integer Volatile         = 0;
   const integer NonVolatile      = 1;
        
   // Values of storageType
   const integer Volatile         = 0;
   const integer NonVolatile      = 1;
        
8.2.8. setScratchpad()
8.2.8. setScratchpad()

setScratchpad(integer scope, string varName [, string value, integer storageType, integer freeOnException ])

setScratchpad(整数范围,字符串varName[,字符串值,整数存储类型,整数FreeOneException])

The setScratchpad function stores a value that can be retrieved even after this policy execution code exits.

setScratchpad函数存储一个即使在此策略执行代码退出后也可以检索的值。

The value of 'scope' controls which policy/element combinations can retrieve this 'varName'/'value' pair. The options for 'scope' are Global, Policy, and PolicyElement.

“scope”的值控制哪些策略/元素组合可以检索此“varName”/“value”对。“范围”的选项包括全局、策略和策略元素。

'varName' is a string used to identify the value. Subsequent retrievals of the same 'varName' in the proper scope will return the value stored. Note that the namespace for 'varName' is distinct for each scope. 'varName' is case sensitive.

“varName”是用于标识值的字符串。在适当范围内对同一“varName”的后续检索将返回存储的值。请注意,“varName”的命名空间对于每个作用域都是不同的varName'区分大小写。

'value' is a string containing the value to be stored. ToString(value) is called on 'value' to convert it to a string before storage.

“value”是包含要存储的值的字符串。在“value”上调用ToString(value),以便在存储之前将其转换为字符串。

If the 'value' argument is missing, the 'varName' in scope 'scope' will be deleted if it exists.

如果缺少'value'参数,则范围'scope'中的'varName'将被删除(如果存在)。

If the optional 'storageType' argument is present and is equal to the constant 'Volatile', then this variable must be deleted on a reboot. If it is equal to 'NonVolatile', then this variable should be stored in non-volatile storage, where it will be available after a reboot. If the 'storageType' argument is not present, the variable will be volatile and will be erased on reboot. 'storageType' may not be present if the 'value' argument is not present. If the variable already existed, its previous storageType is updated according to the current 'storageType' argument.

如果存在可选的“storageType”参数且该参数等于常量“Volatile”,则必须在重新启动时删除该变量。如果该变量等于“非易失性”,则该变量应存储在非易失性存储器中,在重新启动后该变量将可用。如果“storageType”参数不存在,则该变量将不稳定,并将在重新启动时被删除如果'value'参数不存在,则storageType'可能不存在。如果变量已存在,则根据当前的“storageType”参数更新其以前的storageType。

If the optional 'freeOnException' argument is present and equal to 1, the agent will free this variable if, later in the same script invocation, this script dies with a run-time exception or by a call to fail(). (Note that this does not apply to exceptions experienced in subsequent invocations of the script.)

如果可选的“freeOnException”参数存在且等于1,则如果稍后在同一脚本调用中,此脚本因运行时异常或调用fail()而死亡,则代理将释放此变量。(请注意,这不适用于脚本后续调用中遇到的异常。)

8.2.9. getScratchpad()
8.2.9. getScratchpad()

integer getScratchpad(integer scope, string varName, string &value)

整型getScratchpad(整型范围、字符串变量名、字符串和值)

The getScratchpad function allows the retrieval of values that were stored previously in this execution context or in other execution contexts. The value of 'scope' controls which execution contexts can pass a value to this execution context. The options for 'scope' are Global, Policy, and PolicyElement.

getScratchpad函数允许检索以前在此执行上下文或其他执行上下文中存储的值。“scope”的值控制哪些执行上下文可以将值传递到此执行上下文。“范围”的选项包括全局、策略和策略元素。

'varName' is a string used to identify the value. Subsequent retrievals of the same 'varName' in the proper scope will return the value stored. Note that the namespace for varName is distinct for each scope. As a result, getScratchpad cannot force access to a variable in an inaccessible scope; it can only retrieve variables by referencing the proper scope in which they were set. 'varName' is case sensitive.

“varName”是用于标识值的字符串。在适当范围内对同一“varName”的后续检索将返回存储的值。请注意,varName的命名空间对于每个作用域都是不同的。因此,getScratchpad无法强制访问不可访问范围内的变量;它只能通过引用设置变量的适当范围来检索变量。”varName'区分大小写。

On successful return, 'value' will be set to the value that was previously stored; otherwise, 'value' will not be modified.

成功返回时,“值”将设置为以前存储的值;否则,“值”将不会被修改。

This function returns 1 if a value was previously stored and 0 otherwise.

如果以前存储了值,则此函数返回1,否则返回0。

8.2.10. signalError()
8.2.10. 信号错误()

The signalError() function is used by the script to indicate to a management station that it is experiencing abnormal behavior. signalError() turns on the conditionUserSignal(3) or actionUserSignal(5) bit in the associated pmTrackingPEInfo object (subsequent calls to signalError() have no additional effect). This bit is initially cleared at the beginning of each execution. If, upon a subsequent execution, the script finishes without calling signalError, the bit will be cleared.

脚本使用signalError()函数向管理站指示它正在经历异常行为。signalError()打开关联的pmTrackingPEInfo对象中的conditionUserSignal(3)或actionUserSignal(5)位(对signalError()的后续调用没有其他影响)。该位最初在每次执行开始时清除。如果在后续执行时,脚本在没有调用signalError的情况下完成,则该位将被清除。

signalError()

信号错误()

The signalException function takes no arguments and returns no value.

signalException函数不接受任何参数,也不返回任何值。

8.2.11. defer()
8.2.11. 推迟

Precedence groups enforce the rule that for each element, of the ready policies that match the condition, only the one with the highest precedence value will be active. Unfortunately, once the winning policy has been selected and the action begins running, situations can occur in which the policy script determines that it cannot complete its task. In many such cases, it is desirable that the next runner-up ready policy be executed. In the previous example, it would be desirable that at least bronze behavior be configured if gold is appropriate but gold isn't possible.

优先级组强制执行以下规则:对于每个元素,在匹配条件的就绪策略中,只有具有最高优先级值的元素将处于活动状态。不幸的是,一旦选择了获胜策略并且操作开始运行,就可能出现策略脚本确定无法完成其任务的情况。在许多此类情况下,最好执行下一个亚军就绪策略。在前面的示例中,如果gold是合适的,但gold是不可能的,则希望至少配置青铜行为。

When a policy defers, it exits, and the ready, condition-matching policy with the next-highest precedence is immediately run. Because this might also defer, the execution environment must remember where it is in the precedence chain so that it can continue going down the chain until an action completes without deferring, or until no policies are left in the precedence group. Once a policy finishes successfully, the next iteration will begin at the top of the precedence chain.

当策略延迟时,它将退出,并立即运行具有下一个最高优先级的就绪条件匹配策略。因为这也可能会延迟,所以执行环境必须记住它在优先级链中的位置,以便它可以继续沿着链向下运行,直到操作完成而不延迟,或者直到优先级组中没有留下任何策略为止。一旦策略成功完成,下一次迭代将从优先级链的顶部开始。

There are two ways to defer. A script can exit by calling fail() and specify that it should defer immediately. Alternately, a script can instruct the execution environment to defer automatically in the event of a run-time exception.

推迟有两种方式。脚本可以通过调用fail()退出,并指定它应该立即延迟。或者,脚本可以指示执行环境在发生运行时异常时自动延迟。

defer(integer deferOnRTE)

延迟(整数延迟)

The defer function changes the run-time exception behavior of a script. By default, a script will not defer when it encounters an RTE. If defer(1) is called, the exit behavior is changed so that the script will defer when it is terminated due to an RTE. If defer(0) is called, the script is reset to its default behavior and will not defer.

defer函数更改脚本的运行时异常行为。默认情况下,脚本遇到RTE时不会延迟。如果调用了defer(1),则退出行为将更改,以便脚本在由于RTE而终止时延迟。如果调用了defer(0),脚本将重置为其默认行为,并且不会延迟。

Note that calling defer doesn't cause the script to exit. Defer only changes the default behavior if an RTE occurs later in this invocation.

请注意,调用defer不会导致脚本退出。“延迟”仅在稍后在此调用中发生RTE时更改默认行为。

8.2.12. fail()
8.2.12. 失败()

fail(integer defer, integer free [, string message] )

失败(整数延迟,无整数[,字符串消息])

The fail function causes the script to optionally perform certain functions and then exit.

fail函数使脚本选择性地执行某些函数,然后退出。

If 'defer' is 1, this script will defer to the next lower precedence ready policy in the same precedence group whose condition matches. If 'defer' isn't 1, it will not defer. Note that if a condition defers, it is functionally equivalent to the condition returning false.

如果“延迟”为1,则此脚本将延迟到条件匹配的同一优先级组中的下一个低优先级就绪策略。如果'defer'不是1,则它不会延迟。请注意,如果条件延迟,则它在功能上等同于返回false的条件。

If 'free' is 1, certain registered resources will be freed. If, earlier in this script invocation, any rows were created by createRow with the 'freeOnException' option, the execution environment will set the RowStatus of each row to 'destroy' to delete the row. Further, if earlier in this script invocation any scratchpad variables were created or modified with the 'freeOnException' option, they will be deleted.

如果“free”为1,则将释放某些已注册的资源。如果在此脚本调用之前,createRow使用“FreeOneException”选项创建了任何行,则执行环境会将每行的RowStatus设置为“destroy”以删除该行。此外,如果在此脚本调用之前使用“FreeOneException”选项创建或修改了任何scratchpad变量,它们将被删除。

If the optional 'message' argument is present, it will be logged to the debugging table if pmPolicyDebugging is turned on for this policy.

如果存在可选的“message”参数,则如果为此策略启用了pmPolicyDebugging,则会将其记录到调试表中。

This function does not return. Instead, the script will terminate.

此函数不返回。相反,脚本将终止。

8.2.13. getParameters()
8.2.13. getParameters()

From time to time, policy scripts may be parameterized so that they are supplied with one or more parameters (e.g., site-specific constants). These parameters may be installed in the pmPolicyParameters object and are accessible to the script via the getParameters() function. If it is necessary for multiple parameters

有时,策略脚本可能会被参数化,以便为它们提供一个或多个参数(例如,特定于站点的常数)。这些参数可以安装在pmPolicyParameters对象中,脚本可以通过getParameters()函数访问这些参数。如果需要多个参数

to be passed to the script, the script can choose whatever encoding/delimiting mechanism is most appropriate so that the multiple parameters can be stored in the associated instance of pmPolicyParameters.

要传递给脚本,脚本可以选择最合适的编码/定界机制,以便将多个参数存储在关联的pmPolicyParameters实例中。

string getParameters()

字符串getParameters()

The getParameters function takes no arguments. It returns a string containing the value of the pmPolicyParameters object for the running policy.

getParameters函数不接受任何参数。它返回一个字符串,其中包含正在运行的策略的pmPolicyParameters对象的值。

For example, if a policy is to apply to "slow speed interfaces" and the cutoff point for slow speed should be parameterized, the policy filter should be:

例如,如果要将策略应用于“慢速接口”,并且应参数化慢速的截止点,则策略筛选器应为:

      getVar("ifSpeed.$*") == getParameters()
        
      getVar("ifSpeed.$*") == getParameters()
        

In this example, one can store the string "128000" in the policy's pmPolicyParameters object to cause this policy to act on all 128 Kbps interfaces.

在本例中,可以将字符串“128000”存储在策略的pmPolicyParameters对象中,以使此策略作用于所有128 Kbps接口。

8.3. Utility Library Functions
8.3. 实用程序库函数

Utility Library Functions are provided to enable more efficient policy scripts.

提供了实用程序库函数以启用更高效的策略脚本。

8.3.1. regexp()
8.3.1. regexp()

integer regexp(string pattern, string str, integer case [, string &match])

整数regexp(字符串模式、字符串str、整数大小写[、字符串和匹配])

regexp searches 'str' for matches to the regular expression given in `pattern`. regexp uses the POSIX extended regular expressions defined in POSIX 1003.2.

regexp在“str”中搜索与“pattern”中给定的正则表达式的匹配项。regexp使用POSIX 1003.2中定义的POSIX扩展正则表达式。

If `case` is 0, the search will be case insensitive; otherwise, it will be case sensitive.

如果'case'为0,则搜索不区分大小写;否则,它将区分大小写。

If a match is found, 1 is returned, otherwise 0 is returned.

如果找到匹配项,则返回1,否则返回0。

If the optional argument 'match' is provided and a match is found, 'match' will be replaced with the text of the first substring of 'str' that matches 'pattern'. If no match is found, it will be unchanged.

如果提供可选参数“match”并找到匹配项,“match”将替换为与“pattern”匹配的第一个子字符串“str”的文本。如果没有找到匹配项,它将保持不变。

8.3.2. regexpReplace()
8.3.2. regexpReplace()

string regexpReplace(string pattern, string replacement, string str, integer case)

字符串regexpReplace(字符串模式、字符串替换、字符串str、整数大小写)

regexpReplace searches 'str' for matches to the regular expression given in 'pattern', replacing each occurrence of matched text with 'replacement'. regexpReplace uses the POSIX extended regular expressions defined in POSIX 1003.2.

regexpReplace在“str”中搜索与“pattern”中给定的正则表达式的匹配项,将匹配文本的每个匹配项替换为“replacement”。regexpReplace使用POSIX 1003.2中定义的POSIX扩展正则表达式。

If `case` is 0, the search will be case insensitive; otherwise, it will be case sensitive.

如果'case'为0,则搜索不区分大小写;否则,它将区分大小写。

The modified string is returned (it would be the same as the original string if no matches were found).

将返回修改后的字符串(如果未找到匹配项,则与原始字符串相同)。

8.3.3. oidlen()
8.3.3. 奥德伦()

integer oidlen(string oid)

整数oidlen(字符串oid)

oidlen returns the number of subidentifiers in 'oid'. 'oid' is a string containing an ASCII dotted-decimal representation of an object identifier (e.g., "1.3.6.1.2.1.1.1.0").

oidlen返回“oid”中的子标识符数oid’是一个字符串,包含对象标识符的ASCII点十进制表示形式(例如,“1.3.6.1.2.1.1.1.0”)。

8.3.4. oidncmp()
8.3.4. oidncmp()

integer oidncmp(string oid1, string oid2, integer n)

整数oidncmp(字符串oid1、字符串oid2、整数n)

Arguments 'oid1' and 'oid2' are strings containing ASCII dotted-decimal representations of object identifiers (e.g., "1.3.6.1.2.1.1.1.0").

参数“oid1”和“oid2”是包含对象标识符的ASCII点十进制表示的字符串(例如,“1.3.6.1.2.1.1.1.0”)。

oidcmp compares not more than n subidentifiers of 'oid1' and 'oid2' and returns -1 if 'oid1' is less than 'oid2', 0 if they are equal, and 1 if 'oid1' is greater than 'oid2'.

oidcmp比较“oid1”和“oid2”的子标识符不超过n个,如果“oid1”小于“oid2”,则返回-1;如果“oid1”大于“oid2”,则返回0;如果“oid1”大于“oid2”,则返回1。

8.3.5. inSubtree()
8.3.5. inSubtree()

integer inSubtree(string oid, string prefix)

整型inSubtree(字符串oid、字符串前缀)

Arguments 'oid' and 'prefix' are strings containing ASCII dotted-decimal representations of object identifiers (e.g., "1.3.6.1.2.1.1.1.0").

参数“oid”和“prefix”是包含对象标识符的ASCII点十进制表示的字符串(例如,“1.3.6.1.2.1.1.1.0”)。

inSubtree returns 1 if every subidentifier in 'prefix' equals the corresponding subidentifier in 'oid', otherwise it returns 0. The is equivalent to oidncmp(oid1, prefix, oidlen(prefix))

如果“prefix”中的每个子标识符等于“oid”中的相应子标识符,则inSubtree返回1,否则返回0。等同于oidncmp(oid1,前缀,oidlen(前缀))

is provided because this is an idiom and because it avoids evaluating 'prefix' twice if it is an expression.

之所以提供,是因为这是一种习惯用法,并且如果“prefix”是一个表达式,则避免了对其求值两次。

8.3.6. subid()
8.3.6. subid()

integer subid(string oid, integer n)

整数子ID(字符串oid,整数n)

subid returns the value of the nth (starting at zero) subidentifier of 'oid'. 'oid' is a string containing an ASCII dotted-decimal representation of an object identifier (e.g., "1.3.6.1.2.1.1.1.0").

subid返回“oid”的第n个子标识符(从零开始)的值oid’是一个字符串,包含对象标识符的ASCII点十进制表示形式(例如,“1.3.6.1.2.1.1.1.0”)。

If n specifies a subidentifier beyond the length of 'oid', a value of -1 is returned.

如果n指定的子标识符超过“oid”的长度,则返回值-1。

8.3.7. subidWrite()
8.3.7. subidWrite()

integer subidWrite(string oid, integer n, integer subid)

整数子ID写入(字符串oid、整数n、整数子ID)

subidWrite sets the value of the nth (starting at zero) subidentifier of 'oid' to 'subid'. 'oid' is a string containing an ASCII dotted-decimal representation of an object identifier (e.g., "1.3.6.1.2.1.1.1.0").

subidWrite将'oid'的第n个子标识符(从零开始)的值设置为'subid'oid’是一个字符串,包含对象标识符的ASCII点十进制表示形式(例如,“1.3.6.1.2.1.1.1.0”)。

If n specifies a subidentifier beyond the length of 'oid', a value of -1 is returned. Note that appending subidentifiers can be accomplished with the string concatenation '+' operator. If no error occurs, zero is returned.

如果n指定的子标识符超过“oid”的长度,则返回值-1。请注意,附加子标识符可以使用字符串连接“+”运算符完成。如果没有发生错误,则返回零。

8.3.8. oidSplice()
8.3.8. OID剪接()

string oidSplice(string oid1, integer offset, integer len, string oid2)

字符串OID拼接(字符串oid1、整数偏移量、整数长度、字符串oid2)

oidSplice returns an OID formed by replacing 'len' subidentifiers in 'oid1' with all of the subidentifiers from 'oid2', starting at 'offset' in 'oid1' (the first subidentifier is at offset 0). The OID length will be extended, if necessary, if 'offset' + 'len' extends beyond the end of 'oid1'. If 'offset' is larger than the length of oid1, then an RTE will occur.

OIDSpile返回一个OID,该OID是通过将“oid1”中的“len”子标识符替换为“oid2”中的所有子标识符而形成的,从“oid1”中的“offset”开始(第一个子标识符位于偏移量0)。如果“偏移量”+“长度”超出“oid1”的末端,则OID长度将在必要时延长。如果“偏移”大于oid1的长度,则会发生RTE。

The resulting OID is returned.

返回结果OID。

         For example:
             oidSplice("1.3.6.1.2.1", 5, 1, "7")     => "1.3.6.1.2.7"
             oidSplice("1.3.6.1.2.1", 4, 2, "7.7")   => "1.3.6.1.7.7"
             oidSplice("1.3.6.1.2.1", 4, 3, "7.7.7") => "1.3.6.1.7.7.7"
        
         For example:
             oidSplice("1.3.6.1.2.1", 5, 1, "7")     => "1.3.6.1.2.7"
             oidSplice("1.3.6.1.2.1", 4, 2, "7.7")   => "1.3.6.1.7.7"
             oidSplice("1.3.6.1.2.1", 4, 3, "7.7.7") => "1.3.6.1.7.7.7"
        
8.3.9. parseIndex()
8.3.9. parseIndex()

ParseIndex is provided to make it easy to pull index values from OIDs into variables.

提供ParseIndex是为了方便将索引值从OID拉入变量。

var parseIndex(string oid, integer &index, integer type, integer len)

var parseIndex(字符串oid、整数和索引、整数类型、整数len)

parseIndex pulls values from the instance identification portion of 'oid', encoded as per Section 7.7, "Mapping of the INDEX Clause", of the SMIv2 [2].

parseIndex从“oid”的实例标识部分提取值,按照SMIv2[2]第7.7节“索引子句的映射”进行编码。

'oid' is the OID to be parsed.

“oid”是要分析的oid。

'index' describes which subid to begin parsing at. 'index' will be modified to indicate the subid after the last one parsed (even if this points past the last subid). The first subid is index 0. If any error occurs, 'index' will be set to -1 on return. If the input index is less than 0 or refers past the end of the OID, 'index' will be set to -1 on return and the function will return 0.

“index”描述开始分析的子ID索引“”将被修改以指示最后一个解析后的子ID(即使该子ID超过最后一个子ID)。第一个子ID是索引0。如果出现任何错误,“索引”将在返回时设置为-1。如果输入索引小于0或引用超过OID的末尾,则返回时,“索引”将设置为-1,函数将返回0。

If 'type' is Integer, 'len' will not be consulted. The return value is the integer value of the next subid.

如果“type”为整数,则不会参考“len”。返回值是下一个子ID的整数值。

If 'type' is String and 'len' is greater than zero, 'len' subids will be parsed. For each subid parsed, the chr() value of the subid will be appended to the returned string. If any subid is greater than 255, 'index' will be set to -1 on return, and an empty string will be returned. If there are fewer than 'len' subids left in 'oid', 'index' will be set to -1 on return, but a string will be returned containing a character for each subid that was left.

如果'type'是String且'len'大于零,则将分析'len'子ID。对于解析的每个子ID,子ID的chr()值将追加到返回的字符串中。如果任何子ID大于255,“index”将在返回时设置为-1,并返回一个空字符串。如果“oid”中剩下的子ID少于“len”,则返回时“index”将设置为-1,但将返回一个字符串,其中包含每个剩余子ID的一个字符。

If 'type' is String and 'len' is zero, the next subid will be parsed to find N, the length of the string. Then, that many subids will be parsed. For each subid parsed, the chr() value of the subid will be appended to the returned string. If any subid is greater than 255, 'index' will be set to -1 on return, and an empty string will be returned. If there are fewer than N subids left in 'oid', 'index' will be set to -1 on return, but a string will be returned containing a character for each subid that was left.

如果“type”是String,而“len”是零,则将解析下一个子ID以找到N,即字符串的长度。然后,许多子ID将被解析。对于解析的每个子ID,子ID的chr()值将追加到返回的字符串中。如果任何子ID大于255,“index”将在返回时设置为-1,并返回一个空字符串。如果“oid”中剩下的子ID少于N个,“index”将在返回时设置为-1,但将返回一个字符串,其中包含每个剩余子ID的一个字符。

If 'type' is String and 'len' is -1, subids will be parsed until the end of 'oid'. For each subid parsed, the chr() value of the subid will be appended to the returned string. If any

如果“type”是String,“len”是-1,则子ID将被解析到“oid”的末尾。对于解析的每个子ID,子ID的chr()值将追加到返回的字符串中。如果有的话

subid is greater than 255, 'index' will be set to -1 on return, and an empty string will be returned.

subid大于255,返回时,“index”将设置为-1,并返回空字符串。

If 'type' is Oid and 'len' is greater than zero, 'len' subids will be parsed. For each subid parsed, the decimal-encoded value of the subid will be appended to the returned string, with a '.' character appended between each output subid, but not after the last subid. If there are fewer than 'len' subids left in 'oid', 'index' will be set to -1 on return, but a string will be returned containing an encoding for each subid that was left.

如果'type'为Oid且'len'大于零,则将分析'len'子ID。对于解析的每个子ID,子ID的十进制编码值将附加到返回的字符串中,并在每个输出子ID之间附加“.”字符,但不在最后一个子ID之后。如果“oid”中剩下的子ID少于“len”,则返回时“index”将设置为-1,但将返回一个字符串,其中包含每个剩余子ID的编码。

If 'type' is Oid and 'len' is zero, the next subid will be parsed to find N, the number of subids to parse. For each subid parsed, the decimal-encoded value of the subid will be appended to the returned string, with a '.' character appended between each output subid but not after the last subid. If there are fewer than N subids left in 'oid', 'index' will be set to -1 on return, but a string will be returned containing an encoding for each subid that was left.

如果“type”为Oid,“len”为零,则将解析下一个子ID以找到N,即要解析的子ID数。对于解析的每个子ID,子ID的十进制编码值将附加到返回的字符串中,并在每个输出子ID之间附加“.”字符,但不在最后一个子ID之后。如果“oid”中剩下的子ID少于N个,“index”将在返回时设置为-1,但将返回一个字符串,其中包含每个剩余子ID的编码。

If 'type' is Oid and 'len' is -1, subids will be parsed until the end of 'oid'. For each subid parsed, the decimal-encoded value of the subid will be appended to the returned string, with a '.' character appended between each output subid, but not after the last subid.

如果“type”是Oid,“len”是-1,则子ID将一直解析到“Oid”的末尾。对于解析的每个子ID,子ID的十进制编码值将附加到返回的字符串中,并在每个输出子ID之间附加“.”字符,但不在最后一个子ID之后。

For example, to decode the index component of an instance of the ipForward table:

例如,要解码ipForward表实例的索引组件:

      oid = "ipForwardIfIndex.0.0.0.0.13.0.192.168.1.1";
      index = 11;
      dest   =  parseIndex(oid, index, String, 4);
      proto  =  parseIndex(oid, index, Integer, 0);
      policy =  parseIndex(oid, index, Integer, 0);
      nextHop = parseIndex(oid, index, String, 4);
      // proto and policy now contain integer values
      // dest and nextHop now contain 4 byte IP addresses.  Use
      // stringToDotted to get them to dotted decimal notation:
      // e.g.: stringToDotted(nextHop) => "192.168.1.1"
        
      oid = "ipForwardIfIndex.0.0.0.0.13.0.192.168.1.1";
      index = 11;
      dest   =  parseIndex(oid, index, String, 4);
      proto  =  parseIndex(oid, index, Integer, 0);
      policy =  parseIndex(oid, index, Integer, 0);
      nextHop = parseIndex(oid, index, String, 4);
      // proto and policy now contain integer values
      // dest and nextHop now contain 4 byte IP addresses.  Use
      // stringToDotted to get them to dotted decimal notation:
      // e.g.: stringToDotted(nextHop) => "192.168.1.1"
        
8.3.10. stringToDotted()
8.3.10. stringToDotted()

stringToDotted() is provided to encode strings suitable for the index portion of an OID or to convert the binary encoding of an IP address to a dotted-decimal encoding.

stringToDotted()用于编码适用于OID索引部分的字符串,或将IP地址的二进制编码转换为点十进制编码。

string stringToDotted(string value)

字符串stringToDotted(字符串值)

If 'value' is the zero-length string, the zero-length string is returned.

如果“value”是零长度字符串,则返回零长度字符串。

The decimal encoding of the first byte of 'value' is appended to the output string. Then, for each additional byte in 'value', a '.' is appended to the output string, followed by the decimal encoding of the additional byte.

“value”的第一个字节的十进制编码追加到输出字符串中。然后,对于“value”中的每个附加字节,将在输出字符串后附加一个“.”,然后是附加字节的十进制编码。

8.3.11. integer()
8.3.11. 整数()

integer integer(var input)

整数(变量输入)

integer converts 'input' into an integer by using the rules specified for ToInteger(), returning the integer-typed results.

integer使用为ToInteger()指定的规则将“输入”转换为整数,并返回整数类型的结果。

8.3.12. string()
8.3.12. 字符串()

string string(var input)

字符串(变量输入)

string converts 'input' into a string by using the rules specified for ToString(), returning the string-typed results.

string使用为ToString()指定的规则将“input”转换为字符串,并返回字符串类型的结果。

8.3.13. type()
8.3.13. 类型()

string type(var variable)

字符串类型(var变量)

type returns the type of its argument as either the string 'String' or the string 'Integer'.

类型将其参数的类型返回为字符串“string”或字符串“Integer”。

8.3.14. chr()
8.3.14. chr()

string chr(integer char)

字符串chr(整数字符)

Returns a one-character string containing the character specified by the ASCII code contained in 'char'.

返回一个单字符字符串,该字符串包含由“char”中包含的ASCII代码指定的字符。

8.3.15. ord()
8.3.15. ord()

integer ord(string str)

整数ord(字符串str)

Returns the ASCII value of the first character of 'str'. This function complements chr().

返回“str”的第一个字符的ASCII值。此函数是对chr()的补充。

8.3.16. substr()
8.3.16. substr()

string substr(string &str, integer offset [, integer len, string replacement])

字符串substr(字符串和str,整数偏移量[,整数长度,字符串替换])

Extracts a substring out of 'str' and returns it. The first octet is at offset 0. If the offset is negative, the returned string starts that far from the end of 'str'. If 'len' is positive, the returned string contains up to 'len' octets, up to the end of the string. If 'len' is omitted, the returned string includes everything to the end of 'str'. If 'len' is negative, abs(len) octets are left off the end of the string.

从“str”中提取一个子字符串并返回它。第一个八位组位于偏移量0处。如果偏移量为负数,则返回的字符串从“str”结尾处开始。如果“len”为正,则返回的字符串最多包含“len”八位字节,直到字符串末尾。如果省略了'len',则返回的字符串包括'str'末尾的所有内容。如果'len'为负数,则abs(len)八位字节将保留在字符串末尾。

If a substring is specified that is partly outside the string, the part within the string is returned. If the substring is totally outside the string, a zero-length string is produced.

如果指定的子字符串部分位于字符串外部,则返回字符串内部的部分。如果子字符串完全位于字符串外部,则生成零长度字符串。

If the optional 'replacement' argument is included, 'str' is modified. 'offset' and 'len' act as above to select a range of octets in 'str'. These octets are replaced with octets from 'replacement'. If the replacement string is shorter or longer than the number of octets selected, 'str' will shrink or grow, respectively. If 'replacement' is included, the 'len' argument must also be included.

如果包含可选的'replacement'参数,则会修改'str'“偏移量”和“len”如上所述,用于选择“str”中的一系列八位字节。这些八位字节替换为“替换”中的八位字节。如果替换字符串比所选的八位字节数短或长,“str”将分别缩小或增大。如果包含“替换”,则还必须包含“len”参数。

Note that to replace everything from offset to the end of the string, substr() should be called as follows:

请注意,要替换从偏移量到字符串结尾的所有内容,应按如下方式调用substr():

            substr(str, offset, strlen(str) - offset, replacement)
        
            substr(str, offset, strlen(str) - offset, replacement)
        
8.4. General Functions
8.4. 一般功能

The following POSIX standard library functions are provided:

提供了以下POSIX标准库函数:

strncmp() strncasecmp() strlen() random() sprintf() sscanf()

strncmp()strncasecmp()strlen()随机()sprintf()sscanf()

9. International String Library
9. 国际字符串库

This library is optional for systems that wish to have support for collating (sorting) and verifying equality of international strings in a manner that will be least surprising to humans. International

对于希望以最不令人惊讶的方式支持整理(排序)和验证国际字符串相等性的系统,此库是可选的。国际的

strings are encoded in the UTF-8 transformation format described in [14]. This library is registered with the name "pmInternationalStringLibrary".

字符串以[14]中所述的UTF-8转换格式进行编码。此库以名称“pmInternationalStringLibrary”注册。

When verifying equality of international strings in the Unicode character set, it is recommended to normalize the strings with the stringprep() function before checking for equality.

验证Unicode字符集中国际字符串的相等性时,建议在检查相等性之前使用stringprep()函数对字符串进行规范化。

When attempting to sort international strings in the Unicode character set, normalization should also be performed, but note that the result is highly context dependent and hard to implement correctly. Just ordering by Unicode Codepoint Value is in many cases not what the end user expects. See Unicode technical note 9 for more information about sorting.

在尝试对Unicode字符集中的国际字符串进行排序时,还应执行规范化,但请注意,结果高度依赖于上下文,很难正确实现。在许多情况下,仅按Unicode代码点值排序并不是最终用户所期望的。有关排序的更多信息,请参见Unicode技术说明9。

9.1. stringprep()
9.1. stringprep()

integer stringprep(string utf8Input, string &utf8Output)

整数stringprep(字符串UTF8输入、字符串和UTF8输出)

Performs the Stringprep [13] transformation for appropriate comparison of internationalized strings. The transformation is performed on 'utf8Input'; if the transformation finishes without error, the resulting string is written to utf8Output. The stringprep profile used is specified below in Section 9. If it is successful, the function returns 1.

执行Stringprep[13]转换以适当比较国际化字符串。转换在“utf8Input”上执行;如果转换顺利完成,则生成的字符串将写入utf8Output。使用的stringprep配置文件在下文第9节中规定。如果成功,函数将返回1。

If the stringprep transformation encounters an error, 0 is returned, and the utf8Output parameter remains unchanged.

如果stringprep转换遇到错误,则返回0,utf8Output参数保持不变。

For example, to compare UTF8 strings 'one' and 'two':

例如,要比较UTF8字符串“one”和“two”:

         if (stringprep(one, a) && stringprep(two, b)){
             if (a == b){
                // strings are identical
             } else {
                // strings are different
             }
         } else {
             // strings couldn't be transformed for comparison
         }
        
         if (stringprep(one, a) && stringprep(two, b)){
             if (a == b){
                // strings are identical
             } else {
                // strings are different
             }
         } else {
             // strings couldn't be transformed for comparison
         }
        

See Stringprep [13] for more information.

有关更多信息,请参见Stringprep[13]。

9.1.1. Stringprep Profile
9.1.1. Stringprep配置文件

The Stringprep specification [13] describes a framework for preparing Unicode text strings in order to increase the likelihood that string input and string comparison work in ways that make sense for typical

Stringprep规范[13]描述了一个用于准备Unicode文本字符串的框架,以增加字符串输入和字符串比较工作的可能性,使其对典型的

users throughout the world. Specifications that specify stringprep (as this one does) are required to fully specify stringprep's processing options by documenting a stringprep profile.

全世界的用户。通过记录stringprep配置文件来完全指定stringprep的处理选项时,需要指定stringprep的规范(与此规范相同)。

This profile defines the following, as required by Stringprep:

根据Stringprep的要求,此配置文件定义了以下内容:

- The intended applicability of the profile: internationalized network management information.

- 概要文件的预期适用性:国际化网络管理信息。

- The character repertoire that is the input and output to stringprep: Unicode 3.2, as defined in Stringprep [13], Appendix A.1.

- 作为stringprep:Unicode 3.2输入和输出的字符集,如stringprep[13]附录A.1中所定义。

- The mapping tables used: Table B.1 from Stringprep [13].

- 使用的映射表:Stringprep[13]中的表B.1。

- Any additional mapping tables specific to the profile: None.

- 特定于配置文件的任何其他映射表:无。

- The Unicode normalization used: Form KC, as described in Stringprep [13].

- 所使用的Unicode规范化:表单KC,如Stringprep[13]中所述。

- The characters that are prohibited as output: As specified in the following tables from Stringprep [13]:

- 禁止作为输出的字符:如Stringprep[13]的下表所述:

Table C.2 Table C.3 Table C.4 Table C.5 Table C.6 Table C.7 Table C.8 Table C.9

表C.2表C.3表C.4表C.5表C.6表C.7表C.8表C.9

- Bidirectional character handling: not performed.

- 双向字符处理:未执行。

- Any additional characters that are prohibited as output: None.

- 禁止作为输出的任何其他字符:无。

9.2. utf8Strlen()
9.2. utf8Strlen()

integer utf8Strlen(string str)

整数utf8Strlen(字符串str)

Returns the number of UTF-8 characters in 'str', which may be less than the number of octets in 'str' if one or more characters are multi-byte characters.

返回“str”中的UTF-8字符数,如果一个或多个字符是多字节字符,则可能小于“str”中的八位字节数。

9.3. utf8Chr()
9.3. utf8Chr()

string utf8Chr(integer utf8)

字符串utf8Chr(整数utf8)

Returns a one-character string containing the character specified by the UTF-8 code contained in 'utf8'. Although it contains only 1 UTF-8 character, the resulting string may be more than 1 octet in length.

返回一个单字符字符串,该字符串包含由“utf8”中包含的UTF-8代码指定的字符。虽然它只包含1个UTF-8字符,但结果字符串的长度可能超过1个八位字节。

9.4. utf8Ord()
9.4. utf8Ord()

integer utf8Ord(string str)

整数utf8Ord(字符串str)

Returns the UTF-8 code-point value of the first character of 'str'. Note that the first UTF-8 character in 'str' may be more than 1 octet in length. This function complements chr().

返回“str”的第一个字符的UTF-8代码点值。请注意,“str”中的第一个UTF-8字符长度可能超过1个八位字节。此函数是对chr()的补充。

9.5. utf8Substr()
9.5. utf8Substr()

string utf8Substr(string &str, integer offset [, integer len, string replacement])

字符串utf8Substr(字符串和str,整数偏移量[,整数长度,字符串替换])

Extracts a substring out of 'str' and returns it, keeping track of UTF-8 character boundaries and using them, instead of octets, as the basis for offset and length calculations. The first character is at offset 0. If offset is negative, the returned string starts that far from the end of 'str'. If 'len' is positive, the returned string contains up to 'len' characters, up to the end of the string. If 'len' is omitted, the returned string includes everything to the end of 'str'. If 'len' is negative, abs(len) characters are left off the end of the string.

从“str”中提取一个子字符串并返回它,跟踪UTF-8字符边界,并使用它们(而不是八位字节)作为偏移量和长度计算的基础。第一个字符位于偏移量0处。如果偏移量为负,则返回的字符串从“str”的结尾开始。如果“len”为正,则返回的字符串最多包含“len”个字符,直到字符串末尾。如果省略了'len',则返回的字符串包括'str'末尾的所有内容。如果“len”为负数,则字符串末尾将保留abs(len)字符。

If you specify a substring that is partly outside the string, the part within the string is returned. If the substring is totally outside the string, a zero-length string is produced.

如果指定的子字符串部分位于字符串外部,则返回字符串内部的部分。如果子字符串完全位于字符串外部,则生成零长度字符串。

If the optional 'replacement' argument is included, 'str' is modified. 'offset' and 'len' act as above to select a range of characters in 'str'. These characters are replaced with characters from 'replacement'. If the replacement string is shorter or longer than the number of characters selected, 'str' will shrink or grow, respectively. If 'replacement' is included, the 'len' argument must also be included.

如果包含可选的'replacement'参数,则会修改'str'“偏移量”和“len”如上所述,用于在“str”中选择一系列字符。这些字符将替换为“替换”中的字符。如果替换字符串比所选字符数短或长,“str”将分别缩小或增大。如果包含“替换”,则还必须包含“len”参数。

Note that to replace everything from offset to the end of the string, substr() should be called as follows:

请注意,要替换从偏移量到字符串结尾的所有内容,应按如下方式调用substr():

            substr(str, offset, strlen(str) - offset, replacement)
        
            substr(str, offset, strlen(str) - offset, replacement)
        
10. Schedule Table
10. 附表

This table is an adapted form of the policyTimePeriodCondition class defined in the Policy Core Information Model, RFC 3060 [18]. Some of the objects describing a schedule are expressed in formats defined in the iCalendar specification [15].

此表是策略核心信息模型RFC 3060[18]中定义的policyTimePeriodCondition类的一种改编形式。描述明细表的某些对象以iCalendar规范[15]中定义的格式表示。

The policy schedule table allows control over when a valid policy will be ready, based on the date and time.

策略计划表允许根据日期和时间控制有效策略的准备时间。

A policy's pmPolicySchedule variable refers to a group of one or more schedules in the schedule table. At any given time, if any of these schedules are active, the policy will be ready (assuming that it is enabled and thus valid), and its conditions and actions will be executed, as appropriate. At times when none of these schedules are active, the policy will not be ready and will have no effect. A policy will always be ready if its pmPolicySchedule variable is 0. If a policy has a non-zero pmPolicySchedule that doesn't refer to a group that includes an active schedule, then the policy will not be ready, even if this is due to a misconfiguration of the pmPolicySchedule object or the pmSchedTable.

策略的pmPolicySchedule变量引用计划表中一个或多个计划的组。在任何给定的时间,如果这些计划中的任何一个处于活动状态,则该策略将准备就绪(假设该策略已启用并因此有效),并将根据需要执行其条件和操作。当这些计划都不处于活动状态时,策略将不会准备就绪,也不会生效。如果策略的pmPolicySchedule变量为0,则该策略将始终处于就绪状态。如果策略的非零pmPolicySchedule未引用包含活动计划的组,则该策略将不会就绪,即使这是由于pmPolicySchedule对象或pmSchedTable的配置错误所致。

A policy that is controlled by a schedule group immediately executes its policy condition (and conditionally the policyAction) when the schedule group becomes active, periodically re-executing these scripts as appropriate until the schedule group becomes inactive (i.e., all schedules are inactive).

由计划组控制的策略在计划组变为活动时立即执行其策略条件(并有条件地执行policyAction),根据需要定期重新执行这些脚本,直到计划组变为非活动(即,所有计划均为非活动)。

An individual schedule item is active at those times that match all the variables that define the schedule: pmSchedTimePeriod, pmSchedMonth, pmSchedDay, pmSchedWeekDay, and pmSchedTimeOfDay. It is possible to specify multiple values for each schedule item. This provides a mechanism for defining complex schedules. For example, a schedule that is active the entire workday each weekday could be defined.

单个计划项在与定义计划的所有变量相匹配的时间处于活动状态:pmSchedTimePeriod、pmSchedMonth、pmSchedDay、pmSchedWeekDay和pmSchedTimeOfDay。可以为每个明细表项目指定多个值。这提供了一种定义复杂计划的机制。例如,可以定义在每个工作日的整个工作日都处于活动状态的计划。

Months, days, and weekdays are specified by using the objects pmSchedMonth, pmSchedDay, and pmSchedWeekDay of type BITS. Setting multiple bits in these objects causes an OR operation. For example, setting the bits monday(1) and friday(5) in pmSchedWeekDay restricts the schedule to Mondays and Fridays.

月、日和工作日是通过使用BITS类型的对象pmSchedMonth、pmSchedDay和pmSchedWeekDay指定的。在这些对象中设置多个位会导致OR操作。例如,在pmSchedWeekDay中设置位monday(1)和friday(5)将日程限制为周一和周五。

The matched times for pmSchedTimePeriod, pmSchedMonth, pmSchedDay pmSchedWeekDay, and pmSchedTimeOfDay are ANDed together to determine the time periods when the schedule will be active; in other words, the schedule is only active for those times when ALL of these schedule attributes match. For example, a schedule with an overall validity range of January 1, 2000, through December 31, 2000; a month mask that selects March and April; a day-of-the-week mask that selects Fridays; and a time-of-day range of 0800 through 1600 would represent the following time periods:

将PMSCHEDTIMERIOD、pmSchedMonth、pmSchedDay pmSchedWeekDay和pmSchedTimeOfDay的匹配时间相加,以确定计划将处于活动状态的时间段;换句话说,只有当所有这些计划属性匹配时,计划才处于活动状态。例如,总有效期为2000年1月1日至2000年12月31日的时间表;选择三月和四月的月份遮罩;选择星期五的一周中的一天面具;一天中的时间范围为0800到1600将代表以下时间段:

Friday, March 5, 2000, from 0800 through 1600 Friday, March 12, 2000, from 0800 through 1600 Friday, March 19, 2000, from 0800 through 1600 Friday, March 26, 2000, from 0800 through 1600 Friday, April 2, 2000, from 0800 through 1600 Friday, April 9, 2000, from 0800 through 1600 Friday, April 16, 2000, from 0800 through 1600 Friday, April 23, 2000, from 0800 through 1600 Friday, April 30, 2000, from 0800 through 1600

二○○○年三月五日(星期五)、二○○○年三月十二日(星期五)、二○○○年三月十九日(星期五)、二○○○年三月二十六日(星期五)、二○○○年四月二日(星期五)、二○○○年四月九日(星期五)、二○○○年四月十六日(星期五)、二○○○年四月二十三日(星期五)八○○至四,二○○○年四月三十日(星期五)上午八时至下午六时

Wildcarding of schedule attributes of type BITS is achieved by setting all bits to one.

通过将所有位设置为一,可以实现位类型的调度属性的通配符。

It is possible to define schedules that will never cause a policy to be activated. For example, one can define a schedule that should be active on February 31st.

可以定义不会导致策略被激活的计划。例如,可以定义应在2月31日激活的计划。

11. Definitions
11. 定义
POLICY-BASED-MANAGEMENT-MIB DEFINITIONS ::= BEGIN
IMPORTS
    MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
    Counter32, Gauge32, Unsigned32,
    mib-2                                       FROM SNMPv2-SMI
    RowStatus, RowPointer, TEXTUAL-CONVENTION,
    DateAndTime, StorageType                    FROM SNMPv2-TC
    MODULE-COMPLIANCE, OBJECT-GROUP,
    NOTIFICATION-GROUP                          FROM SNMPv2-CONF
    SnmpAdminString                             FROM SNMP-FRAMEWORK-MIB;
        
POLICY-BASED-MANAGEMENT-MIB DEFINITIONS ::= BEGIN
IMPORTS
    MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
    Counter32, Gauge32, Unsigned32,
    mib-2                                       FROM SNMPv2-SMI
    RowStatus, RowPointer, TEXTUAL-CONVENTION,
    DateAndTime, StorageType                    FROM SNMPv2-TC
    MODULE-COMPLIANCE, OBJECT-GROUP,
    NOTIFICATION-GROUP                          FROM SNMPv2-CONF
    SnmpAdminString                             FROM SNMP-FRAMEWORK-MIB;
        

-- Policy-Based Management MIB

--基于策略的管理MIB

pmMib MODULE-IDENTITY LAST-UPDATED "200502070000Z" -- February 7, 2005 ORGANIZATION "IETF SNMP Configuration Working Group" CONTACT-INFO "

pmMib模块标识最后一次更新“200502070000Z”-2005年2月7日组织“IETF SNMP配置工作组”联系人信息

        Steve Waldbusser
        Phone: +1-650-948-6500
        Fax:   +1-650-745-0671
        Email: waldbusser@nextbeacon.com
        
        Steve Waldbusser
        Phone: +1-650-948-6500
        Fax:   +1-650-745-0671
        Email: waldbusser@nextbeacon.com
        

Jon Saperia (WG Co-chair) JDS Consulting, Inc. 84 Kettell Plain Road. Stow MA 01775 USA Phone: +1-978-461-0249 Fax: +1-617-249-0874 Email: saperia@jdscons.com

Jon Saperia(工作组联席主席)JDS咨询公司,凯特尔平原路84号。Stow MA 01775美国电话:+1-978-461-0249传真:+1-617-249-0874电子邮件:saperia@jdscons.com

Thippanna Hongal Riverstone Networks, Inc. 5200 Great America Parkway Santa Clara, CA, 95054 USA

Thippanna Hongal Riverstone Networks,Inc.美国加利福尼亚州圣克拉拉大美洲大道5200号,邮编95054

        Phone: +1-408-878-6562
        Fax:   +1-408-878-6501
        Email: hongal@riverstonenet.com
        
        Phone: +1-408-878-6562
        Fax:   +1-408-878-6501
        Email: hongal@riverstonenet.com
        

David Partain (WG Co-chair) Postal: Ericsson AB P.O. Box 1248 SE-581 12 Linkoping Sweden Tel: +46 13 28 41 44 E-mail: David.Partain@ericsson.com

David Partain(工作组联席主席)邮政:爱立信公司邮箱1248 SE-581 12 Linkoping Sweden电话:+46 13 28 41 44电子邮件:David。Partain@ericsson.com

Any questions or comments about this document can also be directed to the working group at snmpconf@snmp.com." DESCRIPTION "The MIB module for policy-based configuration of SNMP infrastructures.

有关本文件的任何问题或意见,也可发送至工作组:snmpconf@snmp.com.“说明”用于基于策略配置SNMP基础结构的MIB模块。

Copyright (C) The Internet Society (2005). This version of this MIB module is part of RFC 4011; see the RFC itself for full legal notices."

版权所有(C)互联网协会(2005年)。此版本的MIB模块是RFC 4011的一部分;有关完整的法律通知,请参见RFC本身。”

    REVISION "200502070000Z"    -- February 7, 2005
    DESCRIPTION
        "The original version of this MIB, published as RFC4011."
    ::= { mib-2 124 }
        
    REVISION "200502070000Z"    -- February 7, 2005
    DESCRIPTION
        "The original version of this MIB, published as RFC4011."
    ::= { mib-2 124 }
        
PmUTF8String ::= TEXTUAL-CONVENTION
    STATUS       current
    DESCRIPTION
        "An octet string containing information typically in
        human-readable form.
        
PmUTF8String ::= TEXTUAL-CONVENTION
    STATUS       current
    DESCRIPTION
        "An octet string containing information typically in
        human-readable form.
        

To facilitate internationalization, this information is represented by using the ISO/IEC IS 10646-1 character set, encoded as an octet string using the UTF-8 transformation format described in RFC 3629.

为了促进国际化,该信息通过使用ISO/IEC is 10646-1字符集表示,该字符集使用RFC 3629中描述的UTF-8转换格式编码为八位字符串。

As additional code points are added by amendments to the 10646 standard from time to time, implementations must be prepared to encounter any code point from 0x00000000 to 0x10FFFF. Byte sequences that do not correspond to the valid UTF-8 encoding of a code point or that are outside this range are prohibited.

由于对10646标准的不时修订增加了额外的代码点,因此实现必须准备好遇到从0x00000000到0x10FFFF的任何代码点。禁止与代码点的有效UTF-8编码不对应或超出此范围的字节序列。

The use of control codes should be avoided.

应避免使用控制代码。

When it is necessary to represent a newline, the control code sequence CR LF should be used.

当需要表示换行时,应使用控制代码序列CR LF。

For code points not directly supported by user interface hardware or software, an alternative means of entry and display, such as hexadecimal, may be provided.

对于用户界面硬件或软件不直接支持的代码点,可提供其他输入和显示方式,如十六进制。

For information encoded in 7-bit US-ASCII, the UTF-8 encoding is identical to the US-ASCII encoding.

对于以7位US-ASCII编码的信息,UTF-8编码与US-ASCII编码相同。

UTF-8 may require multiple bytes to represent a single character/code point; thus, the length of this object in octets may be different from the number of characters encoded. Similarly, size constraints refer to the number of encoded octets, not the number of characters represented by an encoding.

UTF-8可能需要多个字节来表示单个字符/代码点;因此,该对象的长度(以八位字节为单位)可能不同于编码的字符数。类似地,大小约束是指编码的八位字节数,而不是编码所表示的字符数。

Note that when this TC is used for an object used or envisioned to be used as an index, then a SIZE restriction MUST be specified so that the number of sub-identifiers for any object instance does not exceed the limit of 128, as defined by

请注意,当此TC用于用作或预期用作索引的对象时,必须指定大小限制,以便任何对象实例的子标识符数量不超过128的限制,如

RFC 3416.

RFC3416。

Note that the size of PmUTF8String object is measured in octets, not characters." SYNTAX OCTET STRING (SIZE (0..65535))

请注意,PmUTF8String对象的大小是以八位字节度量的,而不是以字符度量的。“语法八位字节字符串(大小(0..65535))

-- The policy table

--政策表

pmPolicyTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF PmPolicyEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The policy table.  A policy is a pairing of a
        policyCondition and a policyAction that is used to apply the
        action to a selected set of elements."
    ::= { pmMib 1 }
        
pmPolicyTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF PmPolicyEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The policy table.  A policy is a pairing of a
        policyCondition and a policyAction that is used to apply the
        action to a selected set of elements."
    ::= { pmMib 1 }
        
pmPolicyEntry OBJECT-TYPE
    SYNTAX      PmPolicyEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "An entry in the policy table representing one policy."
    INDEX { pmPolicyAdminGroup, pmPolicyIndex }
    ::= { pmPolicyTable 1 }
        
pmPolicyEntry OBJECT-TYPE
    SYNTAX      PmPolicyEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "An entry in the policy table representing one policy."
    INDEX { pmPolicyAdminGroup, pmPolicyIndex }
    ::= { pmPolicyTable 1 }
        
PmPolicyEntry ::= SEQUENCE {
    pmPolicyAdminGroup            PmUTF8String,
    pmPolicyIndex                 Unsigned32,
    pmPolicyPrecedenceGroup       PmUTF8String,
    pmPolicyPrecedence            Unsigned32,
    pmPolicySchedule              Unsigned32,
    pmPolicyElementTypeFilter     PmUTF8String,
    pmPolicyConditionScriptIndex  Unsigned32,
    pmPolicyActionScriptIndex     Unsigned32,
    pmPolicyParameters            OCTET STRING,
    pmPolicyConditionMaxLatency   Unsigned32,
    pmPolicyActionMaxLatency      Unsigned32,
    pmPolicyMaxIterations         Unsigned32,
    pmPolicyDescription           PmUTF8String,
    pmPolicyMatches               Gauge32,
    pmPolicyAbnormalTerminations  Gauge32,
    pmPolicyExecutionErrors       Counter32,
    pmPolicyDebugging             INTEGER,
    pmPolicyAdminStatus           INTEGER,
    pmPolicyStorageType           StorageType,
    pmPolicyRowStatus             RowStatus
        
PmPolicyEntry ::= SEQUENCE {
    pmPolicyAdminGroup            PmUTF8String,
    pmPolicyIndex                 Unsigned32,
    pmPolicyPrecedenceGroup       PmUTF8String,
    pmPolicyPrecedence            Unsigned32,
    pmPolicySchedule              Unsigned32,
    pmPolicyElementTypeFilter     PmUTF8String,
    pmPolicyConditionScriptIndex  Unsigned32,
    pmPolicyActionScriptIndex     Unsigned32,
    pmPolicyParameters            OCTET STRING,
    pmPolicyConditionMaxLatency   Unsigned32,
    pmPolicyActionMaxLatency      Unsigned32,
    pmPolicyMaxIterations         Unsigned32,
    pmPolicyDescription           PmUTF8String,
    pmPolicyMatches               Gauge32,
    pmPolicyAbnormalTerminations  Gauge32,
    pmPolicyExecutionErrors       Counter32,
    pmPolicyDebugging             INTEGER,
    pmPolicyAdminStatus           INTEGER,
    pmPolicyStorageType           StorageType,
    pmPolicyRowStatus             RowStatus
        

}

}

pmPolicyAdminGroup OBJECT-TYPE SYNTAX PmUTF8String (SIZE(0..32)) MAX-ACCESS not-accessible STATUS current DESCRIPTION "An administratively assigned string that can be used to group policies for convenience, for readability, or to simplify configuration of access control.

pmPolicyAdminGroup对象类型语法PmUTF8String(大小(0..32))MAX-ACCESS not ACCESS STATUS current DESCRIPTION“一种管理分配的字符串,可用于对策略进行分组以方便、可读或简化访问控制的配置。

        The value of this string does not affect policy processing in
        any way.  If grouping is not desired or necessary, this object
        may be set to a zero-length string."
    ::= { pmPolicyEntry 1 }
        
        The value of this string does not affect policy processing in
        any way.  If grouping is not desired or necessary, this object
        may be set to a zero-length string."
    ::= { pmPolicyEntry 1 }
        
pmPolicyIndex OBJECT-TYPE
    SYNTAX      Unsigned32 (1..4294967295)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
         "A unique index for this policy entry, unique among all
         policies regardless of administrative group."
    ::= { pmPolicyEntry 2 }
        
pmPolicyIndex OBJECT-TYPE
    SYNTAX      Unsigned32 (1..4294967295)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
         "A unique index for this policy entry, unique among all
         policies regardless of administrative group."
    ::= { pmPolicyEntry 2 }
        

pmPolicyPrecedenceGroup OBJECT-TYPE SYNTAX PmUTF8String (SIZE (0..32)) MAX-ACCESS read-create STATUS current DESCRIPTION "An administratively assigned string that is used to group policies. For each element, only one policy in the same precedence group may be active on that element. If multiple policies would be active on an element (because their conditions return non-zero), the execution environment will only allow the policy with the highest value of pmPolicyPrecedence to be active.

pmpolicyPreferenceGroup对象类型语法PmUTF8String(大小(0..32))MAX-ACCESS read create STATUS current DESCRIPTION“用于对策略进行分组的管理分配字符串。对于每个元素,同一优先级组中只能有一个策略在该元素上处于活动状态。如果一个元素上有多个策略处于活动状态(因为它们的条件返回非零),执行环境将只允许PMPolicyPreference值最高的策略处于活动状态。

        All values of this object must have been successfully
        transformed by Stringprep RFC 3454.  Management stations
        must perform this translation and must only set this object to
        string values that have been transformed."
    ::= { pmPolicyEntry 3 }
        
        All values of this object must have been successfully
        transformed by Stringprep RFC 3454.  Management stations
        must perform this translation and must only set this object to
        string values that have been transformed."
    ::= { pmPolicyEntry 3 }
        

pmPolicyPrecedence OBJECT-TYPE SYNTAX Unsigned32 (0..65535) MAX-ACCESS read-create STATUS current

PMPolicyPreference对象类型语法Unsigned32(0..65535)MAX-ACCESS读取创建状态当前

DESCRIPTION "If, while checking to see which policy conditions match an element, 2 or more ready policies in the same precedence group match the same element, the pmPolicyPrecedence object provides the rule to arbitrate which single policy will be active on 'this element'. Of policies in the same precedence group, only the ready and matching policy with the highest precedence value (e.g., 2 is higher than 1) will have its policy action periodically executed on 'this element'.

描述“如果在检查哪些策略条件与元素匹配时,同一优先级组中的两个或多个就绪策略与同一元素匹配,则PMPolicyPreference对象提供规则来仲裁哪一个策略将在‘此元素’上处于活动状态。”。对于同一优先级组中的策略,只有具有最高优先级值(例如,2高于1)的就绪和匹配策略才会定期对“此元素”执行其策略操作。

When a policy is active on an element but the condition ceases to match the element, its action (if currently running) will be allowed to finish and then the condition-matching ready policy with the next-highest precedence will immediately become active (and have its action run immediately). If the condition of a higher-precedence ready policy suddenly begins matching an element, the previously-active policy's action (if currently running) will be allowed to finish and then the higher precedence policy will immediately become active. Its action will run immediately, and any lower-precedence matching policy will not be active anymore.

当某个策略在某个元素上处于活动状态,但条件不再与该元素匹配时,将允许其操作(如果当前正在运行)完成,然后匹配优先级下一个最高的就绪策略的条件将立即变为活动状态(并立即运行其操作)。如果高优先级就绪策略的条件突然开始匹配元素,则将允许以前活动的策略的操作(如果当前正在运行)完成,然后高优先级策略将立即变为活动。它的操作将立即运行,任何优先级较低的匹配策略将不再处于活动状态。

In the case where multiple ready policies share the highest value, it is an implementation-dependent matter as to which single policy action will be chosen.

在多个就绪策略共享最高值的情况下,选择哪一个策略操作取决于实现。

        Note that if it is necessary to take certain actions after a
        policy is no longer active on an element, these actions should
        be included in a lower-precedence policy that is in the same
        precedence group."
    ::= { pmPolicyEntry 4 }
        
        Note that if it is necessary to take certain actions after a
        policy is no longer active on an element, these actions should
        be included in a lower-precedence policy that is in the same
        precedence group."
    ::= { pmPolicyEntry 4 }
        

pmPolicySchedule OBJECT-TYPE SYNTAX Unsigned32 (1..4294967295) MAX-ACCESS read-create STATUS current DESCRIPTION "This policy will be ready if any of the associated schedule entries are active.

pmPolicySchedule对象类型语法Unsigned32(1..4294967295)MAX-ACCESS read create STATUS current DESCRIPTION“如果任何关联的计划条目处于活动状态,则此策略将准备就绪。

If the value of this object is 0, this policy is always ready.

如果此对象的值为0,则此策略始终准备就绪。

         If the value of this object is non-zero but doesn't
         refer to a schedule group that includes an active schedule,
         then the policy will not be ready, even if this is due to a
         misconfiguration of this object or the pmSchedTable."
    ::= { pmPolicyEntry 5 }
        
         If the value of this object is non-zero but doesn't
         refer to a schedule group that includes an active schedule,
         then the policy will not be ready, even if this is due to a
         misconfiguration of this object or the pmSchedTable."
    ::= { pmPolicyEntry 5 }
        

pmPolicyElementTypeFilter OBJECT-TYPE SYNTAX PmUTF8String (SIZE (0..128)) MAX-ACCESS read-create STATUS current DESCRIPTION "This object specifies the element types for which this policy can be executed.

pmPolicyElementTypeFilter对象类型语法PmUTF8String(大小(0..128))MAX-ACCESS read create STATUS current DESCRIPTION“此对象指定可执行此策略的元素类型。

The format of this object will be a sequence of pmElementTypeRegOIDPrefix values, encoded in the following BNF form:

此对象的格式为pmElementTypeRegOIDPrefix值序列,以以下BNF格式编码:

        elementTypeFilter:   oid [ ';' oid ]*
                      oid:   subid [ '.' subid ]*
                    subid:   '0' | decimal_constant
        
        elementTypeFilter:   oid [ ';' oid ]*
                      oid:   subid [ '.' subid ]*
                    subid:   '0' | decimal_constant
        

For example, to register for the policy to be run on all interface elements, the 'ifEntry' element type will be registered as '1.3.6.1.2.1.2.2.1'.

例如,要注册在所有接口元素上运行的策略,“ifEntry”元素类型将注册为“1.3.6.1.2.1.2.2.1”。

        If a value is included that does not represent a registered
        pmElementTypeRegOIDPrefix, then that value will be ignored."
    ::= { pmPolicyEntry 6 }
        
        If a value is included that does not represent a registered
        pmElementTypeRegOIDPrefix, then that value will be ignored."
    ::= { pmPolicyEntry 6 }
        

pmPolicyConditionScriptIndex OBJECT-TYPE SYNTAX Unsigned32 (1..4294967295) MAX-ACCESS read-only STATUS current DESCRIPTION "A pointer to the row or rows in the pmPolicyCodeTable that contain the condition code for this policy. When a policy entry is created, a pmPolicyCodeIndex value unused by this policy's adminGroup will be assigned to this object.

pmPolicyConditionScriptIndex对象类型语法Unsigned32(1..4294967295)最大访问只读状态当前说明“指向pmPolicyCodeTable中包含此策略的条件代码的行的指针。创建策略条目时,此策略的adminGroup未使用的pmPolicyCodeIndex值将分配给此对象。

A policy condition is one or more PolicyScript statements that result(s) in a boolean value that represents whether an element is a member of a set of elements upon which an action is to be performed. If a policy is ready and the condition returns true for an element of a proper element type, and if no higher-precedence policy should be active, then the policy is active on that element.

策略条件是一个或多个PolicyScript语句,这些语句产生一个布尔值,该布尔值表示某个元素是否是要对其执行操作的一组元素的成员。如果策略已准备就绪,并且对于适当元素类型的元素,条件返回true,并且如果没有更高优先级的策略应处于活动状态,则该策略在该元素上处于活动状态。

Condition evaluation stops immediately when any run-time exception is detected, and the policyAction is not executed.

检测到任何运行时异常时,条件评估将立即停止,并且不会执行policyAction。

The policyCondition is evaluated for various elements. Any element for which the policyCondition returns any nonzero value will match the condition and will have the associated

将针对各种元素评估policyCondition。policyCondition为其返回任何非零值的任何元素都将匹配该条件并具有关联的

policyAction executed on that element unless a higher-precedence policy in the same precedence group also matches 'this element'.

对该元素执行的policyAction,除非同一优先级组中的更高优先级策略也与“this element”匹配。

If the condition object is empty (contains no code) or otherwise does not return a value, the element will not be matched.

如果条件对象为空(不包含代码)或未返回值,则元素将不匹配。

         When this condition is executed, if SNMP requests are made to
         the local system and secModel/secName/secLevel aren't
         specified, access to objects is under the security
         credentials of the requester who most recently modified the
         associated pmPolicyAdminStatus object.  If SNMP requests are
         made in which secModel/secName/secLevel are specified, then
         the specified credentials are retrieved from the local
         configuration datastore only if VACM is configured to
         allow access to the requester who most recently modified the
         associated pmPolicyAdminStatus object.  See the Security
         Considerations section for more information."
    ::= { pmPolicyEntry 7 }
        
         When this condition is executed, if SNMP requests are made to
         the local system and secModel/secName/secLevel aren't
         specified, access to objects is under the security
         credentials of the requester who most recently modified the
         associated pmPolicyAdminStatus object.  If SNMP requests are
         made in which secModel/secName/secLevel are specified, then
         the specified credentials are retrieved from the local
         configuration datastore only if VACM is configured to
         allow access to the requester who most recently modified the
         associated pmPolicyAdminStatus object.  See the Security
         Considerations section for more information."
    ::= { pmPolicyEntry 7 }
        

pmPolicyActionScriptIndex OBJECT-TYPE SYNTAX Unsigned32 (1..4294967295) MAX-ACCESS read-only STATUS current DESCRIPTION "A pointer to the row or rows in the pmPolicyCodeTable that contain the action code for this policy. When a policy entry is created, a pmPolicyCodeIndex value unused by this policy's adminGroup will be assigned to this object.

pmPolicyActionScriptIndex对象类型语法Unsigned32(1..4294967295)MAX-ACCESS只读状态当前描述“指向pmPolicyCodeTable中包含此策略的操作代码的行的指针。创建策略项时,此策略的adminGroup未使用的pmPolicyCodeIndex值将分配给此对象。

A PolicyAction is an operation performed on a set of elements for which the policy is active.

PolicyAction是对策略处于活动状态的一组元素执行的操作。

Action evaluation stops immediately when any run-time exception is detected.

检测到任何运行时异常时,操作评估立即停止。

When this condition is executed, if SNMP requests are made to the local system and secModel/secName/secLevel aren't specified, access to objects is under the security credentials of the requester who most recently modified the associated pmPolicyAdminStatus object. If SNMP requests are made in which secModel/secName/secLevel are specified, then the specified credentials are retrieved from the local configuration datastore only if VACM is configured to allow access to the requester who most recently modified the associated pmPolicyAdminStatus object. See the Security Considerations section for more information."

执行此条件时,如果向本地系统发出SNMP请求,并且未指定secModel/secName/secLevel,则对对象的访问将由最近修改关联的pmPolicyAdminStatus对象的请求者的安全凭据进行。如果SNMP请求中指定了secModel/secName/secLevel,则仅当VACM配置为允许访问最近修改关联的pmPolicyAdminStatus对象的请求者时,才会从本地配置数据存储中检索指定的凭据。有关详细信息,请参阅安全注意事项部分。”

    ::= { pmPolicyEntry 8 }
        
    ::= { pmPolicyEntry 8 }
        
pmPolicyParameters OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0..65535))
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "From time to time, policy scripts may seek one or more
        parameters (e.g., site-specific constants).  These parameters
        may be installed with the script in this object and are
        accessible to the script via the getParameters() function.  If
        it is necessary for multiple parameters to be passed to the
        script, the script can choose whatever encoding/delimiting
        mechanism is most appropriate."
    ::= { pmPolicyEntry 9 }
        
pmPolicyParameters OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0..65535))
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "From time to time, policy scripts may seek one or more
        parameters (e.g., site-specific constants).  These parameters
        may be installed with the script in this object and are
        accessible to the script via the getParameters() function.  If
        it is necessary for multiple parameters to be passed to the
        script, the script can choose whatever encoding/delimiting
        mechanism is most appropriate."
    ::= { pmPolicyEntry 9 }
        

pmPolicyConditionMaxLatency OBJECT-TYPE SYNTAX Unsigned32 (0..2147483647) UNITS "milliseconds" MAX-ACCESS read-create STATUS current DESCRIPTION "Every element under the control of this agent is re-checked periodically to see whether it is under control of this policy by re-running the condition for this policy. This object lets the manager control the maximum amount of time that may pass before an element is re-checked.

pmPolicyConditionMaxLatency对象类型语法Unsigned32(0..2147483647)单位“毫秒”最大访问读取创建状态当前说明“通过重新运行此策略的条件,定期重新检查受此代理控制的每个元素,以查看其是否受此策略的控制。此对象允许管理器控制重新检查元素之前可能经过的最长时间。

        In other words, in any given interval of this duration, all
        elements must be re-checked.  Note that how the policy agent
        schedules the checking of various elements within this
        interval is an implementation-dependent matter.
        Implementations may wish to re-run a condition more
        quickly if they note a change to the role strings for an
        element."
    ::= { pmPolicyEntry 10 }
        
        In other words, in any given interval of this duration, all
        elements must be re-checked.  Note that how the policy agent
        schedules the checking of various elements within this
        interval is an implementation-dependent matter.
        Implementations may wish to re-run a condition more
        quickly if they note a change to the role strings for an
        element."
    ::= { pmPolicyEntry 10 }
        

pmPolicyActionMaxLatency OBJECT-TYPE SYNTAX Unsigned32 (0..2147483647) UNITS "milliseconds" MAX-ACCESS read-create STATUS current DESCRIPTION "Every element that matches this policy's condition and is therefore under control of this policy will have this policy's action executed periodically to ensure that the element remains in the state dictated by the policy. This object lets the manager control the maximum amount of

pmPolicyActionMaxLatency对象类型语法Unsigned32(0..2147483647)单位“毫秒”最大访问读取创建状态当前描述“符合此策略条件并因此受此策略控制的每个元素都将定期执行此策略的操作,以确保元素保持策略指定的状态。此对象允许管理器控制最大的

time that may pass before an element has the action run on it.

在元素上运行操作之前可能经过的时间。

        In other words, in any given interval of this duration, all
        elements under control of this policy must have the action run
        on them.  Note that how the policy agent schedules the policy
        action on various elements within this interval is an
        implementation-dependent matter."
    ::= { pmPolicyEntry 11 }
        
        In other words, in any given interval of this duration, all
        elements under control of this policy must have the action run
        on them.  Note that how the policy agent schedules the policy
        action on various elements within this interval is an
        implementation-dependent matter."
    ::= { pmPolicyEntry 11 }
        

pmPolicyMaxIterations OBJECT-TYPE SYNTAX Unsigned32 MAX-ACCESS read-create STATUS current DESCRIPTION "If a condition or action script iterates in loops too many times in one invocation, the execution environment may consider it in an infinite loop or otherwise not acting as intended and may be terminated by the execution environment. The execution environment will count the cumulative number of times all 'for' or 'while' loops iterated and will apply a threshold to determine when to terminate the script. What threshold the execution environment uses is an implementation-dependent manner, but the value of this object SHOULD be the basis for choosing the threshold for each script. The value of this object represents a policy-specific threshold and can be tuned for policies of varying workloads. If this value is zero, no threshold will be enforced except for any implementation-dependent maximum. Regardless of this value, the agent is allowed to terminate any script invocation that exceeds a local CPU or memory limitation.

pmPolicyMaxIterations对象类型语法Unsigned32 MAX-ACCESS读取创建状态当前说明“如果一个条件或动作脚本在一个调用中循环太多次,则执行环境可以将其视为无限循环,否则不按预期执行,并且可以由执行环境终止。执行环境将计算所有“for”或“while”循环迭代的累积次数,并应用阈值来确定何时终止脚本。执行环境使用的阈值是一种依赖于实现的方式,但是该对象的值应该是为每个脚本选择阈值的基础。此对象的值表示特定于策略的阈值,可以针对不同工作负载的策略进行调整。如果此值为零,则除任何依赖于实现的最大值外,不会强制执行任何阈值。无论此值如何,都允许代理终止超出本地CPU或内存限制的任何脚本调用。

        Note that the condition and action invocations are tracked
        separately."
    ::= { pmPolicyEntry 12 }
        
        Note that the condition and action invocations are tracked
        separately."
    ::= { pmPolicyEntry 12 }
        
pmPolicyDescription OBJECT-TYPE
    SYNTAX      PmUTF8String
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
         "A description of this rule and its significance, typically
         provided by a human."
    ::= { pmPolicyEntry 13 }
        
pmPolicyDescription OBJECT-TYPE
    SYNTAX      PmUTF8String
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
         "A description of this rule and its significance, typically
         provided by a human."
    ::= { pmPolicyEntry 13 }
        

pmPolicyMatches OBJECT-TYPE SYNTAX Gauge32

pmPolicyMatches对象类型语法量表32

    UNITS       "elements"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
         "The number of elements that, in their most recent execution
         of the associated condition, were matched by the condition."
    ::= { pmPolicyEntry 14 }
        
    UNITS       "elements"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
         "The number of elements that, in their most recent execution
         of the associated condition, were matched by the condition."
    ::= { pmPolicyEntry 14 }
        
pmPolicyAbnormalTerminations OBJECT-TYPE
    SYNTAX      Gauge32
    UNITS       "elements"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
         "The number of elements that, in their most recent execution
         of the associated condition or action, have experienced a
         run-time exception and terminated abnormally.  Note that if a
         policy was experiencing a run-time exception while processing
         a particular element but runs normally on a subsequent
         invocation, this number can decline."
    ::= { pmPolicyEntry 15 }
        
pmPolicyAbnormalTerminations OBJECT-TYPE
    SYNTAX      Gauge32
    UNITS       "elements"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
         "The number of elements that, in their most recent execution
         of the associated condition or action, have experienced a
         run-time exception and terminated abnormally.  Note that if a
         policy was experiencing a run-time exception while processing
         a particular element but runs normally on a subsequent
         invocation, this number can decline."
    ::= { pmPolicyEntry 15 }
        
pmPolicyExecutionErrors OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "errors"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
         "The total number of times that execution of this policy's
         condition or action has been terminated due to run-time
         exceptions."
    ::= { pmPolicyEntry 16 }
        
pmPolicyExecutionErrors OBJECT-TYPE
    SYNTAX      Counter32
    UNITS       "errors"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
         "The total number of times that execution of this policy's
         condition or action has been terminated due to run-time
         exceptions."
    ::= { pmPolicyEntry 16 }
        
pmPolicyDebugging OBJECT-TYPE
    SYNTAX      INTEGER {
                    off(1),
                    on(2)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
         "The status of debugging for this policy.  If this is turned
         on(2), log entries will be created in the pmDebuggingTable
         for each run-time exception that is experienced by this
         policy."
    DEFVAL { off }
    ::= { pmPolicyEntry 17 }
        
pmPolicyDebugging OBJECT-TYPE
    SYNTAX      INTEGER {
                    off(1),
                    on(2)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
         "The status of debugging for this policy.  If this is turned
         on(2), log entries will be created in the pmDebuggingTable
         for each run-time exception that is experienced by this
         policy."
    DEFVAL { off }
    ::= { pmPolicyEntry 17 }
        
pmPolicyAdminStatus OBJECT-TYPE
    SYNTAX      INTEGER {
                    disabled(1),
                    enabled(2),
                    enabledAutoRemove(3)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
         "The administrative status of this policy.
        
pmPolicyAdminStatus OBJECT-TYPE
    SYNTAX      INTEGER {
                    disabled(1),
                    enabled(2),
                    enabledAutoRemove(3)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
         "The administrative status of this policy.
        

The policy will be valid only if the associated pmPolicyRowStatus is set to active(1) and this object is set to enabled(2) or enabledAutoRemove(3).

仅当关联的pmPolicyRowStatus设置为active(1)且此对象设置为enabled(2)或enabledAutoRemove(3)时,策略才有效。

If this object is set to enabledAutoRemove(3), the next time the associated schedule moves from the active state to the inactive state, this policy will immediately be deleted, including any associated entries in the pmPolicyCodeTable.

如果此对象设置为enabledAutoRemove(3),则下次关联的计划从活动状态移动到非活动状态时,将立即删除此策略,包括pmPolicyCodeTable中的任何关联条目。

The following related objects may not be changed unless this object is set to disabled(1): pmPolicyPrecedenceGroup, pmPolicyPrecedence, pmPolicySchedule, pmPolicyElementTypeFilter, pmPolicyConditionScriptIndex, pmPolicyActionScriptIndex, pmPolicyParameters, and any pmPolicyCodeTable row referenced by this policy. In order to change any of these parameters, the policy must be moved to the disabled(1) state, changed, and then re-enabled.

除非将此对象设置为禁用(1),否则无法更改以下相关对象:PMPolicyPreferenceGroup、PMPolicyPreference、pmPolicySchedule、pmPolicyElementTypeFilter、pmPolicyConditionScriptIndex、pmPolicyActionScriptIndex、pmPolicyParameters以及此策略引用的任何pmPolicyCodeTable行。要更改这些参数中的任何一个,必须将策略移动到禁用(1)状态,进行更改,然后重新启用。

         When this policy moves to either enabled state from the
         disabled state, any cached values of policy condition must be
         erased, and any Policy or PolicyElement scratchpad values for
         this policy should be removed.  Policy execution will begin by
         testing the policy condition on all appropriate elements."
    ::= { pmPolicyEntry 18 }
        
         When this policy moves to either enabled state from the
         disabled state, any cached values of policy condition must be
         erased, and any Policy or PolicyElement scratchpad values for
         this policy should be removed.  Policy execution will begin by
         testing the policy condition on all appropriate elements."
    ::= { pmPolicyEntry 18 }
        

pmPolicyStorageType OBJECT-TYPE SYNTAX StorageType MAX-ACCESS read-create STATUS current DESCRIPTION "This object defines whether this policy and any associated entries in the pmPolicyCodeTable are kept in volatile storage and lost upon reboot or if this row is backed up by non-volatile or permanent storage.

pmPolicyStorageType对象类型语法StorageType MAX-ACCESS读取创建状态当前描述“此对象定义此策略和pmPolicyCodeTable中的任何关联项是否保存在易失性存储中,并在重新启动时丢失,或者此行是否由非易失性或永久性存储备份。

         If the value of this object is 'permanent', the values for
         the associated pmPolicyAdminStatus object must remain
         writable."
    ::= { pmPolicyEntry 19 }
        
         If the value of this object is 'permanent', the values for
         the associated pmPolicyAdminStatus object must remain
         writable."
    ::= { pmPolicyEntry 19 }
        

pmPolicyRowStatus OBJECT-TYPE SYNTAX RowStatus MAX-ACCESS read-create STATUS current DESCRIPTION "The row status of this pmPolicyEntry.

pmPolicyRowStatus对象类型语法RowStatus MAX-ACCESS读取创建状态当前描述“此pmPolicyEntry的行状态。

The status may not be set to active if any of the related entries in the pmPolicyCode table do not have a status of active or if any of the objects in this row are not set to valid values. Only the following objects may be modified while in the active state: pmPolicyParameters pmPolicyConditionMaxLatency pmPolicyActionMaxLatency pmPolicyDebugging pmPolicyAdminStatus

如果pmPolicyCode表中的任何相关条目的状态不为active,或者如果此行中的任何对象未设置为有效值,则状态可能不会设置为active。处于活动状态时,只能修改以下对象:pmPolicyParameters pmPolicyConditionMaxLatency pmPolicyActionMaxLatency pmPolicyDebugging pmPolicyAdminStatus

         If this row is deleted, any associated entries in the
         pmPolicyCodeTable will be deleted as well."
    ::= { pmPolicyEntry 20 }
        
         If this row is deleted, any associated entries in the
         pmPolicyCodeTable will be deleted as well."
    ::= { pmPolicyEntry 20 }
        

-- Policy Code Table

--策略代码表

pmPolicyCodeTable OBJECT-TYPE SYNTAX SEQUENCE OF PmPolicyCodeEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The pmPolicyCodeTable stores the code for policy conditions and actions.

pmPolicyCodeTable对象类型PmPolicyCodeEntry MAX-ACCESS的语法序列不可访问状态当前描述“pmPolicyCodeTable存储策略条件和操作的代码。

An example of the relationships between the code table and the policy table follows:

代码表和策略表之间的关系示例如下:

pmPolicyTable AdminGroup Index ConditionScriptIndex ActionScriptIndex A '' 1 1 2 B 'oper' 1 1 2 C 'oper' 2 3 4

pmPolicyTable AdminGroup索引条件ScriptIndex操作ScriptIndex A''1 2 B'操作'1 1 2 C'操作'2 3 4

pmPolicyCodeTable AdminGroup ScriptIndex Segment Note

pmPolicyCodeTable管理员组脚本索引段注释

'' 1 1 Filter for policy A '' 2 1 Action for policy A 'oper' 1 1 Filter for policy B 'oper' 2 1 Action 1/2 for policy B 'oper' 2 2 Action 2/2 for policy B 'oper' 3 1 Filter for policy C 'oper' 4 1 Action for policy C

“”1策略A的筛选器“”2 1策略A的操作'oper'1策略B的筛选器'oper'2 1操作1/2策略B的操作'2 2操作2/2策略B的操作'3 1策略C的筛选器'oper'4 1策略C的操作

        In this example, there are 3 policies: 1 in the '' adminGroup,
        and 2 in the 'oper' adminGroup.  Policy A has been assigned
        script indexes 1 and 2 (these script indexes are assigned out of
        a separate pool per adminGroup), with 1 code segment each for
        the filter and the action.  Policy B has been assigned script
        indexes 1 and 2 (out of the pool for the 'oper' adminGroup).
        While the filter has 1 segment, the action is longer and is
        loaded into 2 segments.  Finally, Policy C has been assigned
        script indexes 3 and 4, with 1 code segment each for the filter
        and the action."
    ::= { pmMib 2 }
        
        In this example, there are 3 policies: 1 in the '' adminGroup,
        and 2 in the 'oper' adminGroup.  Policy A has been assigned
        script indexes 1 and 2 (these script indexes are assigned out of
        a separate pool per adminGroup), with 1 code segment each for
        the filter and the action.  Policy B has been assigned script
        indexes 1 and 2 (out of the pool for the 'oper' adminGroup).
        While the filter has 1 segment, the action is longer and is
        loaded into 2 segments.  Finally, Policy C has been assigned
        script indexes 3 and 4, with 1 code segment each for the filter
        and the action."
    ::= { pmMib 2 }
        

pmPolicyCodeEntry OBJECT-TYPE SYNTAX PmPolicyCodeEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry in the policy code table representing one code segment. Entries that share a common AdminGroup/ScriptIndex pair make up a single script. Valid values of ScriptIndex are retrieved from pmPolicyConditionScriptIndex and pmPolicyActionScriptIndex after a pmPolicyEntry is created. Segments of code can then be written to this table with the learned ScriptIndex values.

pmPolicyCodeEntry对象类型语法pmPolicyCodeEntry MAX-ACCESS不可访问状态当前描述“策略代码表中表示一个代码段的条目。共享公共AdminGroup/ScriptIndex对的条目组成一个脚本。创建pmPolicyEntry后,将从pmPolicyConditionScriptIndex和pmPolicyActionScriptIndex检索ScriptIndex的有效值。然后,代码段可以使用学习到的ScriptIndex值写入该表。

The StorageType of this entry is determined by the value of the associated pmPolicyStorageType.

此条目的StorageType由关联的pmPolicyStorageType的值确定。

        The pmPolicyAdminGroup element of the index represents the
        administrative group of the policy of which this code entry is
        a part."
    INDEX { pmPolicyAdminGroup, pmPolicyCodeScriptIndex,
            pmPolicyCodeSegment }
    ::= { pmPolicyCodeTable 1 }
        
        The pmPolicyAdminGroup element of the index represents the
        administrative group of the policy of which this code entry is
        a part."
    INDEX { pmPolicyAdminGroup, pmPolicyCodeScriptIndex,
            pmPolicyCodeSegment }
    ::= { pmPolicyCodeTable 1 }
        
PmPolicyCodeEntry ::= SEQUENCE {
    pmPolicyCodeScriptIndex    Unsigned32,
    pmPolicyCodeSegment        Unsigned32,
    pmPolicyCodeText           PmUTF8String,
    pmPolicyCodeStatus         RowStatus
        
PmPolicyCodeEntry ::= SEQUENCE {
    pmPolicyCodeScriptIndex    Unsigned32,
    pmPolicyCodeSegment        Unsigned32,
    pmPolicyCodeText           PmUTF8String,
    pmPolicyCodeStatus         RowStatus
        

}

}

pmPolicyCodeScriptIndex OBJECT-TYPE
    SYNTAX      Unsigned32 (1..4294967295)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
         "A unique index for each policy condition or action.  The code
         for each such condition or action may be composed of multiple
         entries in this table if the code cannot fit in one entry.
         Values of pmPolicyCodeScriptIndex may not be used unless
         they have previously been assigned in the
         pmPolicyConditionScriptIndex or pmPolicyActionScriptIndex
         objects."
    ::= { pmPolicyCodeEntry 1 }
        
pmPolicyCodeScriptIndex OBJECT-TYPE
    SYNTAX      Unsigned32 (1..4294967295)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
         "A unique index for each policy condition or action.  The code
         for each such condition or action may be composed of multiple
         entries in this table if the code cannot fit in one entry.
         Values of pmPolicyCodeScriptIndex may not be used unless
         they have previously been assigned in the
         pmPolicyConditionScriptIndex or pmPolicyActionScriptIndex
         objects."
    ::= { pmPolicyCodeEntry 1 }
        

pmPolicyCodeSegment OBJECT-TYPE SYNTAX Unsigned32 (1..4294967295) MAX-ACCESS not-accessible STATUS current DESCRIPTION "A unique index for each segment of a policy condition or action.

pmPolicyCodeSegment对象类型语法Unsigned32(1..4294967295)MAX-ACCESS不可访问状态当前描述“策略条件或操作的每个段的唯一索引。

         When a policy condition or action spans multiple entries in
         this table, the code of that policy starts from the
         lowest-numbered segment and continues with increasing segment
         values until it ends with the highest-numbered segment."
    ::= { pmPolicyCodeEntry 2 }
        
         When a policy condition or action spans multiple entries in
         this table, the code of that policy starts from the
         lowest-numbered segment and continues with increasing segment
         values until it ends with the highest-numbered segment."
    ::= { pmPolicyCodeEntry 2 }
        

pmPolicyCodeText OBJECT-TYPE SYNTAX PmUTF8String (SIZE (1..1024)) MAX-ACCESS read-create STATUS current DESCRIPTION "A segment of policy code (condition or action). Lengthy Policy conditions or actions may be stored in multiple segments in this table that share the same value of pmPolicyCodeScriptIndex. When multiple segments are used, it is recommended that each segment be as large as is practical.

pmPolicyCodeText对象类型语法PmUTF8String(大小(1..1024))MAX-ACCESS read create STATUS current DESCRIPTION“一段策略代码(条件或操作)。冗长的策略条件或操作可能存储在此表中共享相同pmPolicyCodeScriptIndex值的多个段中。使用多个段时,建议每个段尽可能大。

         Entries in this table are associated with policies by values
         of the pmPolicyConditionScriptIndex and
         pmPolicyActionScriptIndex objects.  If the status of the
         related policy is active, then this object may not be
         modified."
    ::= { pmPolicyCodeEntry 3 }
        
         Entries in this table are associated with policies by values
         of the pmPolicyConditionScriptIndex and
         pmPolicyActionScriptIndex objects.  If the status of the
         related policy is active, then this object may not be
         modified."
    ::= { pmPolicyCodeEntry 3 }
        

pmPolicyCodeStatus OBJECT-TYPE SYNTAX RowStatus MAX-ACCESS read-create STATUS current DESCRIPTION "The status of this code entry.

pmPolicyCodeStatus对象类型语法RowStatus MAX-ACCESS read create STATUS current DESCRIPTION“此代码项的状态。

Entries in this table are associated with policies by values of the pmPolicyConditionScriptIndex and pmPolicyActionScriptIndex objects. If the status of the related policy is active, then this object can not be modified (i.e., deleted or set to notInService), nor may new entries be created.

此表中的条目通过pmPolicyConditionScriptIndex和pmPolicyActionScriptIndex对象的值与策略关联。如果相关策略的状态为活动,则无法修改此对象(即,删除或设置为notInService),也不能创建新条目。

         If the status of this object is active, no objects in this
         row may be modified."
    ::= { pmPolicyCodeEntry 4 }
        
         If the status of this object is active, no objects in this
         row may be modified."
    ::= { pmPolicyCodeEntry 4 }
        

-- Element Type Registration Table

--元素类型登记表

pmElementTypeRegTable OBJECT-TYPE SYNTAX SEQUENCE OF PmElementTypeRegEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A registration table for element types managed by this system.

pmElementTypeRegTable对象类型语法PmElementTypeRegEntry MAX-ACCESS的序列不可访问状态当前描述“此系统管理的元素类型的注册表。

The Element Type Registration table allows the manager to learn what element types are being managed by the system and to register new types, if necessary. An element type is registered by providing the OID of an SNMP object (i.e., without the instance). Each SNMP instance that exists under that object is a distinct element. The index of the element is the index part of the discovered OID. This index will be supplied to policy conditions and actions so that this code can inspect and configure the element.

元素类型注册表允许管理员了解系统正在管理的元素类型,并在必要时注册新类型。通过提供SNMP对象的OID(即,没有实例)来注册元素类型。该对象下存在的每个SNMP实例都是一个不同的元素。元素的索引是已发现OID的索引部分。此索引将提供给策略条件和操作,以便此代码可以检查和配置元素。

For example, this table might contain the following entries. The first three are agent-installed, and the 4th was downloaded by a management station:

例如,此表可能包含以下条目。前三个是代理安装的,第四个是由管理站下载的:

OIDPrefix MaxLatency Description StorageType ifEntry 100 mS interfaces - builtin readOnly 0.0 100 mS system element - builtin readOnly frCircuitEntry 100 mS FR Circuits - builtin readOnly hrSWRunEntry 60 sec Running Processes volatile

OIDPrefix MaxLatency描述存储类型ifEntry 100毫秒接口-内置只读0.0 100毫秒系统元素-内置只读frCircuitEntry 100毫秒FR电路-内置只读hrSWRunEntry 60秒运行进程

Note that agents may automatically configure elements in this table for frequently used element types (interfaces, circuits, etc.). In particular, it may configure elements for whom discovery is optimized in one or both of the following ways:

请注意,代理可能会自动配置此表中经常使用的元素类型(接口、电路等)的元素。具体而言,它可以通过以下一种或两种方式配置发现优化的元素:

1. The agent may discover elements by scanning internal data structures as opposed to issuing local SNMP requests. It is possible to recreate the exact semantics described in this table even if local SNMP requests are not issued.

1. 代理可以通过扫描内部数据结构而不是发出本地SNMP请求来发现元素。即使未发出本地SNMP请求,也可以重新创建此表中描述的确切语义。

2. The agent may receive asynchronous notification of new elements (for example, 'card inserted') and use that information to instantly create elements rather than through polling. A similar feature might be available for the deletion of elements.

2. 代理可以接收新元素的异步通知(例如,“插入的卡”),并使用该信息立即创建元素,而不是通过轮询。可以使用类似的功能删除元素。

        Note that the disposition of agent-installed entries is
        described by the pmPolicyStorageType object."
    ::= { pmMib 3 }
        
        Note that the disposition of agent-installed entries is
        described by the pmPolicyStorageType object."
    ::= { pmMib 3 }
        

pmElementTypeRegEntry OBJECT-TYPE SYNTAX PmElementTypeRegEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A registration of an element type.

pmElementTypeRegEntry对象类型语法pmElementTypeRegEntry MAX-ACCESS不可访问状态当前描述“元素类型的注册”。

        Note that some values of this table's index may result in an
        instance name that exceeds a length of 128 sub-identifiers,
        which exceeds the maximum for the SNMP protocol.
        Implementations should take care to avoid such values."
    INDEX       { pmElementTypeRegOIDPrefix }
    ::= { pmElementTypeRegTable 1 }
        
        Note that some values of this table's index may result in an
        instance name that exceeds a length of 128 sub-identifiers,
        which exceeds the maximum for the SNMP protocol.
        Implementations should take care to avoid such values."
    INDEX       { pmElementTypeRegOIDPrefix }
    ::= { pmElementTypeRegTable 1 }
        
PmElementTypeRegEntry ::= SEQUENCE {
    pmElementTypeRegOIDPrefix     OBJECT IDENTIFIER,
    pmElementTypeRegMaxLatency    Unsigned32,
    pmElementTypeRegDescription   PmUTF8String,
    pmElementTypeRegStorageType   StorageType,
    pmElementTypeRegRowStatus     RowStatus
}
        
PmElementTypeRegEntry ::= SEQUENCE {
    pmElementTypeRegOIDPrefix     OBJECT IDENTIFIER,
    pmElementTypeRegMaxLatency    Unsigned32,
    pmElementTypeRegDescription   PmUTF8String,
    pmElementTypeRegStorageType   StorageType,
    pmElementTypeRegRowStatus     RowStatus
}
        

pmElementTypeRegOIDPrefix OBJECT-TYPE SYNTAX OBJECT IDENTIFIER MAX-ACCESS not-accessible STATUS current DESCRIPTION "This OBJECT IDENTIFIER value identifies a table in which all

pmElementTypeRegOIDPrefix对象类型语法对象标识符MAX-ACCESS不可访问状态当前描述“此对象标识符值标识一个表,其中所有

elements of this type will be found. Every row in the referenced table will be treated as an element for the period of time that it remains in the table. The agent will then execute policy conditions and actions as appropriate on each of these elements.

将找到此类型的元素。引用表中的每一行在其保留在表中的时间段内都将被视为一个元素。然后,代理将对每个元素执行适当的策略条件和操作。

This object identifier value is specified down to the 'entry' component (e.g., ifEntry) of the identifier.

该对象标识符值向下指定到标识符的“条目”组件(例如,ifEntry)。

The index of each discovered row will be passed to each invocation of the policy condition and policy action.

每个发现行的索引将传递给策略条件和策略操作的每次调用。

The actual mechanism by which instances are discovered is implementation dependent. Periodic walks of the table to discover the rows in the table is one such mechanism. This mechanism has the advantage that it can be performed by an agent with no knowledge of the names, syntax, or semantics of the MIB objects in the table. This mechanism also serves as the reference design. Other implementation-dependent mechanisms may be implemented that are more efficient (perhaps because they are hard coded) or that don't require polling. These mechanisms must discover the same elements as would the table-walking reference design.

发现实例的实际机制取决于实现。定期遍历表以发现表中的行就是这样一种机制。这种机制的优点是,它可以由代理执行,而不需要知道表中MIB对象的名称、语法或语义。该机制也可作为参考设计。其他依赖于实现的机制可以实现得更高效(可能是因为它们是硬编码的)或者不需要轮询。这些机制必须发现与桌面漫游参考设计相同的元素。

This object can contain a OBJECT IDENTIFIER, '0.0'. '0.0' represents the single instance of the system itself and provides an execution context for policies to operate on the 'system element' and on MIB objects modeled as scalars. For example, '0.0' gives an execution context for policy-based selection of the operating system code version (likely modeled as a scalar MIB object). The element type '0.0' always exists; as a consequence, no actual discovery will take place, and the pmElementTypeRegMaxLatency object will have no effect for the '0.0' element type. However, if the '0.0' element type is not registered in the table, policies will not be executed on the '0.0' element.

此对象可以包含对象标识符“0.0”“0.0”表示系统本身的单个实例,并为策略提供执行上下文,以在“系统元素”和建模为标量的MIB对象上操作。例如,“0.0”为基于策略的操作系统代码版本选择(可能建模为标量MIB对象)提供了执行上下文。元素类型“0.0”始终存在;因此,不会发生实际的发现,并且pmElementTypeRegMaxLatency对象对“0.0”元素类型没有影响。但是,如果表中未注册“0.0”元素类型,则不会对“0.0”元素执行策略。

When a policy is invoked on behalf of a '0.0' entry in this table, the element name will be '0.0', and there is no index of 'this element' (in other words, it has zero length).

当代表此表中的“0.0”项调用策略时,元素名称将为“0.0”,并且没有“this element”的索引(换句话说,它的长度为零)。

        As this object is used in the index for the
        pmElementTypeRegTable, users of this table should be careful
        not to create entries that would result in instance names with
        more than 128 sub-identifiers."
    ::= { pmElementTypeRegEntry 2 }
        
        As this object is used in the index for the
        pmElementTypeRegTable, users of this table should be careful
        not to create entries that would result in instance names with
        more than 128 sub-identifiers."
    ::= { pmElementTypeRegEntry 2 }
        

pmElementTypeRegMaxLatency OBJECT-TYPE SYNTAX Unsigned32 UNITS "milliseconds" MAX-ACCESS read-create STATUS current DESCRIPTION "The PM agent is responsible for discovering new elements of types that are registered. This object lets the manager control the maximum amount of time that may pass between the time an element is created and when it is discovered.

pmElementTypeRegMaxLatency对象类型语法无符号32单位“毫秒”最大访问读取创建状态当前描述“PM代理负责发现已注册类型的新元素。此对象允许管理器控制从创建元素到发现元素之间可能经过的最长时间。

        In other words, in any given interval of this duration, all
        new elements must be discovered.  Note that how the policy
        agent schedules the checking of various elements within this
        interval is an implementation-dependent matter."
    ::= { pmElementTypeRegEntry 3 }
        
        In other words, in any given interval of this duration, all
        new elements must be discovered.  Note that how the policy
        agent schedules the checking of various elements within this
        interval is an implementation-dependent matter."
    ::= { pmElementTypeRegEntry 3 }
        
pmElementTypeRegDescription OBJECT-TYPE
    SYNTAX      PmUTF8String (SIZE (0..64))
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "A descriptive label for this registered type."
    ::= { pmElementTypeRegEntry 4 }
        
pmElementTypeRegDescription OBJECT-TYPE
    SYNTAX      PmUTF8String (SIZE (0..64))
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "A descriptive label for this registered type."
    ::= { pmElementTypeRegEntry 4 }
        

pmElementTypeRegStorageType OBJECT-TYPE SYNTAX StorageType MAX-ACCESS read-create STATUS current DESCRIPTION "This object defines whether this row is kept in volatile storage and lost upon reboot or backed up by non-volatile or permanent storage.

pmElementTypeRegStorageType对象类型语法StorageType MAX-ACCESS读取创建状态当前描述“此对象定义此行是否保存在易失性存储中,并在重新启动时丢失,还是由非易失性或永久性存储备份。

         If the value of this object is 'permanent', no values in the
         associated row have to be writable."
    ::= { pmElementTypeRegEntry 5 }
        
         If the value of this object is 'permanent', no values in the
         associated row have to be writable."
    ::= { pmElementTypeRegEntry 5 }
        

pmElementTypeRegRowStatus OBJECT-TYPE SYNTAX RowStatus MAX-ACCESS read-create STATUS current DESCRIPTION "The status of this registration entry.

pmElementTypeRegRowStatus对象类型语法RowStatus MAX-ACCESS读取创建状态当前描述“此注册条目的状态。

        If the value of this object is active, no objects in this row
        may be modified."
    ::= { pmElementTypeRegEntry 6 }
        
        If the value of this object is active, no objects in this row
        may be modified."
    ::= { pmElementTypeRegEntry 6 }
        

-- Role Table

--角色表

pmRoleTable OBJECT-TYPE SYNTAX SEQUENCE OF PmRoleEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The pmRoleTable is a read-create table that organizes role strings sorted by element. This table is used to create and modify role strings and their associations, as well as to allow a management station to learn about the existence of roles and their associations.

PmRoleEntry MAX-ACCESS的pmRoleTable对象类型语法序列不可访问状态当前描述“pmRoleTable是一个read-create表,它组织按元素排序的角色字符串。此表用于创建和修改角色字符串及其关联,并允许管理站了解角色及其关联的存在。

It is the responsibility of the agent to keep track of any re-indexing of the underlying SNMP elements and to continue to associate role strings with the element with which they were initially configured.

代理负责跟踪底层SNMP元素的任何重新索引,并继续将角色字符串与最初配置它们的元素关联。

Policy MIB agents that have elements in multiple local SNMP contexts have to allow some roles to be assigned to elements in particular contexts. This is particularly true when some elements have the same names in different contexts and the context is required to disambiguate them. In those situations, a value for the pmRoleContextName may be provided. When a pmRoleContextName value is not provided, the assignment is to the element in the default context.

在多个本地SNMP上下文中具有元素的策略MIB代理必须允许将某些角色分配给特定上下文中的元素。当某些元素在不同的上下文中具有相同的名称,并且需要上下文来消除歧义时,情况尤其如此。在这些情况下,可能会提供pmRoleContextName的值。如果未提供pmRoleContextName值,则分配给默认上下文中的元素。

Policy MIB agents that discover elements on other systems and execute policies on their behalf need to have access to role information for these remote elements. In such situations, role assignments for other systems can be stored in this table by providing values for the pmRoleContextEngineID parameters.

发现其他系统上的元素并代表其执行策略的策略MIB代理需要访问这些远程元素的角色信息。在这种情况下,其他系统的角色分配可以通过提供pmRoleContextEngineID参数的值存储在此表中。

For example: Example: element role context ctxEngineID #comment ifindex.1 gold local, default context ifindex.2 gold local, default context repeaterid.1 foo rptr1 local, rptr1 context repeaterid.1 bar rptr2 local, rptr2 context ifindex.1 gold '' A different system ifindex.1 gold '' B different system

例如:示例:元素角色上下文ctxEngineID#注释iIndex.1 gold local,默认上下文iIndex.2 gold local,默认上下文repeaterid.1 foo rptr1 local,rptr1 context repeaterid.1 bar rptr2 local,rptr2 context iIndex.1 gold“”不同系统iIndex.1 gold“”不同系统

         The agent must store role string associations in non-volatile
         storage."
    ::= { pmMib 4 }
        
         The agent must store role string associations in non-volatile
         storage."
    ::= { pmMib 4 }
        

pmRoleEntry OBJECT-TYPE SYNTAX PmRoleEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A role string entry associates a role string with an individual element.

pmRoleEntry对象类型语法pmRoleEntry MAX-ACCESS不可访问状态当前描述“角色字符串条目将角色字符串与单个元素关联。

         Note that some combinations of index values may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP
         protocol.  Implementations should take care to avoid such
         combinations."
    INDEX       { pmRoleElement, pmRoleContextName,
                  pmRoleContextEngineID, pmRoleString }
    ::= { pmRoleTable 1 }
        
         Note that some combinations of index values may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP
         protocol.  Implementations should take care to avoid such
         combinations."
    INDEX       { pmRoleElement, pmRoleContextName,
                  pmRoleContextEngineID, pmRoleString }
    ::= { pmRoleTable 1 }
        
PmRoleEntry ::= SEQUENCE {
    pmRoleElement          RowPointer,
    pmRoleContextName      SnmpAdminString,
    pmRoleContextEngineID  OCTET STRING,
    pmRoleString           PmUTF8String,
    pmRoleStatus           RowStatus
}
        
PmRoleEntry ::= SEQUENCE {
    pmRoleElement          RowPointer,
    pmRoleContextName      SnmpAdminString,
    pmRoleContextEngineID  OCTET STRING,
    pmRoleString           PmUTF8String,
    pmRoleStatus           RowStatus
}
        

pmRoleElement OBJECT-TYPE SYNTAX RowPointer MAX-ACCESS not-accessible STATUS current DESCRIPTION "The element with which this role string is associated.

pmRoleElement对象类型语法RowPointer MAX-ACCESS不可访问状态当前描述“与此角色字符串关联的元素。

For example, if the element is interface 3, then this object will contain the OID for 'ifIndex.3'.

例如,如果元素是interface 3,则此对象将包含“ifIndex.3”的OID。

If the agent assigns new indexes in the MIB table to represent the same underlying element (re-indexing), the agent will modify this value to contain the new index for the underlying element.

如果代理在MIB表中分配新索引以表示相同的基础元素(重新索引),则代理将修改此值以包含基础元素的新索引。

         As this object is used in the index for the pmRoleTable,
         users of this table should be careful not to create entries
         that would result in instance names with more than 128
         sub-identifiers."
    ::= { pmRoleEntry 1 }
        
         As this object is used in the index for the pmRoleTable,
         users of this table should be careful not to create entries
         that would result in instance names with more than 128
         sub-identifiers."
    ::= { pmRoleEntry 1 }
        
pmRoleContextName OBJECT-TYPE
    SYNTAX      SnmpAdminString (SIZE (0..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is not in the default SNMP context
        for the target system, this object is used to identify the
        context.  If the element is in the default context, this object
        is equal to the empty string."
    ::= { pmRoleEntry 2 }
        
pmRoleContextName OBJECT-TYPE
    SYNTAX      SnmpAdminString (SIZE (0..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is not in the default SNMP context
        for the target system, this object is used to identify the
        context.  If the element is in the default context, this object
        is equal to the empty string."
    ::= { pmRoleEntry 2 }
        
pmRoleContextEngineID OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0 | 5..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is on a remote system, this object
        is used to identify the remote system.  This object contains
        the contextEngineID of the system for which this role string
        assignment is valid.  If the element is on the local system
        this object will be the empty string."
    ::= { pmRoleEntry 3 }
        
pmRoleContextEngineID OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0 | 5..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is on a remote system, this object
        is used to identify the remote system.  This object contains
        the contextEngineID of the system for which this role string
        assignment is valid.  If the element is on the local system
        this object will be the empty string."
    ::= { pmRoleEntry 3 }
        

pmRoleString OBJECT-TYPE SYNTAX PmUTF8String (SIZE (0..64)) MAX-ACCESS not-accessible STATUS current DESCRIPTION "The role string that is associated with an element through this table. All role strings must have been successfully transformed by Stringprep RFC 3454. Management stations must perform this translation and must only set this object to string values that have been transformed.

pmRoleString对象类型语法PmUTF8String(大小(0..64))MAX-ACCESS不可访问状态当前说明“通过此表与元素关联的角色字符串。Stringprep RFC 3454必须已成功转换所有角色字符串。管理工作站必须执行此转换,并且只能将此对象设置为已转换的字符串值。

         A role string is an administratively specified characteristic
         of a managed element (for example, an interface).  It is a
         selector for policy rules, that determines the applicability of
         the rule to a particular managed element."
    ::= { pmRoleEntry 4 }
        
         A role string is an administratively specified characteristic
         of a managed element (for example, an interface).  It is a
         selector for policy rules, that determines the applicability of
         the rule to a particular managed element."
    ::= { pmRoleEntry 4 }
        

pmRoleStatus OBJECT-TYPE SYNTAX RowStatus MAX-ACCESS read-create STATUS current DESCRIPTION "The status of this role string.

pmRoleStatus对象类型语法RowStatus MAX-ACCESS read create STATUS current DESCRIPTION“此角色字符串的状态。

         If the value of this object is active, no object in this row
         may be modified."
    ::= { pmRoleEntry 5 }
        
         If the value of this object is active, no object in this row
         may be modified."
    ::= { pmRoleEntry 5 }
        

-- Capabilities table

--能力表

pmCapabilitiesTable OBJECT-TYPE SYNTAX SEQUENCE OF PmCapabilitiesEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The pmCapabilitiesTable contains a description of the inherent capabilities of the system so that management stations can learn of an agent's capabilities and differentially install policies based on the capabilities.

pmCapabilitiesTable对象类型PmCapabilitiesEntry MAX-ACCESS不可访问状态当前描述“pmCapabilitiesTable包含系统固有功能的描述,以便管理站可以了解代理的功能,并根据这些功能差异安装策略。

         Capabilities are expressed at the system level.  There can be
         variation in how capabilities are realized from one vendor or
         model to the next.  Management systems should consider these
         differences before selecting which policy to install in a
         system."
    ::= { pmMib 5 }
        
         Capabilities are expressed at the system level.  There can be
         variation in how capabilities are realized from one vendor or
         model to the next.  Management systems should consider these
         differences before selecting which policy to install in a
         system."
    ::= { pmMib 5 }
        

pmCapabilitiesEntry OBJECT-TYPE SYNTAX PmCapabilitiesEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "A capabilities entry holds an OID indicating support for a particular capability. Capabilities may include hardware and software functions and the implementation of MIB Modules. The semantics of the OID are defined in the description of pmCapabilitiesType.

pmCapabilitiesEntry对象类型语法pmCapabilitiesEntry MAX-ACCESS不可访问状态当前描述“能力条目包含一个OID,指示对特定能力的支持。功能可能包括硬件和软件功能以及MIB模块的实现。OID的语义在pmCapabilitiesType的描述中定义。

Entries appear in this table if any element in the system has a specific capability. A capability should appear in this table only once, regardless of the number of elements in the system with that capability. An entry is removed from this table when the last element in the system that has the capability is removed. In some cases, capabilities are dynamic and exist only in software. This table should have an entry for the capability even if there are no current instances. Examples include systems with database or WEB services. While the system has the ability to create new databases or WEB services, the entry should exist. In these cases, the ability to create these services could come from other processes that are running in the system, even though there are no currently open databases or WEB servers running.

如果系统中的任何元素具有特定功能,则此表中会显示条目。无论具有该功能的系统中有多少个元素,该功能只能在此表中出现一次。当系统中具有该功能的最后一个元素被删除时,将从此表中删除一个条目。在某些情况下,功能是动态的,只存在于软件中。即使没有当前实例,此表也应该有该功能的条目。示例包括带有数据库或WEB服务的系统。虽然系统能够创建新的数据库或WEB服务,但条目应该存在。在这些情况下,创建这些服务的能力可能来自系统中运行的其他进程,即使当前没有运行的开放数据库或WEB服务器。

Capabilities may include the implementation of MIB Modules but need not be limited to those that represent MIB Modules with one or more configurable objects. It may also be valuable to include entries for capabilities that do not include configuration objects, as that information, in combination with other entries in this table, might be used by the management software to determine whether to install a policy.

功能可能包括MIB模块的实现,但不必限于那些用一个或多个可配置对象表示MIB模块的功能。包含不包含配置对象的功能的条目也可能很有价值,因为管理软件可能会使用该信息以及此表中的其他条目来确定是否安装策略。

Vendor software may also add entries in this table to express capabilities from their private branch.

供应商软件也可以在此表中添加条目,以表示其私人分支机构的功能。

         Note that some values of this table's index may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP
         protocol.  Implementations should take care to avoid such
         values."
    INDEX       { pmCapabilitiesType }
    ::= { pmCapabilitiesTable 1 }
        
         Note that some values of this table's index may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP
         protocol.  Implementations should take care to avoid such
         values."
    INDEX       { pmCapabilitiesType }
    ::= { pmCapabilitiesTable 1 }
        
PmCapabilitiesEntry ::= SEQUENCE {
    pmCapabilitiesType               OBJECT IDENTIFIER
}
        
PmCapabilitiesEntry ::= SEQUENCE {
    pmCapabilitiesType               OBJECT IDENTIFIER
}
        

pmCapabilitiesType OBJECT-TYPE SYNTAX OBJECT IDENTIFIER MAX-ACCESS read-only STATUS current DESCRIPTION "There are three types of OIDs that may be present in the pmCapabilitiesType object:

pmCapabilitiesType对象类型语法对象标识符MAX-ACCESS只读状态当前描述“pmCapabilitiesType对象中可能存在三种类型的OID:

1) The OID of a MODULE-COMPLIANCE macro that represents the highest level of compliance realized by the agent for that MIB Module. For example, an agent that implements the OSPF MIB Module at the highest level of compliance would have the value of '1.3.6.1.2.1.14.15.2' in the pmCapabilitiesType object. For software that realizes standard MIB Modules that do not have compliance statements, the base OID of the MIB Module should be used instead. If the OSPF MIB Module had not been created with a compliance statement, then the correct value of the pmCapabilitiesType would be '1.3.6.1.2.1.14'. In the cases where multiple compliance statements in a MIB Module are supported by the agent, and where one compliance statement does not by definition include the other, each of the compliance OIDs would have entries in this table.

1) MODULE-COMPLIANCE宏的OID,表示代理程序为该MIB模块实现的最高遵从性级别。例如,以最高合规性级别实现OSPF MIB模块的代理在pmCapabilitiesType对象中的值为“1.3.6.1.2.1.14.15.2”。对于实现没有符合性声明的标准MIB模块的软件,应改用MIB模块的基本OID。如果OSPF MIB模块未使用符合性声明创建,则pmCapabilitiesType的正确值将为“1.3.6.1.2.1.14”。如果代理支持MIB模块中的多个符合性声明,并且根据定义一个符合性声明不包括另一个符合性声明,则每个符合性OID将在此表中有条目。

MIB Documents can contain more than one MIB Module. In the case of OSPF, there is a second MIB Module that describes notifications for the OSPF Version 2 Protocol. If the agent also realizes these functions, an entry will also exist for those capabilities in this table.

MIB文档可以包含多个MIB模块。对于OSPF,还有第二个MIB模块,用于描述OSPF版本2协议的通知。如果代理还实现了这些功能,则该表中还将存在这些功能的条目。

2) Vendors should install OIDs in this table that represent vendor-specific capabilities. These capabilities can be expressed just as those described above for MIB Modules on the standards track. In addition, vendors may install any OID they desire from their registered branch. The OIDs may be at any level of granularity, from the root of their entire branch to an instance of a single OID. There is no restriction on the number of registrations they may make, though care should be taken to avoid unnecessary entries.

2) 供应商应在此表中安装代表供应商特定功能的OID。这些功能的表达方式与上述标准轨道上的MIB模块相同。此外,供应商可以从其注册的分支安装他们想要的任何OID。OID可以是任何粒度级别的,从其整个分支的根到单个OID的实例。他们可能进行的注册数量没有限制,但应注意避免不必要的输入。

3) OIDs that represent one capability or a collection of capabilities that could be any collection of MIB Objects or hardware or software functions may be created in working groups and registered in a MIB Module. Other entities (e.g., vendors) may also make registrations. Software will register these standard capability OIDs, as well as vendor specific OIDs.

3) 可以在工作组中创建表示一种功能或一组功能(可以是MIB对象或硬件或软件功能的任何集合)的OID,并在MIB模块中注册。其他实体(如供应商)也可以进行注册。软件将注册这些标准功能OID以及特定于供应商的OID。

If the OID for a known capability is not present in the table, then it should be assumed that the capability is not implemented.

如果表中不存在已知功能的OID,则应假定该功能未实现。

         As this object is used in the index for the
         pmCapabilitiesTable, users of this table should be careful
         not to create entries that would result in instance names
         with more than 128 sub-identifiers."
    ::= { pmCapabilitiesEntry 1 }
        
         As this object is used in the index for the
         pmCapabilitiesTable, users of this table should be careful
         not to create entries that would result in instance names
         with more than 128 sub-identifiers."
    ::= { pmCapabilitiesEntry 1 }
        

-- Capabilities override table

--能力覆盖表

pmCapabilitiesOverrideTable OBJECT-TYPE SYNTAX SEQUENCE OF PmCapabilitiesOverrideEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The pmCapabilitiesOverrideTable allows management stations to override pmCapabilitiesTable entries that have been registered by the agent. This facility can be used to avoid situations in which managers in the network send policies to a system that has advertised a capability in the pmCapabilitiesTable but that should not be installed on this particular system. One example could be newly deployed

PMCapabilitieOverrideTable对象类型语法PMCapabilitieOverrideEntry MAX-ACCESS的序列不可访问状态当前描述“PMCapabilitieOverrideTable允许管理站覆盖代理已注册的pmCapabilitiesTable条目。此功能可用于避免网络中的管理员将策略发送到已在pmCapabilitiesTable中公布功能但不应安装在此特定系统上的系统的情况。可以新部署一个示例

         equipment that is still in a trial state in a trial state or
         resources reserved for some other administrative reason.
         This table can also be used to override entries in the
         pmCapabilitiesTable through the use of the
         pmCapabilitiesOverrideState object.  Capabilities can also be
         declared available in this table that were not registered in
         the pmCapabilitiesTable.  A management application can make
         an entry in this table for any valid OID and declare the
         capability available by setting the
         pmCapabilitiesOverrideState for that row to valid(1)."
    ::= { pmMib 6 }
        
         equipment that is still in a trial state in a trial state or
         resources reserved for some other administrative reason.
         This table can also be used to override entries in the
         pmCapabilitiesTable through the use of the
         pmCapabilitiesOverrideState object.  Capabilities can also be
         declared available in this table that were not registered in
         the pmCapabilitiesTable.  A management application can make
         an entry in this table for any valid OID and declare the
         capability available by setting the
         pmCapabilitiesOverrideState for that row to valid(1)."
    ::= { pmMib 6 }
        

pmCapabilitiesOverrideEntry OBJECT-TYPE SYNTAX PmCapabilitiesOverrideEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry in this table indicates whether a particular capability is valid or invalid.

pmcapabilitieoverrideentry对象类型语法pmcapabilitieoverrideentry MAX-ACCESS不可访问状态当前描述“此表中的一个条目指示特定功能是否有效。

         Note that some values of this table's index may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP
         protocol.  Implementations should take care to avoid such
         values."
    INDEX       { pmCapabilitiesOverrideType }
    ::= { pmCapabilitiesOverrideTable 1 }
        
         Note that some values of this table's index may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP
         protocol.  Implementations should take care to avoid such
         values."
    INDEX       { pmCapabilitiesOverrideType }
    ::= { pmCapabilitiesOverrideTable 1 }
        
PmCapabilitiesOverrideEntry ::= SEQUENCE {
    pmCapabilitiesOverrideType               OBJECT IDENTIFIER,
    pmCapabilitiesOverrideState              INTEGER,
    pmCapabilitiesOverrideRowStatus          RowStatus
}
        
PmCapabilitiesOverrideEntry ::= SEQUENCE {
    pmCapabilitiesOverrideType               OBJECT IDENTIFIER,
    pmCapabilitiesOverrideState              INTEGER,
    pmCapabilitiesOverrideRowStatus          RowStatus
}
        

pmCapabilitiesOverrideType OBJECT-TYPE SYNTAX OBJECT IDENTIFIER MAX-ACCESS not-accessible STATUS current DESCRIPTION "This is the OID of the capability that is declared valid or invalid by the pmCapabilitiesOverrideState value for this row. Any valid OID, as described in the pmCapabilitiesTable, is permitted in the pmCapabilitiesOverrideType object. This means that capabilities can be expressed at any level, from a specific instance of an object to a table or entire module. There are no restrictions on whether these objects are from standards track MIB documents or in the private branch of the MIB.

PMCapabilitieOverrideType对象类型语法对象标识符MAX-ACCESS不可访问状态当前描述“这是由此行的PMCapabilitieOverridesState值声明为有效或无效的功能的OID。pmCapabilitiesOverrideType对象中允许使用pmCapabilitiesTable中描述的任何有效OID。这意味着功能可以在任何级别表达,从对象的特定实例到表或整个模块。对于这些对象是来自标准跟踪MIB文档还是在MIB的私有分支中,没有任何限制。

If an entry exists in this table for which there is a corresponding entry in the pmCapabilitiesTable, then this entry shall have precedence over the entry in the pmCapabilitiesTable. All entries in this table must be preserved across reboots.

如果此表中存在一个条目,且pmCapabilitiesTable中有相应条目,则此条目应优先于pmCapabilitiesTable中的条目。此表中的所有条目必须在重新启动期间保留。

         As this object is used in the index for the
         pmCapabilitiesOverrideTable, users of this table should be
         careful not to create entries that would result in instance
         names with more than 128 sub-identifiers."
    ::= { pmCapabilitiesOverrideEntry 1 }
        
         As this object is used in the index for the
         pmCapabilitiesOverrideTable, users of this table should be
         careful not to create entries that would result in instance
         names with more than 128 sub-identifiers."
    ::= { pmCapabilitiesOverrideEntry 1 }
        
pmCapabilitiesOverrideState OBJECT-TYPE
    SYNTAX      INTEGER {
                    invalid(1),
                    valid(2)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
         "A pmCapabilitiesOverrideState of invalid indicates that
         management software should not send policies to this system
         for the capability identified in the
         pmCapabilitiesOverrideType for this row of the table.  This
         behavior is the same whether the capability represented by
         the pmCapabilitiesOverrideType exists only in this table
         (that is, it was installed by an external management
         application) or exists in this table as well as the
         pmCapabilitiesTable.  This would be the case when a manager
         wanted to disable a capability that the native management
         system found and registered in the pmCapabilitiesTable.
        
pmCapabilitiesOverrideState OBJECT-TYPE
    SYNTAX      INTEGER {
                    invalid(1),
                    valid(2)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
         "A pmCapabilitiesOverrideState of invalid indicates that
         management software should not send policies to this system
         for the capability identified in the
         pmCapabilitiesOverrideType for this row of the table.  This
         behavior is the same whether the capability represented by
         the pmCapabilitiesOverrideType exists only in this table
         (that is, it was installed by an external management
         application) or exists in this table as well as the
         pmCapabilitiesTable.  This would be the case when a manager
         wanted to disable a capability that the native management
         system found and registered in the pmCapabilitiesTable.
        
         An entry in this table that has a pmCapabilitiesOverrideState
         of valid should be treated as though it appeared in the
         pmCapabilitiesTable.  If the entry also exists in the
         pmCapabilitiesTable in the pmCapabilitiesType object, and if
         the value of this object is valid, then the system shall
         operate as though this entry did not exist and policy
         installations and executions will continue in a normal
         fashion."
    ::= { pmCapabilitiesOverrideEntry 2 }
        
         An entry in this table that has a pmCapabilitiesOverrideState
         of valid should be treated as though it appeared in the
         pmCapabilitiesTable.  If the entry also exists in the
         pmCapabilitiesTable in the pmCapabilitiesType object, and if
         the value of this object is valid, then the system shall
         operate as though this entry did not exist and policy
         installations and executions will continue in a normal
         fashion."
    ::= { pmCapabilitiesOverrideEntry 2 }
        

pmCapabilitiesOverrideRowStatus OBJECT-TYPE SYNTAX RowStatus MAX-ACCESS read-create STATUS current DESCRIPTION "The row status of this pmCapabilitiesOverrideEntry.

pmCapabilitiesOverrideRowStatus对象类型语法RowStatus MAX-ACCESS读取创建状态当前描述“此pmCapabilitiesOverrideEntry的行状态。

         If the value of this object is active, no object in this row
         may be modified."
    ::= { pmCapabilitiesOverrideEntry 3 }
        
         If the value of this object is active, no object in this row
         may be modified."
    ::= { pmCapabilitiesOverrideEntry 3 }
        

-- The Schedule Group

--时间表组

pmSchedLocalTime OBJECT-TYPE
    SYNTAX      DateAndTime (SIZE (11))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The local time used by the scheduler.  Schedules that
         refer to calendar time will use the local time indicated
         by this object.  An implementation MUST return all 11 bytes
         of the DateAndTime textual-convention so that a manager
         may retrieve the offset from GMT time."
    ::= { pmMib 7 }
        
pmSchedLocalTime OBJECT-TYPE
    SYNTAX      DateAndTime (SIZE (11))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The local time used by the scheduler.  Schedules that
         refer to calendar time will use the local time indicated
         by this object.  An implementation MUST return all 11 bytes
         of the DateAndTime textual-convention so that a manager
         may retrieve the offset from GMT time."
    ::= { pmMib 7 }
        

-- -- The schedule table that controls the scheduler. --

----控制计划程序的计划表--

pmSchedTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF PmSchedEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "This table defines schedules for policies."
    ::= { pmMib 8 }
        
pmSchedTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF PmSchedEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "This table defines schedules for policies."
    ::= { pmMib 8 }
        

pmSchedEntry OBJECT-TYPE SYNTAX PmSchedEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry describing a particular schedule.

pmSchedEntry对象类型语法pmSchedEntry MAX-ACCESS not accessible STATUS current DESCRIPTION“描述特定计划的条目。

        Unless noted otherwise, writable objects of this row can be
        modified independently of the current value of pmSchedRowStatus,
        pmSchedAdminStatus and pmSchedOperStatus.  In particular, it
        is legal to modify pmSchedWeekDay, pmSchedMonth, and
        pmSchedDay when pmSchedRowStatus is active."
    INDEX { pmSchedIndex }
    ::= { pmSchedTable 1 }
        
        Unless noted otherwise, writable objects of this row can be
        modified independently of the current value of pmSchedRowStatus,
        pmSchedAdminStatus and pmSchedOperStatus.  In particular, it
        is legal to modify pmSchedWeekDay, pmSchedMonth, and
        pmSchedDay when pmSchedRowStatus is active."
    INDEX { pmSchedIndex }
    ::= { pmSchedTable 1 }
        
PmSchedEntry ::= SEQUENCE {
    pmSchedIndex          Unsigned32,
    pmSchedGroupIndex     Unsigned32,
    pmSchedDescr          PmUTF8String,
    pmSchedTimePeriod     PmUTF8String,
    pmSchedMonth          BITS,
    pmSchedDay            BITS,
    pmSchedWeekDay        BITS,
    pmSchedTimeOfDay      PmUTF8String,
    pmSchedLocalOrUtc     INTEGER,
    pmSchedStorageType    StorageType,
    pmSchedRowStatus      RowStatus
}
        
PmSchedEntry ::= SEQUENCE {
    pmSchedIndex          Unsigned32,
    pmSchedGroupIndex     Unsigned32,
    pmSchedDescr          PmUTF8String,
    pmSchedTimePeriod     PmUTF8String,
    pmSchedMonth          BITS,
    pmSchedDay            BITS,
    pmSchedWeekDay        BITS,
    pmSchedTimeOfDay      PmUTF8String,
    pmSchedLocalOrUtc     INTEGER,
    pmSchedStorageType    StorageType,
    pmSchedRowStatus      RowStatus
}
        
pmSchedIndex OBJECT-TYPE
    SYNTAX      Unsigned32 (1..4294967295)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The locally unique, administratively assigned index for this
        scheduling entry."
    ::= { pmSchedEntry 1 }
        
pmSchedIndex OBJECT-TYPE
    SYNTAX      Unsigned32 (1..4294967295)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The locally unique, administratively assigned index for this
        scheduling entry."
    ::= { pmSchedEntry 1 }
        

pmSchedGroupIndex OBJECT-TYPE SYNTAX Unsigned32 (1..4294967295) MAX-ACCESS read-create STATUS current DESCRIPTION "The locally unique, administratively assigned index for the schedule group this scheduling entry belongs to.

pmSchedGroupIndex对象类型语法Unsigned32(1..4294967295)MAX-ACCESS read create STATUS current DESCRIPTION“此调度条目所属的调度组的本地唯一、管理分配的索引。

To assign multiple schedule entries to the same group, the pmSchedGroupIndex of each entry in the group will be set to the same value. This pmSchedGroupIndex value must be equal to the pmSchedIndex of one of the entries in the group. If the entry whose pmSchedIndex equals the pmSchedGroupIndex for the group is deleted, the agent will assign a new pmSchedGroupIndex to all remaining members of the group.

要将多个计划条目分配给同一组,组中每个条目的pmSchedGroupIndex将设置为相同的值。此pmSchedGroupIndex值必须等于组中某个项的pmSchedIndex。如果删除pmSchedIndex等于组的pmSchedGroupIndex的条目,则代理将为组的所有剩余成员分配新的pmSchedGroupIndex。

If an entry is not a member of a group, its pmSchedGroupIndex must be assigned to the value of its pmSchedIndex.

如果条目不是组的成员,则必须将其pmSchedGroupIndex分配给其pmSchedIndex的值。

        Policies that are controlled by a group of schedule entries
        are active when any schedule in the group is active."
    ::= { pmSchedEntry 2 }
        
        Policies that are controlled by a group of schedule entries
        are active when any schedule in the group is active."
    ::= { pmSchedEntry 2 }
        
pmSchedDescr OBJECT-TYPE
    SYNTAX      PmUTF8String
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "The human-readable description of the purpose of this
        scheduling entry."
    DEFVAL { ''H }
    ::= { pmSchedEntry 3 }
        
pmSchedDescr OBJECT-TYPE
    SYNTAX      PmUTF8String
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "The human-readable description of the purpose of this
        scheduling entry."
    DEFVAL { ''H }
    ::= { pmSchedEntry 3 }
        

pmSchedTimePeriod OBJECT-TYPE SYNTAX PmUTF8String (SIZE (0..31)) MAX-ACCESS read-create STATUS current DESCRIPTION "The overall range of calendar dates and times over which this schedule is active. It is stored in a slightly extended version of the format for a 'period-explicit' defined in RFC 2445. This format is expressed as a string representing the starting date and time, in which the character 'T' indicates the beginning of the time portion, followed by the solidus character, '/', followed by a similar string representing an end date and time. The start of the period MUST be before the end of the period. Date-Time values are expressed as substrings of the form 'yyyymmddThhmmss'. For example:

pmSchedTimePeriod对象类型语法PmUTF8String(大小(0..31))MAX-ACCESS读取创建状态当前说明“此计划处于活动状态的日历日期和时间的总范围。它以RFC 2445中定义的“显式周期”格式的稍微扩展版本存储。此格式表示为表示开始日期和时间的字符串,其中字符“T”表示时间部分的开始,后跟索利多金币字符“/”,后跟表示结束日期和时间的类似字符串。期间的开始时间必须早于期间的结束时间。日期时间值表示为格式为“yyyymmddThhmmss”的子字符串。例如:

20000101T080000/20000131T130000

20000101T080000/20000131T1130000

January 1, 2000, 0800 through January 31, 2000, 1PM

2000年1月1日0800至2000年1月31日下午1点

The 'Date with UTC time' format defined in RFC 2445 in which the Date-Time string ends with the character 'Z' is not allowed.

不允许使用RFC 2445中定义的“带UTC时间的日期”格式,其中日期时间字符串以字符“Z”结尾。

This 'period-explicit' format is also extended to allow two special cases in which one of the Date-Time strings is replaced with a special string defined in RFC 2445:

“period explicit”格式还进行了扩展,以允许两种特殊情况,其中一种日期时间字符串替换为RFC 2445中定义的特殊字符串:

1. If the first Date-Time value is replaced with the string 'THISANDPRIOR', then the value indicates that the schedule is active at any time prior to the Date-Time that appears after the '/'.

1. 如果第一个日期时间值替换为字符串“ThisandPrevior”,则该值表示计划在“/”之后出现的日期时间之前的任何时间处于活动状态。

2. If the second Date-Time is replaced with the string 'THISANDFUTURE', then the value indicates that the schedule is active at any time after the Date-Time that appears before the '/'.

2. 如果第二个日期时间替换为字符串“THISANDFUTURE”,则该值表示该计划在“/”之前出现的日期时间之后的任何时间都处于活动状态。

        Note that although RFC 2445 defines these two strings, they are
        not specified for use in the 'period-explicit' format.  The use
        of these strings represents an extension to the
        'period-explicit' format."
    ::= { pmSchedEntry 4 }
        
        Note that although RFC 2445 defines these two strings, they are
        not specified for use in the 'period-explicit' format.  The use
        of these strings represents an extension to the
        'period-explicit' format."
    ::= { pmSchedEntry 4 }
        
pmSchedMonth OBJECT-TYPE
    SYNTAX      BITS {
                    january(0),
                    february(1),
                    march(2),
                    april(3),
                    may(4),
                    june(5),
                    july(6),
                    august(7),
                    september(8),
                    october(9),
                    november(10),
                    december(11)
                }
        
pmSchedMonth OBJECT-TYPE
    SYNTAX      BITS {
                    january(0),
                    february(1),
                    march(2),
                    april(3),
                    may(4),
                    june(5),
                    july(6),
                    august(7),
                    september(8),
                    october(9),
                    november(10),
                    december(11)
                }
        
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "Within the overall time period specified in the
        pmSchedTimePeriod object, the value of this object specifies
        the specific months within that time period when the schedule
        is active.  Setting all bits will cause the schedule to act
        independently of the month."
    DEFVAL { { january, february, march, april, may, june, july,
               august, september, october, november, december } }
    ::= { pmSchedEntry 5 }
        
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "Within the overall time period specified in the
        pmSchedTimePeriod object, the value of this object specifies
        the specific months within that time period when the schedule
        is active.  Setting all bits will cause the schedule to act
        independently of the month."
    DEFVAL { { january, february, march, april, may, june, july,
               august, september, october, november, december } }
    ::= { pmSchedEntry 5 }
        

pmSchedDay OBJECT-TYPE SYNTAX BITS { d1(0), d2(1), d3(2), d4(3), d5(4), d6(5), d7(6), d8(7), d9(8), d10(9), d11(10), d12(11), d13(12), d14(13), d15(14), d16(15), d17(16), d18(17), d19(18), d20(19), d21(20), d22(21), d23(22), d24(23), d25(24), d26(25), d27(26), d28(27), d29(28), d30(29), d31(30), r1(31), r2(32), r3(33), r4(34), r5(35), r6(36), r7(37), r8(38), r9(39), r10(40), r11(41), r12(42), r13(43), r14(44), r15(45), r16(46), r17(47), r18(48), r19(49), r20(50), r21(51), r22(52), r23(53), r24(54), r25(55),

元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元元(36),r7(37)、r8(38)、r9(39)、r10(40)、r11(41)、r12(42)、r13(43)、r14(44)、r15(45)、r16(46)、r17(47)、r18(48)、r19(49)、r20(50)、r21(51)、r22(52)、r23(53)、r24(54)、r25(55),

r26(56), r27(57), r28(58), r29(59), r30(60), r31(61) } MAX-ACCESS read-create STATUS current DESCRIPTION "Within the overall time period specified in the pmSchedTimePeriod object, the value of this object specifies the specific days of the month within that time period when the schedule is active.

r26(56)、r27(57)、r28(58)、r29(59)、r30(60)、r31(61)}MAX-ACCESS read create STATUS current DESCRIPTION“在pmschedtimeption对象中指定的总时间段内,此对象的值指定该时间段内计划处于活动状态的月份的特定天数。

There are two sets of bits one can use to define the day within a month:

有两组位可用于定义一个月内的日期:

Enumerations starting with the letter 'd' indicate a day in a month relative to the first day of a month. The first day of the month can therefore be specified by setting the bit d1(0), and d31(30) means the last day of a month with 31 days.

以字母“d”开头的枚举表示一个月中的某一天相对于一个月的第一天。因此,可以通过设置位d1(0)来指定月份的第一天,并且d31(30)表示一个月的最后一天,有31天。

Enumerations starting with the letter 'r' indicate a day in a month in reverse order, relative to the last day of a month. The last day in the month can therefore be specified by setting the bit r1(31), and r31(61) means the first day of a month with 31 days.

以字母“r”开头的枚举表示一个月中的一天,其顺序与一个月的最后一天相反。因此,可以通过设置位r1(31)来指定月份的最后一天,r31(61)表示一个月的第一天,有31天。

        Setting multiple bits will include several days in the set
        of possible days for this schedule.  Setting all bits starting
        with the letter 'd' or all bits starting with the letter 'r'
        will cause the schedule to act independently of the day of the
        month."
    DEFVAL { {  d1, d2, d3, d4, d5, d6, d7, d8, d9, d10,
                d11, d12, d13, d14, d15, d16, d17, d18, d19, d20,
                d21, d22, d23, d24, d25, d26, d27, d28, d29, d30,
                d31, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10,
                r11, r12, r13, r14, r15, r16, r17, r18, r19, r20,
                r21, r22, r23, r24, r25, r26, r27, r28, r29, r30,
                r31 } }
    ::= { pmSchedEntry 6 }
        
        Setting multiple bits will include several days in the set
        of possible days for this schedule.  Setting all bits starting
        with the letter 'd' or all bits starting with the letter 'r'
        will cause the schedule to act independently of the day of the
        month."
    DEFVAL { {  d1, d2, d3, d4, d5, d6, d7, d8, d9, d10,
                d11, d12, d13, d14, d15, d16, d17, d18, d19, d20,
                d21, d22, d23, d24, d25, d26, d27, d28, d29, d30,
                d31, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10,
                r11, r12, r13, r14, r15, r16, r17, r18, r19, r20,
                r21, r22, r23, r24, r25, r26, r27, r28, r29, r30,
                r31 } }
    ::= { pmSchedEntry 6 }
        

pmSchedWeekDay OBJECT-TYPE SYNTAX BITS { sunday(0), monday(1), tuesday(2), wednesday(3), thursday(4), friday(5),

pmSchedWeekDay对象类型语法位{sunday(0)、星期一(1)、星期二(2)、星期三(3)、星期四(4)、星期五(5),

                    saturday(6)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "Within the overall time period specified in the
        pmSchedTimePeriod object, the value of this object specifies
        the specific days of the week within that time period when
        the schedule is active.  Setting all bits will cause the
        schedule to act independently of the day of the week."
    DEFVAL { { sunday, monday, tuesday, wednesday, thursday,
               friday, saturday } }
    ::= { pmSchedEntry 7 }
        
                    saturday(6)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "Within the overall time period specified in the
        pmSchedTimePeriod object, the value of this object specifies
        the specific days of the week within that time period when
        the schedule is active.  Setting all bits will cause the
        schedule to act independently of the day of the week."
    DEFVAL { { sunday, monday, tuesday, wednesday, thursday,
               friday, saturday } }
    ::= { pmSchedEntry 7 }
        

pmSchedTimeOfDay OBJECT-TYPE SYNTAX PmUTF8String (SIZE (0..15)) MAX-ACCESS read-create STATUS current DESCRIPTION

pmSchedTimeOfDay对象类型语法PmUTF8String(大小(0..15))MAX-ACCESS读取创建状态当前描述

"Within the overall time period specified in the pmSchedTimePeriod object, the value of this object specifies the range of times in a day when the schedule is active.

“在pmSchedTimePeriod对象中指定的总时间段内,此对象的值指定一天中计划处于活动状态的时间范围。

This value is stored in a format based on the RFC 2445 format for 'time': The character 'T' followed by a 'time' string, followed by the solidus character, '/', followed by the character 'T', followed by a second time string. The first time indicates the beginning of the range, and the second time indicates the end. Thus, this value takes the following form:

此值以基于RFC 2445格式的“时间”格式存储:字符“T”后跟“时间”字符串,后跟索利多金币字符“/”,后跟字符“T”,后跟第二个时间字符串。第一次表示范围的开始,第二次表示范围的结束。因此,该值采用以下形式:

'Thhmmss/Thhmmss'.

“Thhmmss/Thhmmss”。

The second substring always identifies a later time than the first substring. To allow for ranges that span midnight, however, the value of the second string may be smaller than the value of the first substring. Thus, 'T080000/T210000' identifies the range from 0800 until 2100, whereas 'T210000/T080000' identifies the range from 2100 until 0800 of the following day.

第二个子串始终标识比第一个子串晚的时间。然而,为了允许跨越午夜的范围,第二个字符串的值可能小于第一个子字符串的值。因此,“T080000/T210000”表示从0800到2100的范围,而“T210000/T080000”表示从2100到次日0800的范围。

When a range spans midnight, by definition it includes parts of two successive days. When one of these days is also selected by either the MonthOfYearMask, DayOfMonthMask, and/or DayOfWeekMask, but the other day is not, then the policy is active only during the portion of the range that falls on the selected day. For example, if the range extends from 2100

根据定义,当一个范围跨越午夜时,它包括连续两天的部分时间。如果MonthOfYearMask、DayOfMonthMask和/或DayOfWeekMask也选择了其中一天,但另一天未选择,则策略仅在所选日期的范围内处于活动状态。例如,如果范围从2100扩展到

until 0800, and the day of week mask selects Monday and Tuesday, then the policy is active during the following three intervals:

在0800之前,如果星期几掩码选择星期一和星期二,则策略在以下三个时间间隔内处于活动状态:

From midnight Sunday until 0800 Monday From 2100 Monday until 0800 Tuesday From 2100 Tuesday until 23:59:59 Tuesday

从周日午夜到周一0800从周一2100点到周二0800从周二2100点到周二23:59:59

         Setting this value to 'T000000/T235959' will cause the
         schedule to act independently of the time of day."
    DEFVAL { '543030303030302F54323335393539'H } -- T000000/T235959
    ::= { pmSchedEntry 8 }
        
         Setting this value to 'T000000/T235959' will cause the
         schedule to act independently of the time of day."
    DEFVAL { '543030303030302F54323335393539'H } -- T000000/T235959
    ::= { pmSchedEntry 8 }
        
pmSchedLocalOrUtc OBJECT-TYPE
    SYNTAX      INTEGER {
                    localTime(1),
                    utcTime(2)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "This object indicates whether the times represented in the
        TimePeriod object and in the various Mask objects represent
        local times or UTC times."
    DEFVAL { utcTime }
    ::= { pmSchedEntry 9 }
        
pmSchedLocalOrUtc OBJECT-TYPE
    SYNTAX      INTEGER {
                    localTime(1),
                    utcTime(2)
                }
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "This object indicates whether the times represented in the
        TimePeriod object and in the various Mask objects represent
        local times or UTC times."
    DEFVAL { utcTime }
    ::= { pmSchedEntry 9 }
        

pmSchedStorageType OBJECT-TYPE SYNTAX StorageType MAX-ACCESS read-create STATUS current DESCRIPTION "This object defines whether this schedule entry is kept in volatile storage and lost upon reboot or backed up by non-volatile or permanent storage.

pmSchedStorageType OBJECT-TYPE语法StorageType MAX-ACCESS read create STATUS current DESCRIPTION“此对象定义此计划条目是否保存在易失性存储器中,并在重新启动时丢失,还是由非易失性或永久性存储器备份。

Conceptual rows having the value 'permanent' must allow write access to the columnar objects pmSchedDescr, pmSchedWeekDay, pmSchedMonth, and pmSchedDay.

值为“permanent”的概念行必须允许对列对象pmSchedDescr、pmSchedWeekDay、pmSchedMonth和pmSchedDay进行写访问。

         If the value of this object is 'permanent', no values in the
         associated row have to be writable."
    DEFVAL { volatile }
    ::= { pmSchedEntry 10 }
        
         If the value of this object is 'permanent', no values in the
         associated row have to be writable."
    DEFVAL { volatile }
    ::= { pmSchedEntry 10 }
        

pmSchedRowStatus OBJECT-TYPE SYNTAX RowStatus MAX-ACCESS read-create STATUS current DESCRIPTION "The status of this schedule entry.

pmSchedRowStatus对象类型语法RowStatus MAX-ACCESS read create STATUS current DESCRIPTION“此计划条目的状态。

         If the value of this object is active, no object in this row
         may be modified."
    ::= { pmSchedEntry 11 }
        
         If the value of this object is active, no object in this row
         may be modified."
    ::= { pmSchedEntry 11 }
        

-- Policy Tracking

--策略跟踪

-- The "policy to element" (PE) table and the "element to policy" (EP)
-- table track the status of execution contexts grouped by policy and
-- element respectively.
        
-- The "policy to element" (PE) table and the "element to policy" (EP)
-- table track the status of execution contexts grouped by policy and
-- element respectively.
        
pmTrackingPETable OBJECT-TYPE
    SYNTAX      SEQUENCE OF PmTrackingPEEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
         "The pmTrackingPETable describes what elements
         are active (under control of) a policy.  This table is indexed
         in order to optimize retrieval of the entire status for a
         given policy."
    ::= { pmMib 9 }
        
pmTrackingPETable OBJECT-TYPE
    SYNTAX      SEQUENCE OF PmTrackingPEEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
         "The pmTrackingPETable describes what elements
         are active (under control of) a policy.  This table is indexed
         in order to optimize retrieval of the entire status for a
         given policy."
    ::= { pmMib 9 }
        

pmTrackingPEEntry OBJECT-TYPE SYNTAX PmTrackingPEEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry in the pmTrackingPETable. The pmPolicyIndex in the index specifies the policy tracked by this entry.

PMTRACKINGPEANTRY对象类型语法PMTRACKINGPEANTRY MAX-ACCESS not ACCESS STATUS current DESCRIPTION“pmTrackingPETable中的一个条目。索引中的pmPolicyIndex指定此条目跟踪的策略。

         Note that some combinations of index values may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP
         protocol.  Implementations should take care to avoid such
         combinations."
    INDEX       { pmPolicyIndex, pmTrackingPEElement,
                  pmTrackingPEContextName, pmTrackingPEContextEngineID }
    ::= { pmTrackingPETable 1 }
        
         Note that some combinations of index values may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP
         protocol.  Implementations should take care to avoid such
         combinations."
    INDEX       { pmPolicyIndex, pmTrackingPEElement,
                  pmTrackingPEContextName, pmTrackingPEContextEngineID }
    ::= { pmTrackingPETable 1 }
        
PmTrackingPEEntry ::= SEQUENCE {
    pmTrackingPEElement          RowPointer,
    pmTrackingPEContextName      SnmpAdminString,
    pmTrackingPEContextEngineID  OCTET STRING,
    pmTrackingPEInfo             BITS
}
        
PmTrackingPEEntry ::= SEQUENCE {
    pmTrackingPEElement          RowPointer,
    pmTrackingPEContextName      SnmpAdminString,
    pmTrackingPEContextEngineID  OCTET STRING,
    pmTrackingPEInfo             BITS
}
        

pmTrackingPEElement OBJECT-TYPE SYNTAX RowPointer MAX-ACCESS not-accessible STATUS current DESCRIPTION "The element that is acted upon by the associated policy.

pmTrackingPEElement对象类型语法RowPointer MAX-ACCESS not accessible STATUS current DESCRIPTION“关联策略所作用的元素。

         As this object is used in the index for the
         pmTrackingPETable, users of this table should be careful not
         to create entries that would result in instance names with
         more than 128 sub-identifiers."
    ::= { pmTrackingPEEntry 1 }
        
         As this object is used in the index for the
         pmTrackingPETable, users of this table should be careful not
         to create entries that would result in instance names with
         more than 128 sub-identifiers."
    ::= { pmTrackingPEEntry 1 }
        
pmTrackingPEContextName OBJECT-TYPE
    SYNTAX      SnmpAdminString (SIZE (0..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is not in the default SNMP context
        for the target system, this object is used to identify the
        context.  If the element is in the default context, this object
        is equal to the empty string."
    ::= { pmTrackingPEEntry 2 }
        
pmTrackingPEContextName OBJECT-TYPE
    SYNTAX      SnmpAdminString (SIZE (0..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is not in the default SNMP context
        for the target system, this object is used to identify the
        context.  If the element is in the default context, this object
        is equal to the empty string."
    ::= { pmTrackingPEEntry 2 }
        
pmTrackingPEContextEngineID OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0 | 5..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is on a remote system, this object
        is used to identify the remote system.  This object contains
        the contextEngineID of the system on which the associated
        element resides.  If the element is on the local system,
        this object will be the empty string."
    ::= { pmTrackingPEEntry 3 }
        
pmTrackingPEContextEngineID OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0 | 5..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is on a remote system, this object
        is used to identify the remote system.  This object contains
        the contextEngineID of the system on which the associated
        element resides.  If the element is on the local system,
        this object will be the empty string."
    ::= { pmTrackingPEEntry 3 }
        

pmTrackingPEInfo OBJECT-TYPE SYNTAX BITS { actionSkippedDueToPrecedence(0), conditionRunTimeException(1), conditionUserSignal(2),

pmTrackingPEInfo对象类型语法位{ActionSkippedDueToRecessence(0)、conditionRunTimeException(1)、conditionUserSignal(2),

actionRunTimeException(3), actionUserSignal(4) } MAX-ACCESS read-only STATUS current DESCRIPTION "This object returns information about the previous policy script executions.

actionRunTimeException(3),actionUserSignal(4)}MAX-ACCESS只读状态当前描述“此对象返回有关以前策略脚本执行的信息。

If the actionSkippedDueToPrecedence(1) bit is set, the last execution of the associated policy condition returned non-zero, but the action is not active, because it was trumped by a matching policy condition in the same precedence group with a higher precedence value.

如果设置了ActionSkippedDueTopRecessence(1)位,则关联策略条件的最后一次执行返回非零,但该操作未处于活动状态,因为它被同一优先级组中具有更高优先级值的匹配策略条件所取代。

If the conditionRunTimeException(2) bit is set, the last execution of the associated policy condition encountered a run-time exception and aborted.

如果设置了conditionRunTimeException(2)位,则关联策略条件的最后一次执行遇到运行时异常并中止。

If the conditionUserSignal(3) bit is set, the last execution of the associated policy condition called the signalError() function.

如果设置了conditionUserSignal(3)位,则关联策略条件的最后一次执行称为signalError()函数。

If the actionRunTimeException(4) bit is set, the last execution of the associated policy action encountered a run-time exception and aborted.

如果设置了actionRunTimeException(4)位,则关联策略操作的最后一次执行遇到运行时异常并中止。

If the actionUserSignal(5) bit is set, the last execution of the associated policy action called the signalError() function.

如果设置了actionUserSignal(5)位,则关联策略操作的最后一次执行称为signalError()函数。

         Entries will only exist in this table of one or more bits are
         set.  In particular, if an entry does not exist for a
         particular policy/element combination, it can be assumed that
         the policy's condition did not match 'this element'."
    ::= { pmTrackingPEEntry 4 }
        
         Entries will only exist in this table of one or more bits are
         set.  In particular, if an entry does not exist for a
         particular policy/element combination, it can be assumed that
         the policy's condition did not match 'this element'."
    ::= { pmTrackingPEEntry 4 }
        

-- Element to Policy Table

--元素到策略表

pmTrackingEPTable OBJECT-TYPE SYNTAX SEQUENCE OF PmTrackingEPEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The pmTrackingEPTable describes what policies are controlling an element. This table is indexed in order to optimize retrieval of the status of all policies active for a given element."

PmTrackingEPEntry MAX-ACCESS不可访问状态当前描述“pmTrackingEPTable描述控制元素的策略。此表编制索引是为了优化对给定元素的所有活动策略状态的检索。”

    ::= { pmMib 10 }
        
    ::= { pmMib 10 }
        

pmTrackingEPEntry OBJECT-TYPE SYNTAX PmTrackingEPEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry in the pmTrackingEPTable. Entries exist for all element/policy combinations for which the policy's condition matches and only if the schedule for the policy is active.

pmTrackingEPEntry对象类型语法pmTrackingEPEntry MAX-ACCESS not accessible STATUS current DESCRIPTION“pmTrackingEPTable中的条目。对于策略条件匹配的所有元素/策略组合,只有在策略的计划处于活动状态时,才存在条目。

The pmPolicyIndex in the index specifies the policy tracked by this entry.

索引中的pmPolicyIndex指定此项跟踪的策略。

         Note that some combinations of index values may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP protocol.
         Implementations should take care to avoid such combinations."
    INDEX       { pmTrackingEPElement, pmTrackingEPContextName,
                  pmTrackingEPContextEngineID, pmPolicyIndex }
    ::= { pmTrackingEPTable 1 }
        
         Note that some combinations of index values may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP protocol.
         Implementations should take care to avoid such combinations."
    INDEX       { pmTrackingEPElement, pmTrackingEPContextName,
                  pmTrackingEPContextEngineID, pmPolicyIndex }
    ::= { pmTrackingEPTable 1 }
        
PmTrackingEPEntry ::= SEQUENCE {
    pmTrackingEPElement          RowPointer,
    pmTrackingEPContextName      SnmpAdminString,
    pmTrackingEPContextEngineID  OCTET STRING,
    pmTrackingEPStatus           INTEGER
}
        
PmTrackingEPEntry ::= SEQUENCE {
    pmTrackingEPElement          RowPointer,
    pmTrackingEPContextName      SnmpAdminString,
    pmTrackingEPContextEngineID  OCTET STRING,
    pmTrackingEPStatus           INTEGER
}
        

pmTrackingEPElement OBJECT-TYPE SYNTAX RowPointer MAX-ACCESS not-accessible STATUS current DESCRIPTION "The element acted upon by the associated policy.

pmTrackingEPElement对象类型语法RowPointer MAX-ACCESS not accessible STATUS current DESCRIPTION“关联策略所作用的元素。

         As this object is used in the index for the
         pmTrackingEPTable, users of this table should be careful
         not to create entries that would result in instance names
         with more than 128 sub-identifiers."
    ::= { pmTrackingEPEntry 1 }
        
         As this object is used in the index for the
         pmTrackingEPTable, users of this table should be careful
         not to create entries that would result in instance names
         with more than 128 sub-identifiers."
    ::= { pmTrackingEPEntry 1 }
        

pmTrackingEPContextName OBJECT-TYPE SYNTAX SnmpAdminString (SIZE (0..32)) MAX-ACCESS not-accessible STATUS current DESCRIPTION "If the associated element is not in the default SNMP context

pmTrackingEPContextName对象类型语法SnmpAdminString(大小(0..32))MAX-ACCESS not accessible STATUS current DESCRIPTION“如果关联元素不在默认SNMP上下文中

        for the target system, this object is used to identify the
        context.  If the element is in the default context, this object
        is equal to the empty string."
    ::= { pmTrackingEPEntry 2 }
        
        for the target system, this object is used to identify the
        context.  If the element is in the default context, this object
        is equal to the empty string."
    ::= { pmTrackingEPEntry 2 }
        
pmTrackingEPContextEngineID OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0 | 5..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is on a remote system, this object
        is used to identify the remote system.  This object contains
        the contextEngineID of the system on which the associated
        element resides.  If the element is on the local system,
        this object will be the empty string."
    ::= { pmTrackingEPEntry 3 }
        
pmTrackingEPContextEngineID OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0 | 5..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is on a remote system, this object
        is used to identify the remote system.  This object contains
        the contextEngineID of the system on which the associated
        element resides.  If the element is on the local system,
        this object will be the empty string."
    ::= { pmTrackingEPEntry 3 }
        
pmTrackingEPStatus OBJECT-TYPE
    SYNTAX      INTEGER {
                    on(1),
                    forceOff(2)
                }
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
         "This entry will only exist if the calendar for the policy is
         active and if the associated policyCondition returned 1 for
         'this element'.
        
pmTrackingEPStatus OBJECT-TYPE
    SYNTAX      INTEGER {
                    on(1),
                    forceOff(2)
                }
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
         "This entry will only exist if the calendar for the policy is
         active and if the associated policyCondition returned 1 for
         'this element'.
        

A policy can be forcibly disabled on a particular element by setting this value to forceOff(2). The agent should then act as though the policyCondition failed for 'this element'. The forceOff(2) state will persist (even across reboots) until this value is set to on(1) by a management request. The forceOff(2) state may be set even if the entry does not previously exist so that future policy invocations can be avoided.

通过将此值设置为forceOff(2),可以强制禁用特定元素上的策略。然后,代理应该像“this element”的policyCondition失败一样进行操作。forceOff(2)状态将持续(即使在重新启动期间),直到管理请求将此值设置为on(1)。即使条目以前不存在,也可以设置forceOff(2)状态,以避免将来的策略调用。

         Unless forcibly disabled, if this entry exists, its value
         will be on(1)."
    ::= { pmTrackingEPEntry 4 }
        
         Unless forcibly disabled, if this entry exists, its value
         will be on(1)."
    ::= { pmTrackingEPEntry 4 }
        

-- Policy Debugging Table

--策略调试表

pmDebuggingTable OBJECT-TYPE SYNTAX SEQUENCE OF PmDebuggingEntry MAX-ACCESS not-accessible STATUS current

PmDebuggingEntry MAX-ACCESS的pmDebuggingTable对象类型语法序列不可访问当前状态

DESCRIPTION "Policies that have debugging turned on will generate a log entry in the policy debugging table for every runtime exception that occurs in either the condition or action code.

DESCRIPTION“已启用调试的策略将在策略调试表中为条件或操作代码中发生的每个运行时异常生成一个日志项。

The pmDebuggingTable logs debugging messages when policies experience run-time exceptions in either the condition or action code and the associated pmPolicyDebugging object has been turned on.

当策略在条件或操作代码中遇到运行时异常且关联的pmPolicyDebugging对象已打开时,pmDebuggingTable将记录调试消息。

The maximum number of debugging entries that will be stored and the maximum length of time an entry will be kept are an implementation-dependent manner. If entries must be discarded to make room for new entries, the oldest entries must be discarded first.

将存储的调试项的最大数量和保留项的最大时间长度取决于实现。如果必须丢弃条目以为新条目腾出空间,则必须首先丢弃最旧的条目。

         If the system restarts, all debugging entries may be deleted."
    ::= { pmMib 11 }
        
         If the system restarts, all debugging entries may be deleted."
    ::= { pmMib 11 }
        

pmDebuggingEntry OBJECT-TYPE SYNTAX PmDebuggingEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry in the pmDebuggingTable. The pmPolicyIndex in the index specifies the policy that encountered the exception that led to this log entry.

pmDebuggingEntry对象类型语法pmDebuggingEntry MAX-ACCESS not ACCESS STATUS current DESCRIPTION“pmDebuggingTable中的一个条目。索引中的pmPolicyIndex指定遇到导致此日志条目的异常的策略。

         Note that some combinations of index values may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP protocol.
         Implementations should take care to avoid such combinations."
    INDEX       { pmPolicyIndex, pmDebuggingElement,
                  pmDebuggingContextName, pmDebuggingContextEngineID,
                  pmDebuggingLogIndex }
    ::= { pmDebuggingTable 1 }
        
         Note that some combinations of index values may result in an
         instance name that exceeds a length of 128 sub-identifiers,
         which exceeds the maximum for the SNMP protocol.
         Implementations should take care to avoid such combinations."
    INDEX       { pmPolicyIndex, pmDebuggingElement,
                  pmDebuggingContextName, pmDebuggingContextEngineID,
                  pmDebuggingLogIndex }
    ::= { pmDebuggingTable 1 }
        
PmDebuggingEntry ::= SEQUENCE {
    pmDebuggingElement          RowPointer,
    pmDebuggingContextName      SnmpAdminString,
    pmDebuggingContextEngineID  OCTET STRING,
    pmDebuggingLogIndex         Unsigned32,
    pmDebuggingMessage          PmUTF8String
}
        
PmDebuggingEntry ::= SEQUENCE {
    pmDebuggingElement          RowPointer,
    pmDebuggingContextName      SnmpAdminString,
    pmDebuggingContextEngineID  OCTET STRING,
    pmDebuggingLogIndex         Unsigned32,
    pmDebuggingMessage          PmUTF8String
}
        

pmDebuggingElement OBJECT-TYPE SYNTAX RowPointer MAX-ACCESS not-accessible STATUS current DESCRIPTION "The element the policy was executing on when it encountered the error that led to this log entry.

pmDebuggingElement对象类型语法RowPointer MAX-ACCESS不可访问状态当前描述“策略在遇到导致此日志项的错误时执行的元素。

For example, if the element is interface 3, then this object will contain the OID for 'ifIndex.3'.

例如,如果元素是interface 3,则此对象将包含“ifIndex.3”的OID。

         As this object is used in the index for the
         pmDebuggingTable, users of this table should be careful
         not to create entries that would result in instance names
         with more than 128 sub-identifiers."
    ::= { pmDebuggingEntry 1 }
        
         As this object is used in the index for the
         pmDebuggingTable, users of this table should be careful
         not to create entries that would result in instance names
         with more than 128 sub-identifiers."
    ::= { pmDebuggingEntry 1 }
        
pmDebuggingContextName OBJECT-TYPE
    SYNTAX      SnmpAdminString (SIZE (0..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is not in the default SNMP context
        for the target system, this object is used to identify the
        context.  If the element is in the default context, this object
        is equal to the empty string."
    ::= { pmDebuggingEntry 2 }
        
pmDebuggingContextName OBJECT-TYPE
    SYNTAX      SnmpAdminString (SIZE (0..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is not in the default SNMP context
        for the target system, this object is used to identify the
        context.  If the element is in the default context, this object
        is equal to the empty string."
    ::= { pmDebuggingEntry 2 }
        
pmDebuggingContextEngineID OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0 | 5..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is on a remote system, this object
        is used to identify the remote system.  This object contains
        the contextEngineID of the system on which the associated
        element resides.  If the element is on the local system,
        this object will be the empty string."
    ::= { pmDebuggingEntry 3 }
        
pmDebuggingContextEngineID OBJECT-TYPE
    SYNTAX      OCTET STRING (SIZE (0 | 5..32))
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "If the associated element is on a remote system, this object
        is used to identify the remote system.  This object contains
        the contextEngineID of the system on which the associated
        element resides.  If the element is on the local system,
        this object will be the empty string."
    ::= { pmDebuggingEntry 3 }
        
pmDebuggingLogIndex OBJECT-TYPE
    SYNTAX      Unsigned32 (1..4294967295)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
         "A unique index for this log entry among other log entries
         for this policy/element combination."
    ::= { pmDebuggingEntry 4 }
        
pmDebuggingLogIndex OBJECT-TYPE
    SYNTAX      Unsigned32 (1..4294967295)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
         "A unique index for this log entry among other log entries
         for this policy/element combination."
    ::= { pmDebuggingEntry 4 }
        
pmDebuggingMessage OBJECT-TYPE
    SYNTAX      PmUTF8String (SIZE (0..128))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
         "An error message generated by the policy execution
         environment.  It is recommended that this message include the
         time of day when the message was generated, if known."
    ::= { pmDebuggingEntry 5 }
        
pmDebuggingMessage OBJECT-TYPE
    SYNTAX      PmUTF8String (SIZE (0..128))
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
         "An error message generated by the policy execution
         environment.  It is recommended that this message include the
         time of day when the message was generated, if known."
    ::= { pmDebuggingEntry 5 }
        

-- Notifications

--通知

pmNotifications OBJECT IDENTIFIER ::= { pmMib 0 }
        
pmNotifications OBJECT IDENTIFIER ::= { pmMib 0 }
        

pmNewRoleNotification NOTIFICATION-TYPE OBJECTS { pmRoleStatus } STATUS current DESCRIPTION "The pmNewRoleNotification is sent when an agent is configured with its first instance of a previously unused role string (not every time a new element is given a particular role).

pmNewRoleNotification NOTIFICATION-TYPE OBJECTS{pmRoleStatus}STATUS current DESCRIPTION“当代理配置了其先前未使用的角色字符串的第一个实例时(并非每次为新元素指定特定角色时),将发送pmNewRoleNotification。

        An instance of the pmRoleStatus object is sent containing
        the new roleString in its index.  In the event that two or
        more elements are given the same role simultaneously, it is an
        implementation-dependent matter as to which pmRoleTable
        instance will be included in the notification."
    ::= { pmNotifications 1 }
        
        An instance of the pmRoleStatus object is sent containing
        the new roleString in its index.  In the event that two or
        more elements are given the same role simultaneously, it is an
        implementation-dependent matter as to which pmRoleTable
        instance will be included in the notification."
    ::= { pmNotifications 1 }
        

pmNewCapabilityNotification NOTIFICATION-TYPE OBJECTS { pmCapabilitiesType } STATUS current DESCRIPTION "The pmNewCapabilityNotification is sent when an agent gains a new capability that did not previously exist in any element on the system (not every time an element gains a particular capability).

pmNewCapabilityNotification-TYPE对象{pmCapabilitiesType}状态当前描述“当代理获得以前不存在于系统上任何元素中的新功能时(并非每次元素获得特定功能时),会发送pmNewCapabilityNotification。

        An instance of the pmCapabilitiesType object is sent containing
        the identity of the new capability.  In the event that two or
        more elements gain the same capability simultaneously, it is an
        implementation-dependent matter as to which pmCapabilitiesType
        instance will be included in the notification."
    ::= { pmNotifications 2 }
        
        An instance of the pmCapabilitiesType object is sent containing
        the identity of the new capability.  In the event that two or
        more elements gain the same capability simultaneously, it is an
        implementation-dependent matter as to which pmCapabilitiesType
        instance will be included in the notification."
    ::= { pmNotifications 2 }
        

pmAbnormalTermNotification NOTIFICATION-TYPE OBJECTS { pmTrackingPEInfo } STATUS current

pmAbnormalTermNotification通知类型对象{pmTrackingPEInfo}状态当前

DESCRIPTION "The pmAbnormalTermNotification is sent when a policy's pmPolicyAbnormalTerminations gauge value changes from zero to any value greater than zero and no such notification has been sent for that policy in the last 5 minutes.

DESCRIPTION“当策略的pmPolicyAbnormalTerminations量表值从零变为大于零的任何值,并且在过去5分钟内未针对该策略发送此类通知时,将发送PMabnormaltermination通知。

        The notification contains an instance of the pmTrackingPEInfo
        object where the pmPolicyIndex component of the index
        identifies the associated policy and the rest of the index
        identifies an element on which the policy failed."
    ::= { pmNotifications 3 }
        
        The notification contains an instance of the pmTrackingPEInfo
        object where the pmPolicyIndex component of the index
        identifies the associated policy and the rest of the index
        identifies an element on which the policy failed."
    ::= { pmNotifications 3 }
        

-- Compliance Statements

--合规声明

    pmConformance   OBJECT IDENTIFIER ::= { pmMib 12 }
    pmCompliances   OBJECT IDENTIFIER ::= { pmConformance 1 }
    pmGroups        OBJECT IDENTIFIER ::= { pmConformance 2 }
        
    pmConformance   OBJECT IDENTIFIER ::= { pmMib 12 }
    pmCompliances   OBJECT IDENTIFIER ::= { pmConformance 1 }
    pmGroups        OBJECT IDENTIFIER ::= { pmConformance 2 }
        
pmCompliance MODULE-COMPLIANCE
    STATUS  current
    DESCRIPTION
        "Describes the requirements for conformance to
        the Policy-Based Management MIB"
    MODULE  -- this module
        MANDATORY-GROUPS { pmPolicyManagementGroup, pmSchedGroup,
                           pmNotificationGroup }
    ::= { pmCompliances 1 }
        
pmCompliance MODULE-COMPLIANCE
    STATUS  current
    DESCRIPTION
        "Describes the requirements for conformance to
        the Policy-Based Management MIB"
    MODULE  -- this module
        MANDATORY-GROUPS { pmPolicyManagementGroup, pmSchedGroup,
                           pmNotificationGroup }
    ::= { pmCompliances 1 }
        

pmPolicyManagementGroup OBJECT-GROUP OBJECTS { pmPolicyPrecedenceGroup, pmPolicyPrecedence, pmPolicySchedule, pmPolicyElementTypeFilter, pmPolicyConditionScriptIndex, pmPolicyActionScriptIndex, pmPolicyParameters, pmPolicyConditionMaxLatency, pmPolicyActionMaxLatency, pmPolicyMaxIterations, pmPolicyDescription, pmPolicyMatches, pmPolicyAbnormalTerminations, pmPolicyExecutionErrors, pmPolicyDebugging, pmPolicyStorageType, pmPolicyAdminStatus, pmPolicyRowStatus, pmPolicyCodeText, pmPolicyCodeStatus, pmElementTypeRegMaxLatency, pmElementTypeRegDescription, pmElementTypeRegStorageType, pmElementTypeRegRowStatus, pmRoleStatus, pmCapabilitiesType, pmCapabilitiesOverrideState, pmCapabilitiesOverrideRowStatus, pmTrackingPEInfo, pmTrackingEPStatus, pmDebuggingMessage }

pmPolicyManagementGroup对象组对象{PMPolicyPreferenceGroup、PMPolicyPreference、pmPolicySchedule、pmPolicyElementTypeFilter、pmPolicyConditionScriptIndex、pmPolicyActionScriptIndex、pmPolicyParameters、pmPolicyConditionMaxLatency、pmPolicyActionMaxLatency、pmPolicyMaxIterations、pmPolicyDescription、pmPolicyMatches、PMPolicy异常终止、pmPolicyExecutionErrors、pmPolicyDebugging、pmPolicyStorageType、pmPolicyAdminStatus、pmPolicyRowStatus、pmPolicyCodeText、pmPolicyCodeStatus、pmElementTypeRegMaxLatency、pmElementTypeRegDescription、pmElementTypeRegStorageType、pmElementTypeRegRowStatus、pmRoleStatus、PMCapabilitiesOverridesState、PMCapabilitieOverrideRowstatus、pmTrackingPEInfo、PMTrackingInfotatus,pmDebuggingMessage}

    STATUS  current
    DESCRIPTION
        "Objects that allow for the creation and management of
        configuration policies."
    ::=  { pmGroups 1 }
        
    STATUS  current
    DESCRIPTION
        "Objects that allow for the creation and management of
        configuration policies."
    ::=  { pmGroups 1 }
        
pmSchedGroup OBJECT-GROUP
    OBJECTS { pmSchedLocalTime, pmSchedGroupIndex,
              pmSchedDescr, pmSchedTimePeriod,
              pmSchedMonth, pmSchedDay, pmSchedWeekDay,
              pmSchedTimeOfDay, pmSchedLocalOrUtc, pmSchedStorageType,
              pmSchedRowStatus
            }
    STATUS current
    DESCRIPTION
        "Objects that allow for the scheduling of policies."
    ::= { pmGroups 2 }
        
pmSchedGroup OBJECT-GROUP
    OBJECTS { pmSchedLocalTime, pmSchedGroupIndex,
              pmSchedDescr, pmSchedTimePeriod,
              pmSchedMonth, pmSchedDay, pmSchedWeekDay,
              pmSchedTimeOfDay, pmSchedLocalOrUtc, pmSchedStorageType,
              pmSchedRowStatus
            }
    STATUS current
    DESCRIPTION
        "Objects that allow for the scheduling of policies."
    ::= { pmGroups 2 }
        
pmNotificationGroup NOTIFICATION-GROUP
    NOTIFICATIONS { pmNewRoleNotification,
                    pmNewCapabilityNotification,
                    pmAbnormalTermNotification }
    STATUS        current
    DESCRIPTION
        "Notifications sent by an Policy MIB agent."
    ::= { pmGroups 3 }
        
pmNotificationGroup NOTIFICATION-GROUP
    NOTIFICATIONS { pmNewRoleNotification,
                    pmNewCapabilityNotification,
                    pmAbnormalTermNotification }
    STATUS        current
    DESCRIPTION
        "Notifications sent by an Policy MIB agent."
    ::= { pmGroups 3 }
        
pmBaseFunctionLibrary OBJECT IDENTIFIER ::= { pmGroups 4 }
        
pmBaseFunctionLibrary OBJECT IDENTIFIER ::= { pmGroups 4 }
        

END

终止

12. Relationship to Other MIB Modules
12. 与其他MIB模块的关系

When policy-based management is used specifically for (policy-based) configuration, the "Configuring Networks and Devices With SNMP" RFC 3512 [19] document describes configuration management practices, terminology, and an example of a MIB Module that may be helpful to those developing and using this technology.

当基于策略的管理专门用于(基于策略的)配置时,“使用SNMP配置网络和设备”RFC 3512[19]文档描述了配置管理实践、术语和MIB模块的示例,这些可能对开发和使用此技术的人员有所帮助。

The Policy MIB accesses system instrumentation for the purposes of policy evaluation, control, notification, monitoring, and error reporting. This information is available to managers in the form of MIB objects. Information about system configuration is modified by the Policy MIB through MIB objects defined in other MIB Modules.

策略MIB访问系统检测以进行策略评估、控制、通知、监视和错误报告。这些信息以MIB对象的形式提供给管理者。有关系统配置的信息由策略MIB通过在其他MIB模块中定义的MIB对象进行修改。

Details about the operational or configuration details of a system are retrieved by the manager via access to the specific MIB objects available in a network element. As such, the Policy MIB can use any

管理器通过访问网元中可用的特定MIB对象来检索系统的操作或配置详细信息。因此,策略MIB可以使用任何

standard or vendor-defined object that exists on a managed system. In particular, the Policy MIB may access standard or vendor specific objects that are instance-specific such as BGP timeout parameters and specific interface counters.

托管系统上存在的标准或供应商定义的对象。特别地,策略MIB可以访问特定于实例的标准或特定于供应商的对象,例如BGP超时参数和特定接口计数器。

13. Security Considerations
13. 安全考虑

This MIB contains no objects for which read access would disclose sensitive information.

此MIB不包含读访问会泄露敏感信息的对象。

There are a number of management objects defined in this MIB that have a MAX-ACCESS clause of read-write and/or read-create. Such objects may be considered sensitive or vulnerable in some network environments. The support for SET operations in a non-secure environment without proper protection can have a negative effect on network operations.

There are a number of management objects defined in this MIB that have a MAX-ACCESS clause of read-write and/or read-create. Such objects may be considered sensitive or vulnerable in some network environments. The support for SET operations in a non-secure environment without proper protection can have a negative effect on network operations.translate error, please retry

With the exception of pmPolicyDescription, pmPolicyDebugging, pmElementTypeRegDescription, and pmSchedDescr, EVERY read-create and read-write object in this MIB should be considered sensitive because if an unauthorized user could manipulate these objects, s/he could cause the Policy MIB system to use the stored credentials of an authorized user to perform unauthorized and potentially harmful operations.

除pmPolicyDescription、pmPolicyDebugging、pmElementTypeRegDescription和pmSchedDescr外,此MIB中的每个读创建和读写对象都应视为敏感对象,因为如果未经授权的用户可以操作这些对象,他/她可能会导致策略MIB系统使用已授权用户存储的凭据执行未经授权且可能有害的操作。

There are no read-only objects in this MIB that contain sensitive information.

此MIB中没有包含敏感信息的只读对象。

SNMP versions prior to SNMPv3 did not include adequate security. Even if the network itself is secure (for example by using IPSec), even then, there is no control as to who on the secure network is allowed to access and GET/SET (read/change/create/delete) the objects in this MIB module.

SNMPv3之前的SNMP版本未包含足够的安全性。即使网络本身是安全的(例如通过使用IPSec),即使如此,也无法控制安全网络上的谁可以访问和获取/设置(读取/更改/创建/删除)此MIB模块中的对象。

It is RECOMMENDED that implementers consider the security features as provided by the SNMPv3 framework (see [16], section 8), including full support for the SNMPv3 cryptographic mechanisms (for authentication and privacy).

建议实施者考虑SNMPv3框架提供的安全特性(见[ 16 ],第8节),包括对SNMPv3加密机制的完全支持(用于身份验证和隐私)。

Further, deployment of SNMP versions prior to SNMPv3 is NOT RECOMMENDED. Instead, it is RECOMMENDED to deploy SNMPv3 and to enable cryptographic security. It is then a customer/operator responsibility to ensure that the SNMP entity giving access to an instance of this MIB module is properly configured to give access to the objects only to those principals (users) that have legitimate rights to indeed GET or SET (change/create/delete) them.

此外,不建议部署SNMPv3之前的SNMP版本。相反,建议部署SNMPv3并启用加密安全性。然后,客户/运营商应负责确保授予访问此MIB模块实例权限的SNMP实体已正确配置为仅授予那些拥有确实获取或设置(更改/创建/删除)对象的合法权限的主体(用户)访问对象。

An implementation must ensure that access control rules are applied when SNMP operations are performed in policy scripts. To ensure this, an implementation must record and maintain the security credentials of the last entity to modify each policy's pmPolicyAdminStatus object. The credentials to store are the securityModel, securityName, and securityLevel and will be used as input parameters for isAccessAllowed from the Architecture for Describing SNMP Management Frameworks [1]. This mechanism was first introduced in the DISMAN-SCHEDULE-MIB [12].

实现必须确保在策略脚本中执行SNMP操作时应用访问控制规则。为了确保这一点,实现必须记录并维护最后一个实体的安全凭据,以修改每个策略的pmPolicyAdminStatus对象。要存储的凭据是securityModel、securityName和securityLevel,并将用作描述SNMP管理框架的体系结构所允许的ISACCESS的输入参数[1]。该机制首先在DISAN-SCHEDULE-MIB[12]中引入。

SNMP requests made when secModel, secName, and secLevel are specified use credentials stored in the local configuration datastore. Access to these credentials depends on the security credentials of the last entity to modify the policy's pmPolicyAdminStatus object. To determine whether the credentials can be accessed, the isAccessAllowed abstract service interface defined in RFC 3411 [1] is called:

指定secModel、secName和secLevel时发出的SNMP请求使用存储在本地配置数据存储中的凭据。对这些凭据的访问取决于要修改策略的pmPolicyAdminStatus对象的最后一个实体的安全凭据。为了确定是否可以访问凭据,调用RFC 3411[1]中定义的isAccessAllowed抽象服务接口:

statusInformation = -- success or errorIndication isAccessAllowed(

状态信息=--允许成功或错误指示(

        IN   securityModel         -- Security Model used
        IN   securityName          -- principal who wants to access
        IN   securityLevel         -- Level of Security used
        IN   viewType              -- write
        IN   contextName           -- context containing variableName
        IN   variableName          -- OID for an object in the proper
                                   -- LCD entry
             )
        
        IN   securityModel         -- Security Model used
        IN   securityName          -- principal who wants to access
        IN   securityLevel         -- Level of Security used
        IN   viewType              -- write
        IN   contextName           -- context containing variableName
        IN   variableName          -- OID for an object in the proper
                                   -- LCD entry
             )
        

The securityModel, securityName, and securityLevel parameters are set to the values that were recorded when the policy was modified. The viewType is set to write, and the contextName and variableName are set to select any read-create object in the appropriate LCD entry.

securityModel、securityName和securityLevel参数设置为修改策略时记录的值。viewType设置为write,contextName和variableName设置为在相应的LCD条目中选择任何读取创建对象。

Proper configuration of VACM requires that write access to an LCD entry not be given to entities that aren't authorized to use the credentials therein.

VACM的正确配置要求未经授权使用其中凭据的实体不得拥有对LCD条目的写访问权。

Access control for SNMP requests made to the local system where secModel, secName, and secLevel aren't specified depends on the security credentials of the last entity to modify the policy's pmPolicyAdminStatus object. To determine whether the operation should succeed, the isAccessAllowed abstract service interface defined in RFC 3411 [1] is called:

对未指定secModel、secName和secLevel的本地系统发出的SNMP请求的访问控制取决于要修改策略的pmPolicyAdminStatus对象的最后一个实体的安全凭据。为了确定操作是否应成功,调用RFC 3411[1]中定义的isAccessAllowed抽象服务接口:

      statusInformation =          -- success or errorIndication
        isAccessAllowed(
        IN   securityModel         -- Security Model in use
        IN   securityName          -- principal who wants to access
        IN   securityLevel         -- Level of Security
        IN   viewType              -- read, write, or notify view
        IN   contextName           -- context as specified
        IN   variableName          -- OID for the managed object
             )
        
      statusInformation =          -- success or errorIndication
        isAccessAllowed(
        IN   securityModel         -- Security Model in use
        IN   securityName          -- principal who wants to access
        IN   securityLevel         -- Level of Security
        IN   viewType              -- read, write, or notify view
        IN   contextName           -- context as specified
        IN   variableName          -- OID for the managed object
             )
        

The securityModel, securityName, and securityLevel parameters are set to the values that were recorded when the policy was modified. The viewType, contextName, and variableName parameters are set as appropriate for the requested SNMP operation.

securityModel、securityName和securityLevel参数设置为修改策略时记录的值。viewType、contextName和variableName参数根据请求的SNMP操作进行设置。

Unless all users who have write access to the pmPolicyTable and pmPolicyCodeTable have equivalent access to the managed system, policy scripts could be used by a user to gain the privileges of another user. Therefore, when policy users have different access, access control should be applied so that a user's policies cannot be modified by another user. To make this more convenient, a user can place all of his or her policies in the same pmPolicyAdminGroup so that a single access control view can apply to all of them.

除非对pmPolicyTable和pmPolicyCodeTable具有写访问权限的所有用户都具有对托管系统的同等访问权限,否则用户可以使用策略脚本来获得其他用户的权限。因此,当策略用户具有不同的访问权限时,应应用访问控制,以便其他用户不能修改用户的策略。为了方便起见,用户可以将其所有策略放在同一个pmPolicyAdminGroup中,以便一个访问控制视图可以应用于所有策略。

Some policies may be designed to ensure the security of a network. If these policies have not been installed pending the appearance of a role or capability, some delay will occur in their activation policies when the role or capability appears because a responsible manager must notice the change and install the policy. This delay may expose the device or the network to unacceptable security vulnerabilities during this delay. If the role or capability appears during a time of network stress or when the management station is unavailable, this delay could be extensive, further increasing the exposure. It is recommended that management stations install any security-related policies that might ever be needed on a particular managed device, even if a nonexistent role or capability suggests that it is not needed at a given time.

一些策略可以设计为确保网络的安全性。如果在角色或功能出现之前尚未安装这些策略,则当角色或功能出现时,这些策略的激活策略会出现一些延迟,因为责任经理必须注意到更改并安装策略。此延迟可能使设备或网络在此延迟期间暴露于不可接受的安全漏洞。如果角色或能力出现在网络压力期间或管理站不可用时,则此延迟可能会很长,从而进一步增加暴露。建议管理站安装特定受管设备上可能需要的任何安全相关策略,即使不存在的角色或功能表明在给定时间不需要该策略。

This MIB allows the delegation of access rights so that a user ("Joe") can instruct a Policy MIB agent to execute remote operations on his behalf that are authorized by keys stored by "Joe" into the usmUserTable. Care needs to be taken to ensure that unauthorized users are unable to configure their policies to use Joe's keys. Although there are theoretically many ways to configure SNMP security, users are advised to follow the most straightforward way outlined below to minimize complexity and the resulting opportunity for errors.

此MIB允许访问权限的委派,以便用户(“Joe”)可以指示策略MIB代理代表其执行远程操作,这些操作由“Joe”存储到usmUserTable中的密钥授权。需要注意确保未经授权的用户无法将其策略配置为使用Joe的密钥。尽管理论上有许多方法可以配置SNMP安全性,但建议用户遵循下面概述的最直接的方法,以最小化复杂性和由此产生的错误机会。

Assume that Joe has credentials that give him authority to manage agents A, B, and C, as well as the Policy MIB agent "P". Joe will store credentials for Joe@A, Joe@B, and Joe@C in the usmUserTable of the Policy MIB agent. Then the following VACM configuration will be used:

假设Joe拥有授权管理代理A、B和C以及策略MIB代理“P”的凭据。Joe将为其存储凭据Joe@A, Joe@B和Joe@C在策略MIB代理的usmUserTable中。然后将使用以下VACM配置:

VACM securityToGroupTable A single entry mapping user Joe@P to group JoesGroup

VACM securityToGroupTable A single entry mapping user Joe@P to group JoesGrouptranslate error, please retry

VACM accessTable A single entry mapping group JoesGroup to write view JoesView

VACM accessTable单个条目映射组JoesGroup到写入视图JoesView

VACM viewTreeFamilyTable ViewName Subtree Type JoesView points to Joe@A in usmUserTable included JoesView points to Joe@B in usmUserTable included JoesView points to Joe@C in usmUserTable included

VACM viewTreeFamilyTable ViewName子树类型JoesView指向Joe@A在usmUserTable中,包含JoesView指向Joe@B在usmUserTable中,包含JoesView指向Joe@C包括在usmUserTable中

In the preceding examples, the notation Joe@A represents the entry indexed by usmUserEngineID and usmUserName, where the SnmpEngineID is that of system A and the usmUserName is "Joe".

在前面的示例中,表示法Joe@A表示由usmUserEngineID和usmUserName索引的条目,其中SnmpEngineID是系统A的SnmpEngineID,usmUserName是“Joe”。

14. IANA Considerations
14. IANA考虑

This is a profile of stringprep. It has been registered by the IANA in the stringprep profile registry located at:

这是stringprep的简介。IANA已在stringprep配置文件注册表中注册,该注册表位于:

      http://www.iana.org/assignments/stringprep-profiles
        
      http://www.iana.org/assignments/stringprep-profiles
        

Name of this profile: Policy MIB Stringprep.

此配置文件的名称:策略MIB Stringprep。

RFC in which the profile is defined: This document.

定义概要文件的RFC:此文档。

Indicator whether this is the newest version of the profile:

指示此配置文件是否为最新版本:

This is the first version of Policy MIB Stringprep.

这是策略MIB Stringprep的第一个版本。

15. Acknowledgements
15. 致谢

The authors gratefully acknowledge the significant contributions to this work made by Jeff Case, Patrik Falstrom, Joel Halpern, Pablo Halpern, Bob Moore, Steve Moulton, David Partain, and Walter Weiss.

作者感谢Jeff Case、Patrik Falstrom、Joel Halpern、Pablo Halpern、Bob Moore、Steve Moulton、David Partain和Walter Weiss对这项工作做出的重大贡献。

This MIB uses a security delegation mechanism that was first introduced in the DISMAN-SCHEDULE-MIB [12]. The Schedule table of this MIB borrows heavily from the PolicyTimePeriodCondition of the Policy Core Information Model (PCIM) [18] and from the DISMAN-SCHEDULE-MIB [12].

该MIB使用了一种安全委派机制,该机制最初是在DISAN-SCHEDULE-MIB[12]中引入的。该MIB的时间表大量借用了Policy Core Information Model(PCIM)[18]的PolicyTimePeriod条件和DISAN-Schedule-MIB[12]。

16. References
16. 工具书类
16.1. Normative References
16.1. 规范性引用文件

[1] Harrington, D., Presuhn, R., and B. Wijnen, "An Architecture for Describing Simple Network Management Protocol (SNMP) Management Frameworks", STD 62, RFC 3411, December 2002.

[1] Harrington,D.,Presohn,R.,和B.Wijnen,“描述简单网络管理协议(SNMP)管理框架的体系结构”,STD 62,RFC 3411,2002年12月。

[2] McCloghrie, K., Perkins, D., and J. Schoenwaelder, "Structure of Management Information Version 2 (SMIv2)", STD 58, RFC 2578, April 1999.

[2] McCloghrie,K.,Perkins,D.,和J.Schoenwaeld,“管理信息的结构版本2(SMIv2)”,STD 58,RFC 2578,1999年4月。

[3] McCloghrie, K., Perkins, D., and J. Schoenwaelder, "Textual Conventions for SMIv2", STD 58, RFC 2579, April 1999.

[3] McCloghrie,K.,Perkins,D.,和J.Schoenwaeld,“SMIv2的文本约定”,STD 58,RFC 2579,1999年4月。

[4] McCloghrie, K., Perkins, D., and J. Schoenwaelder, "Conformance Statements for SMIv2", STD 58, RFC 2580, April 1999.

[4] McCloghrie, K., Perkins, D., and J. Schoenwaelder, "Conformance Statements for SMIv2", STD 58, RFC 2580, April 1999.translate error, please retry

[5] Presuhn, R., "Transport Mappings for the Simple Network Management Protocol (SNMP)", STD 62, RFC 3417, December 2002.

[5] Presohn,R.,“简单网络管理协议(SNMP)的传输映射”,STD 62,RFC 34172002年12月。

[6] Blumenthal, U. and B. Wijnen, "User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)", STD 62, RFC 3414, December 2002.

[6] Blumenthal,U.和B.Wijnen,“简单网络管理协议(SNMPv3)第3版的基于用户的安全模型(USM)”,STD 62,RFC 3414,2002年12月。

[7] Presuhn, R., "Version 2 of the Protocol Operations for the Simple Network Management Protocol (SNMP)", STD 62, RFC 3416, December 2002.

[7] Presohn,R.,“简单网络管理协议(SNMP)的协议操作第2版”,STD 62,RFC 3416,2002年12月。

[8] Frye, R., Levi, D., Routhier, S., and B. Wijnen, "Coexistence between Version 1, Version 2, and Version 3 of the Internet-standard Network Management Framework", BCP 74, RFC 3584, August 2003.

[8] Frye,R.,Levi,D.,Routhier,S.,和B.Wijnen,“互联网标准网络管理框架版本1,版本2和版本3之间的共存”,BCP 74,RFC 3584,2003年8月。

[9] Wijnen, B., Presuhn, R., and K. McCloghrie, "View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP)", STD 62, RFC 3415, December 2002.

[9] Wijnen,B.,Presuhn,R.,和K.McCloghrie,“用于简单网络管理协议(SNMP)的基于视图的访问控制模型(VACM)”,STD 62,RFC 3415,2002年12月。

   [10] International Standards Organization, "Information Technology -
        Programming Languages - C++", ISO/IEC 14882-1998
        
   [10] International Standards Organization, "Information Technology -
        Programming Languages - C++", ISO/IEC 14882-1998
        

[11] Daniele, M. and J. Schoenwaelder, "Textual Conventions for Transport Addresses", RFC 3419, December 2002.

[11] Daniele,M.和J.Schoenwaeld,“运输地址的文本约定”,RFC 3419,2002年12月。

[12] Levi, D. and J. Schoenwaelder, "Definitions of Managed Objects for Scheduling Management Operations", RFC 3231, January 2002.

[12] Levi,D.和J.Schoenwaeld,“调度管理操作的托管对象定义”,RFC 3231,2002年1月。

[13] Hoffman, P. and M. Blanchet, "Preparation of Internationalized Strings ("stringprep")", RFC 3454, December 2002.

[13] Hoffman,P.和M.Blanchet,“国际化弦的准备(“stringprep”)”,RFC 3454,2002年12月。

[14] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD 63, RFC 3629, November 2003.

[14] Yergeau,F.,“UTF-8,ISO 10646的转换格式”,STD 63,RFC 3629,2003年11月。

[15] Dawson, F. and D. Stenerson, "Internet Calendaring and Scheduling Core Object Specification (iCalendar)", RFC 2445, November 1998.

[15] Dawson,F.和D.Stenerson,“互联网日历和调度核心对象规范(iCalendar)”,RFC 24451998年11月。

16.2. Informative References
16.2. 资料性引用

[16] Case, J., Mundy, R., Partain, D., and B. Stewart, "Introduction and Applicability Statements for Internet-Standard Management Framework", RFC 3410, December 2002.

[16] Case,J.,Mundy,R.,Partain,D.,和B.Stewart,“互联网标准管理框架的介绍和适用性声明”,RFC 3410,2002年12月。

[17] ECMA, "ECMAScript Language Specification", ECMA-262, December 1999

[17] ECMA,“ECMAScript语言规范”,ECMA-262,1999年12月

[18] Moore, B., Ellesson, E., Strassner, J., and A. Westerinen, "Policy Core Information Model -- Version 1 Specification", RFC 3060, February 2001.

[18] Moore,B.,Ellesson,E.,Strassner,J.,和A.Westerinen,“策略核心信息模型——版本1规范”,RFC 3060,2001年2月。

[19] MacFaden, M., Partain, D., Saperia, J., and W. Tackabury, "Configuring Networks and Devices with Simple Network Management Protocol (SNMP)", RFC 3512, April 2003.

[19] MacFaden,M.,Partain,D.,Saperia,J.,和W.Tackabury,“使用简单网络管理协议(SNMP)配置网络和设备”,RFC 3512,2003年4月。

Author's Addresses

作者地址

Steve Waldbusser

史蒂夫·瓦尔德布瑟

   Phone: +1-650-948-6500
   Fax:   +1-650-745-0671
   EMail: waldbusser@nextbeacon.com
        
   Phone: +1-650-948-6500
   Fax:   +1-650-745-0671
   EMail: waldbusser@nextbeacon.com
        

Jon Saperia (WG Co-chair) JDS Consulting, Inc. 84 Kettell Plain Road. Stow MA 01775 USA

Jon Saperia(工作组联席主席)JDS咨询公司,凯特尔平原路84号。斯托马01775美国

   Phone: +1-978-461--0249
   Fax:   +1-617-249-0874
   EMail: saperia@jdscons.com
        
   Phone: +1-978-461--0249
   Fax:   +1-617-249-0874
   EMail: saperia@jdscons.com
        

Thippanna Hongal Riverstone Networks, Inc. 5200 Great America Parkway Santa Clara, CA, 95054 USA

Thippanna Hongal Riverstone Networks,Inc.美国加利福尼亚州圣克拉拉大美洲大道5200号,邮编95054

   Phone: +1-408-878-6562
   Fax:   +1-408-878-6501
   EMail: hongal@riverstonenet.com
        
   Phone: +1-408-878-6562
   Fax:   +1-408-878-6501
   EMail: hongal@riverstonenet.com
        

Full Copyright Statement

完整版权声明

Copyright (C) The Internet Society (2005).

版权所有(C)互联网协会(2005年)。

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

本文件受BCP 78中包含的权利、许可和限制的约束,除其中规定外,作者保留其所有权利。

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件及其包含的信息是按“原样”提供的,贡献者、他/她所代表或赞助的组织(如有)、互联网协会和互联网工程任务组不承担任何明示或暗示的担保,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。

Intellectual Property

知识产权

The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.

IETF对可能声称与本文件所述技术的实施或使用有关的任何知识产权或其他权利的有效性或范围,或此类权利下的任何许可可能或可能不可用的程度,不采取任何立场;它也不表示它已作出任何独立努力来确定任何此类权利。有关RFC文件中权利的程序信息,请参见BCP 78和BCP 79。

Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.

向IETF秘书处披露的知识产权副本和任何许可证保证,或本规范实施者或用户试图获得使用此类专有权利的一般许可证或许可的结果,可从IETF在线知识产权存储库获取,网址为http://www.ietf.org/ipr.

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.

IETF邀请任何相关方提请其注意任何版权、专利或专利申请,或其他可能涵盖实施本标准所需技术的专有权利。请将信息发送至IETF的IETF-ipr@ietf.org.

Acknowledgement

确认

Funding for the RFC Editor function is currently provided by the Internet Society.

Funding for the RFC Editor function is currently provided by the Internet Society.translate error, please retry