SNMP
SNMP 是广泛应用于以太网设备的网络管理标准协议, 用以监测主要网络设备(例如:服务器、路由器、交换机、防火墙等)的运行状态。 SNMP 使用以太网 UDP 模式通信,支持主动请求和事件通知两种方式。
网络接驳
支持网络管理的设备本身具备以太网接口,将其接入网络即可。 请查阅厂商手册启用并开启 SNMP 服务(SNMP Agent)。
SNMP 事件通知模式(Trap)可直接与云端服务器通信。 主动请求模式无法直接与云端服务器通信, 则需要通过 VPN 或通信换向技术实现。
通信配置
JOYZL SCADA SNMP 通信驱动采用 UDP 连接,分为主动轮询和被动接收通知两种。 采用主动轮询时具有足够的灵活性,可采集设备支持的任意 MIB 变量参数。 采用被动接收通知时仅能获取设备发出的变量参数(Trap)。
SNMP_V1_SLAVEJOYZL SCADA 作为从端(SLAVE) 主动发起请求到设备, 设备通信参数按如下方式进行设置。
- 驱动:SNMP_V1_SLAVE
- 接点:设备地址和端口(IP:PORT),例如 192.168.8.8:161
- 地址:未使用
- 密码:设置为团体名(Community),例如 public
JOYZL SCADA 作为从端(SLAVE) 主动发起请求到设备, 设备通信参数按如下方式进行设置。
- 驱动:SNMP_V2_SLAVE
- 接点:设备地址和端口(IP:PORT),例如 192.168.8.8:161
- 地址:未使用
- 密码:设置为团体名(Community),例如 public
JOYZL SCADA 作为主端(MASTER) 由设备主动发送通知,因此须在设备中设置发送的目标地址和端口; 设备通信参数按如下方式进行设置。
- 驱动:SNMP_V1_MASTER
- 接点:网络地址和端口(IP:PORT),缺省地址仅指定端口时,监听本机所有地址,例如 162
- 地址:设置为设备固定地址,例如 192.168.8.8,由地址区分设备,因此不能使用动态地址(DHCP)
JOYZL SCADA 作为主端(MASTER) 由设备主动发送通知,因此须在设备中设置发送的目标地址和端口; 设备通信参数按如下方式进行设置。
- 驱动:SNMP_V2_MASTER
- 接点:网络地址和端口(IP:PORT),缺省地址仅指定端口时,监听本机所有地址,例如 162
- 地址:设置为设备固定地址,例如 192.168.8.8,由地址区分设备,因此不能使用动态地址(DHCP)
数据配置
SNMP 采用 MIB 提供和维护数据项, 既有标准规范的 MIB 数据项, 也有各设备厂商自定义的数据项(请联系设备厂商获取)。
JOYZL SCADA 通过属性配置来对应需要采集的 MIB 数据项, 可在设备中配置任意数量且不重复(Code)的属性。 JOYZL SCADA 属性代码(Code)格式为:数据项的 OID, 数据项的数据类型和读写性质均参照 MIB 描述。
OID 采用无前导点 "." 的点分十进制表示法, 属性数据项的节点必须为绝对叶节点; 不支持数据项名称定位,例如 ifDescr.2。
例如:1.3.6.1.2.1.1.3.0 表示设备的 系统运行时间(sysUpTime), 数据值类型为整数,只读,单位1/100秒(TimeTicks), 由标准库 MIB-II(RFC 1213) 定义, OID 每段数值对应的层级结构为 iso(1).org(3).dod(6).internet(1).mgmt(2).mib-2(1) .system(1).sysUpTime(3).0 尾部的 .0 表示标量对象的实例(标量对象有且仅有一个实例)。
例如:1.3.6.1.2.1.2.2.1.8.2 表示设备的 网络接口状态(ifOperStatus), 数据值类型为整数,只读,值为:已连接 up(1)、未连接 down(2)、检查中 testing(3), 由标准库 MIB-II(RFC 1213) 定义, OID 每段数值对应的层级结构为 iso(1).org(3).dod(6).internet(1).mgmt(2).mib-2(1) .interfaces(2).ifTable(2).ifEntry(1).ifOperStatus(8).ifIndex(2) 尾部的 .ifIndex(2) 表示接口索引号从1开始编号,对应具体网络接口。
预定义属性: JOYZL SCADA 已预定义 MIB 标准库中常用的数据项, 配置时仅需要从中选择并添加所需的属性项即可。 表格类属性以样本提供,使用时须根据实际数量和索引增减或修订。
JOYZL SCADA 属性支持的数据类型请参考 数据类型表 。
标准规范
MIB-II 标准库
- MIB-II (RFC 1213) 网络设备公共基础 mib-2(1)
- 系统信息组 system(1)
- 接口信息及状态组 interfaces(2)
- 地址转换组 at(3)
- 网络统计组 ip(4)
- 网络控制统计组 icmp(5)
- 传输控制统计组 tcp(6)
- 用户数据报统计组 udp(7)
- 外部网关统计组 egp(8)
- 公共管理信息遗留组 cmot(9)
- 传输介质组 transmission(10)
- 管理统计组 snmp(11)
- HOST-RESOURCES-MIB (RFC 2790) 主机资源 host(25)
- 系统信息组 hrSystem(1)
- 存储状态组 hrStorage(2)
- 设备状态组 hrDevice(3)
- 运行软件组 hrSWRun(4)
- 运行性能组 hrSWRunPerf(5)
- 安装软件组 hrSWInstalled(6)
- 合规信息组 hrMIBAdminInfo(7)
- ENTITY-MIB(RFC 6933) 硬件实体 entity(47)
- 物理实体组 entityPhysical(1)
- 逻辑实体组 entityLogical(2)
- 关联关系组 entityMapping(3)
- 常规属性组 entityGeneral(4)
- ENTITY-STATE-MIB (RFC 4268) 硬件状态 state(130)
- ENTITY-SENSOR-MIB (RFC 3433) 传感器数据 sensors(99)
ENTITY-MIB(RFC 6933) 定义以下硬件类型
- 其它 other(1)
- 未知 unknown(2)
- 机箱 chassis(3)
- 背板 backplane(4)
- 容器(插槽) container(5)
- 电源 powerSupply(6)
- 风扇 fan(7)
- 传感器 sensor(8)
- 模块 module(9)
- 端口 port(10)
- 机箱堆栈 stack(11)
- 中央处理单元 cpu(12)
ENTITY-STATE-MIB (RFC 4268) 定义以下硬件状态
- 管理状态:未知 unknown(1)、锁定 locked(2)、当掉 shuttingDown(3)、可用 unlocked(4)
- 操作状态:未知 unknown(1)、禁用 disabled(2)、启用 enabled(3)、检测中 testing(4)
- 使用状态:未知 unknown(1)、空闲 idle(2)、活动 active(3)、繁忙 busy(4)
- 报警状态:未知 unknown(0)、维修 underRepair(1)、关键 critical(2)、重大 major(3)、轻微 minor(4)、警告 warning(5)、不确定等级 indeterminate(6)
- 待机状态:未知 unknown(1)、热备 hotStandby(2)、冷备 coldStandby(3)、服务中 providingService(4)
ENTITY-SENSOR-MIB (RFC 3433) 定义以下传感器类型
- 其它 other(1)
- 未知 unknown(2)
- 交流电压(伏特) voltsAC(3)
- 直流电压(伏特) voltsDC(4)
- 电流(安培) amperes(5)
- 功率(瓦特) watts(6)
- 频率(赫兹)hertz(7)
- 温度(摄氏度)celsius(8)
- 湿度(百分比相对湿度)percentRH(9)
- 转速(每分钟旋转次数)rpm(10)
- 气流(每分钟立方米) cmm(11)
- 真值(真/假)truthvalue(12)
遵循和参考的标准或规范:
ISO/IEC 8824-1 Information technology — Abstract Syntax Notation One (ASN.1) — Part 1: Specification of basic notation
ISO/IEC 8824-2 Information technology — Abstract Syntax Notation One (ASN.1) — Part 2: Information object specification
ISO/IEC 8824-3 Information technology — Abstract Syntax Notation One (ASN.1) — Part 3: Constraint specification
ISO/IEC 8824-4 Information technology — Abstract Syntax Notation One (ASN.1) — Part 4: Parameterization of ASN.1 specifications
ISO/IEC 8825-1 Information technology — ASN.1 encoding rules — Part 1: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)
ISO/IEC 8825-2 Information technology — ASN.1 encoding rules — Part 2: Specification of Packed Encoding Rules (PER)
ISO/IEC 8825-3 Information technology — ASN.1 encoding rules — Part 3: Specification of Encoding Control Notation (ECN)
ISO/IEC 8825-4 Information technology — ASN.1 encoding rules — Part 4: XML Encoding Rules (XER)
ISO/IEC 8825-5 Information technology — ASN.1 encoding rules — Part 5: Mapping W3C XML schema definitions into ASN.1
ISO/IEC 8825-6 Information technology — ASN.1 encoding rules — Part 6: Registration and application of PER encoding instructions
ISO/IEC 8825-7 Information technology — ASN.1 encoding rules — Part 7: Specification of Octet Encoding Rules (OER)
ISO/IEC 8825-8 Information technology — ASN.1 encoding rules — Part 8: Specification of JavaScript Object Notation Encoding Rules (JER)
RFC 1089 SNMP over Ethernet
RFC 1098 Simple Network Management Protocol (SNMP)
RFC 1157 Simple Network Management Protocol (SNMP)
RFC 1161 SNMP over OSI
RFC 1162 Connectionless Network Protocol (ISO 8473) and End System to Intermediate System (ISO 9542) Management Information Base
RFC 1187 Bulk Table Retrieval with the SNMP
RFC 1212 Concise MIB definitions
RFC 1213 Management Information Base for Network Management of TCP/IP-based internets: MIB-II
RFC 1215 Convention for defining traps for use with the SNMP
RFC 1227 SNMP MUX protocol and MIB
RFC 1228 SNMP-DPI: Simple Network Management Protocol Distributed Program Interface
RFC 1229 Extensions to the generic-interface MIB
RFC 1230 IEEE 802.4 Token Bus MIB
RFC 1231 IEEE 802.5 Token Ring MIB
RFC 1232 Definitions of managed objects for the DS1 Interface type
RFC 1233 Definitions of managed objects for the DS3 Interface type
RFC 1270 SNMP Communications Services
RFC 1283 SNMP over OSI
RFC 1284 Definitions of Managed Objects for the Ethernet-like Interface Types
RFC 1298 SNMP over IPX
RFC 1303 A Convention for Describing SNMP-based Agents
RFC 1304 Definitions of Managed Objects for the SIP Interface Type
RFC 1351 SNMP Administrative Model
RFC 1352 SNMP Security Protocols
RFC 1353 Definitions of Managed Objects for Administration of SNMP Parties
RFC 1381 SNMP MIB Extension for X.25 LAPB
RFC 1382 SNMP MIB Extension for the X.25 Packet Layer
RFC 1418 SNMP over OSI
RFC 1419 SNMP over AppleTalk
RFC 1420 SNMP over IPX
RFC 1441 Introduction to version 2 of the Internet-standard Network Management Framework
RFC 1442 Structure of Management Information for version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1443 Textual Conventions for version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1444 Conformance Statements for version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1445 Administrative Model for version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1446 Security Protocols for version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1447 Party MIB for version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1448 Protocol Operations for version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1449 Transport Mappings for version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1450 Management Information Base for version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1451 Manager-to-Manager Management Information Base
RFC 1452 Coexistence between version 1 and version 2 of the Internet-standard Network Management Framework
RFC 1461 SNMP MIB extension for Multiprotocol Interconnect over X.25
RFC 1503 Algorithms for Automating Administration in SNMPv2 Managers
RFC 1901 Introduction to Community-based SNMPv2
RFC 1902 Structure of Management Information for Version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1903 Textual Conventions for Version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1904 Conformance Statements for Version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1905 Protocol Operations for Version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1906 Transport Mappings for Version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1907 Management Information Base for Version 2 of the Simple Network Management Protocol (SNMPv2)
RFC 1908 Coexistence between Version 1 and Version 2 of the Internet-standard Network Management Framework
RFC 1909 An Administrative Infrastructure for SNMPv2
RFC 1910 User-based Security Model for SNMPv2
RFC 2011 SNMPv2 Management Information Base for the Internet Protocol using SMIv2
RFC 2012 SNMPv2 Management Information Base for the Transmission Control Protocol using SMIv2
RFC 2013 SNMPv2 Management Information Base for the User Datagram Protocol using SMIv2
RFC 2089 V2ToV1 Mapping SNMPv2 onto SNMPv1 within a bi-lingual SNMP agent
RFC 2127 ISDN Management Information Base using SMIv2
RFC 2261 An Architecture for Describing SNMP Management Frameworks
RFC 2262 Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)
RFC 2263 SNMPv3 Applications
RFC 2264 User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)
RFC 2265 View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP)
RFC 2271 An Architecture for Describing SNMP Management Frameworks
RFC 2272 Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)
RFC 2273 SNMPv3 Applications
RFC 2274 User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)
RFC 2275 View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP)
RFC 2570 Introduction to Version 3 of the Internet-standard Network Management Framework
RFC 2571 An Architecture for Describing SNMP Management Frameworks
RFC 2572 Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)
RFC 2573 SNMP Applications
RFC 2574 User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)
RFC 2575 View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP)
RFC 2576 Coexistence between Version 1, Version 2, and Version 3 of the Internet-standard Network Management Framework
RFC 2742 Definitions of Managed Objects for Extensible SNMP Agents
RFC 2786 Diffie-Helman USM Key Management Information Base and Textual Convention
RFC 2962 An SNMP Application Level Gateway for Payload Address Translation
RFC 3410 Introduction and Applicability Statements for Internet-Standard Management Framework
RFC 3411 An Architecture for Describing Simple Network Management Protocol (SNMP) Management Frameworks
RFC 3412 Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)
RFC 3413 Simple Network Management Protocol (SNMP) Applications
RFC 3414 User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)
RFC 3415 View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP)
RFC 3416 Version 2 of the Protocol Operations for the Simple Network Management Protocol (SNMP)
RFC 3417 Transport Mappings for the Simple Network Management Protocol (SNMP)
RFC 3418 Management Information Base (MIB) for the Simple Network Management Protocol (SNMP)
RFC 3430 Simple Network Management Protocol Over Transmission Control Protocol Transport Mapping
RFC 3512 Configuring Networks and Devices with Simple Network Management Protocol (SNMP)
RFC 3584 Coexistence between Version 1, Version 2, and Version 3 of the Internet-standard Network Management Framework
RFC 3747 The Differentiated Services Configuration MIB
RFC 3781 Next Generation Structure of Management Information (SMIng) Mappings to the Simple Network Management Protocol (SNMP)
RFC 3826 The Advanced Encryption Standard (AES) Cipher Algorithm in the SNMP User-based Security Model
RFC 4011 Policy Based Management MIB
RFC 4088 Uniform Resource Identifier (URI) Scheme for the Simple Network Management Protocol (SNMP)
RFC 4789 Simple Network Management Protocol (SNMP) over IEEE 802 Networks
RFC 5343 Simple Network Management Protocol (SNMP) Context EngineID Discovery
RFC 5345 Simple Network Management Protocol (SNMP) Traffic Measurements and Trace Exchange Formats
RFC 5590 Transport Subsystem for the Simple Network Management Protocol (SNMP)
RFC 5591 Transport Security Model for the Simple Network Management Protocol (SNMP)
RFC 5592 Secure Shell Transport Model for the Simple Network Management Protocol (SNMP)
RFC 5608 Remote Authentication Dial-In User Service (RADIUS) Usage for Simple Network Management Protocol (SNMP) Transport Models
RFC 5675 Mapping Simple Network Management Protocol (SNMP) Notifications to SYSLOG Messages
RFC 5676 Definitions of Managed Objects for Mapping SYSLOG Messages to Simple Network Management Protocol (SNMP) Notifications
RFC 5935 Expressing SNMP SMI Datatypes in XML Schema Definition Language
RFC 5953 Transport Layer Security (TLS) Transport Model for the Simple Network Management Protocol (SNMP)
RFC 6353 Transport Layer Security (TLS) Transport Model for the Simple Network Management Protocol (SNMP)
RFC 7407 A YANG Data Model for SNMP Configuration
RFC 7630 HMAC-SHA-2 Authentication Protocols in the User-based Security Model (USM) for SNMPv3
RFC 7860 HMAC-SHA-2 Authentication Protocols in User-Based Security Model (USM) for SNMPv3
RFC 9456 Updates to the TLS Transport Model for SNMP