说明
由于时间有限,本人精力有限,所以给出的网关MIB结构,并非完美! 本文网关MIB结构的结构定义构思在使用MIB builder自定义物联网网关的MIB结构 欢迎小伙伴,点赞、关注和评论!
参考代码
--
-- IOTGATEWAY-MIB.my
-- MIB generated by MG-SOFT Visual MIB Builder Version 6.0 Build 88
-- Tuesday, December 19 , 2023 at 20 :04:38
--IOTGATEWAY-MIB DEFINITIONS ::= BEGINIMPORTSOBJECT-GROUP, NOTIFICATION-GROUP FROM SNMPv2-CONF enterprises, TimeTicks, IpAddress, Integer32, Gauge32, Counter32, OBJECT-TYPE, MODULE-IDENTITY, OBJECT-IDENTITY, NOTIFICATION-TYPE FROM SNMPv2-SMI; -- 1.3 .6.1.4.1.99999.1.1iotGateway MODULE-IDENTITY LAST-UPDATED "202312061422Z" -- December 06, 2023 at 14 :22 GMTORGANIZATION "yangzhou" CONTACT-INFO "Contact Information" DESCRIPTION "MIB for managing IoT Gateway devices." REVISION "202312061425Z" -- December 06, 2023 at 14 :25 GMTDESCRIPTION "Initial version." ::= { iotGatewayMIB 1 } --
-- Node definitions
---- 1.3 .6.1.4.1.99999yangzhouzhang OBJECT IDENTIFIER ::= { enterprises 99999 } -- 1.3 .6.1.4.1.99999.1iotGatewayMIB OBJECT IDENTIFIER ::= { yangzhouzhang 1 } -- 1.3 .6.1.4.1.99999.1.3deviceInfoGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 3 } -- 1.3 .6.1.4.1.99999.1.3.1deviceModel OBJECT-TYPESYNTAX OCTET STRINGMAX-ACCESS read-onlySTATUS currentDESCRIPTION"The model identifier for the IoT Gateway." ::= { deviceInfoGroup 1 } -- 1.3 .6.1.4.1.99999.1.3.2deviceName OBJECT-TYPESYNTAX OCTET STRING ( SIZE ( 0 .. 255 )) MAX-ACCESS read-writeSTATUS currentDESCRIPTION"Name of the gateway device" ::= { deviceInfoGroup 2 } -- 1.3 .6.1.4.1.99999.1.3.4serialNumber OBJECT-TYPESYNTAX OCTET STRINGMAX-ACCESS read-onlySTATUS currentDESCRIPTION"The serial number of the IoT Gateway." ::= { deviceInfoGroup 4 } -- 1.3 .6.1.4.1.99999.1.3.5firmwareVersion OBJECT-TYPESYNTAX OCTET STRINGMAX-ACCESS read-onlySTATUS currentDESCRIPTION"Description." ::= { deviceInfoGroup 5 } -- 1.3 .6.1.4.1.99999.1.3.6uptime OBJECT-TYPESYNTAX TimeTicksMAX-ACCESS read-onlySTATUS currentDESCRIPTION"The time since the IoT Gateway last restarted." ::= { deviceInfoGroup 6 } -- 1.3 .6.1.4.1.99999.1.3.7devInfoGroup OBJECT-GROUPOBJECTS { deviceModel, deviceName, serialNumber, firmwareVersion, uptime } STATUS currentDESCRIPTION "Description." ::= { deviceInfoGroup 7 } -- 1.3 .6.1.4.1.99999.1.5networkConfigGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 5 } -- 1.3 .6.1.4.1.99999.1.5.1ipAddress OBJECT-TYPESYNTAX IpAddressMAX-ACCESS read-writeSTATUS currentDESCRIPTION"IP address of the gateway" ::= { networkConfigGroup 1 } -- 1.3 .6.1.4.1.99999.1.5.2subnetMask OBJECT-TYPESYNTAX IpAddressMAX-ACCESS read-writeSTATUS currentDESCRIPTION"Subnet mask of the gateway" ::= { networkConfigGroup 2 } -- 1.3 .6.1.4.1.99999.1.5.3defaultGateway OBJECT-TYPESYNTAX IpAddressMAX-ACCESS read-writeSTATUS currentDESCRIPTION"Default gateway IP address" ::= { networkConfigGroup 3 } -- 1.3 .6.1.4.1.99999.1.5.4dnsServers OBJECT-TYPESYNTAX OCTET STRING ( SIZE ( 0 .. 255 )) MAX-ACCESS read-writeSTATUS currentDESCRIPTION"List of DNS server IP addresses" ::= { networkConfigGroup 4 } -- 1.3 .6.1.4.1.99999.1.5.5ntpServer OBJECT-TYPESYNTAX IpAddressMAX-ACCESS read-writeSTATUS currentDESCRIPTION"NTP server IP address" ::= { networkConfigGroup 5 } -- 1.3 .6.1.4.1.99999.1.5.6netConfigGroup OBJECT-GROUPOBJECTS { ipAddress, subnetMask, defaultGateway, dnsServers, ntpServer} STATUS currentDESCRIPTION "Description." ::= { networkConfigGroup 6 } -- 1.3 .6.1.4.1.99999.1.8devicePerformanceGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 8 } -- 1.3 .6.1.4.1.99999.1.8.1dataThroughput OBJECT-TYPESYNTAX Integer32MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Data throughput in bytes per second" ::= { devicePerformanceGroup 1 } -- 1.3 .6.1.4.1.99999.1.8.2packetLossRate OBJECT-TYPESYNTAX Integer32 ( 0 .. 100 ) MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Packet loss rate in percentage" ::= { devicePerformanceGroup 2 } -- 1.3 .6.1.4.1.99999.1.8.3responseTime OBJECT-TYPESYNTAX Integer32UNITS "milliseconds" MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Response time in milliseconds" ::= { devicePerformanceGroup 3 } -- 1.3 .6.1.4.1.99999.1.8.4deviceTemperature OBJECT-TYPESYNTAX Integer32 ( -50.. 100 ) UNITS "degrees Celsiu" MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Device temperature in degrees Celsius" ::= { devicePerformanceGroup 4 } -- 1.3 .6.1.4.1.99999.1.8.5devPerformanceGroup OBJECT-GROUPOBJECTS { dataThroughput, packetLossRate, responseTime, deviceTemperature } STATUS currentDESCRIPTION "Description." ::= { devicePerformanceGroup 5 } -- 1.3 .6.1.4.1.99999.1.11eventsAndAlarmsGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 11 } -- 1.3 .6.1.4.1.99999.1.11.2currentActiveAlarms OBJECT-TYPESYNTAX Gauge32MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Number of current active alarms" ::= { eventsAndAlarmsGroup 2 } -- 1.3 .6.1.4.1.99999.1.11.3historicalAlarmsRecord OBJECT-TYPESYNTAX OCTET STRINGMAX-ACCESS read-onlySTATUS currentDESCRIPTION"Historical alarms record" ::= { eventsAndAlarmsGroup 3 } -- 1.3 .6.1.4.1.99999.1.11.4eventLog OBJECT-TYPESYNTAX OCTET STRINGMAX-ACCESS read-onlySTATUS currentDESCRIPTION"Event log" ::= { eventsAndAlarmsGroup 4 } -- 1.3 .6.1.4.1.99999.1.11.5evAndAlaGroup OBJECT-GROUPOBJECTS { eventLog, historicalAlarmsRecord, currentActiveAlarms } STATUS currentDESCRIPTION "Description." ::= { eventsAndAlarmsGroup 5 } -- 1.3 .6.1.4.1.99999.1.12connectedDevicesGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 12 } -- 1.3 .6.1.4.1.99999.1.12.1connectedDevicesTable OBJECT-TYPESYNTAX SEQUENCE OF ConnectedDevicesEntryMAX-ACCESS not-accessibleSTATUS currentDESCRIPTION"Table of connected devices information" ::= { connectedDevicesGroup 1 } -- 1.3 .6.1.4.1.99999.1.12.1.1connectedDevicesEntry OBJECT-TYPESYNTAX ConnectedDevicesEntryMAX-ACCESS not-accessibleSTATUS currentDESCRIPTION"Connected device entry" INDEX { deviceId } ::= { connectedDevicesTable 1 } ConnectedDevicesEntry ::= SEQUENCE { connectedDevicesCountCounter32,deviceIdInteger32,deviceStatusOCTET STRING,networkStatsOCTET STRING} -- 1.3 .6.1.4.1.99999.1.12.1.1.1connectedDevicesCount OBJECT-TYPESYNTAX Counter32MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Description." ::= { connectedDevicesEntry 1 } -- 1.3 .6.1.4.1.99999.1.12.1.1.2deviceId OBJECT-TYPESYNTAX Integer32 ( 1 .. 25535 ) MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Device ID" ::= { connectedDevicesEntry 2 } -- 1.3 .6.1.4.1.99999.1.12.1.1.3deviceStatus OBJECT-TYPESYNTAX OCTET STRING ( SIZE ( 0 .. 255 )) MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Device status information" ::= { connectedDevicesEntry 3 } -- 1.3 .6.1.4.1.99999.1.12.1.1.4networkStats OBJECT-TYPESYNTAX OCTET STRINGMAX-ACCESS read-onlySTATUS currentDESCRIPTION"Description." ::= { connectedDevicesEntry 4 } -- 1.3 .6.1.4.1.99999.1.12.2connDevicesGrouup OBJECT-GROUPOBJECTS { connectedDevicesCount, deviceId, deviceStatus, networkStats } STATUS currentDESCRIPTION "Description." ::= { connectedDevicesGroup 2 } -- 1.3 .6.1.4.1.99999.1.13deviceStatusGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 13 } -- 1.3 .6.1.4.1.99999.1.13.1deviceStatusTable OBJECT-TYPESYNTAX SEQUENCE OF DeviceStatusEntryMAX-ACCESS not-accessibleSTATUS currentDESCRIPTION"Table of device status information" ::= { deviceStatusGroup 1 } -- 1.3 .6.1.4.1.99999.1.13.1.1deviceStatusEntry OBJECT-TYPESYNTAX DeviceStatusEntryMAX-ACCESS not-accessibleSTATUS currentDESCRIPTION"Device status entry" INDEX { deviceStatusIndex } ::= { deviceStatusTable 1 } DeviceStatusEntry ::= SEQUENCE { deviceStatusIndexInteger32,cpuUtilizationInteger32,memoryUtilizationInteger32,storageUtilizationInteger32,statusDescriptionOCTET STRING} -- 1.3 .6.1.4.1.99999.1.13.1.1.1deviceStatusIndex OBJECT-TYPESYNTAX Integer32 ( 1 .. 100 ) MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Index for device status entry" ::= { deviceStatusEntry 1 } -- 1.3 .6.1.4.1.99999.1.13.1.1.2cpuUtilization OBJECT-TYPESYNTAX Integer32 ( 0 .. 100 ) MAX-ACCESS read-onlySTATUS currentDESCRIPTION"CPU utilization percentage" ::= { deviceStatusEntry 2 } -- 1.3 .6.1.4.1.99999.1.13.1.1.3memoryUtilization OBJECT-TYPESYNTAX Integer32 ( 0 .. 100 ) MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Memory utilization percentage" ::= { deviceStatusEntry 3 } -- 1.3 .6.1.4.1.99999.1.13.1.1.4storageUtilization OBJECT-TYPESYNTAX Integer32 ( 0 .. 100 ) MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Storage utilization percentage" ::= { deviceStatusEntry 4 } -- 1.3 .6.1.4.1.99999.1.13.1.1.6statusDescription OBJECT-TYPESYNTAX OCTET STRING ( SIZE ( 0 .. 255 )) MAX-ACCESS read-onlySTATUS currentDESCRIPTION"Description of the device status" ::= { deviceStatusEntry 6 } -- 1.3 .6.1.4.1.99999.1.13.2devStatusGroup OBJECT-GROUPOBJECTS { cpuUtilization, memoryUtilization, storageUtilization, statusDescription, deviceStatusIndex} STATUS currentDESCRIPTION "Description." ::= { deviceStatusGroup 2 } -- 1.3 .6.1.4.1.99999.1.14iotGatewayTrapGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 14 } -- 1.3 .6.1.4.1.99999.1.14.1iotGatewayTraps OBJECT-IDENTITYSTATUS currentDESCRIPTION "Description." ::= { iotGatewayTrapGroup 1 } -- 1.3 .6.1.4.1.99999.1.14.1.1iotGatewayHighCpuUsage NOTIFICATION-TYPEOBJECTS { cpuUtilization } STATUS currentDESCRIPTION "This trap is sent when the CPU usage exceeds a predefined threshold." ::= { iotGatewayTraps 1 } -- 1.3 .6.1.4.1.99999.1.14.3iotTrapGroup NOTIFICATION-GROUPNOTIFICATIONS { iotGatewayHighCpuUsage } STATUS currentDESCRIPTION "Description." ::= { iotGatewayTrapGroup 3 } END--
-- IOTGATEWAY-MIB.my
--
开源项目地址