自定义通用物联网网关的MIB结构的参考

2023-12-19 21:39:21

说明

参考代码

--
-- 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 ::= BEGIN
 
		IMPORTS
			OBJECT-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.1
		iotGateway MODULE-IDENTITY 
			LAST-UPDATED "202312061422Z"		-- December 06, 2023 at 14:22 GMT
			ORGANIZATION 
				"yangzhou"
			CONTACT-INFO 
				"Contact Information"
			DESCRIPTION 
				"MIB for managing IoT Gateway devices."
			REVISION "202312061425Z"		-- December 06, 2023 at 14:25 GMT
			DESCRIPTION 
				"Initial version."
			::= { iotGatewayMIB 1 }

		
	
--
-- Node definitions
--
	
		-- 1.3.6.1.4.1.99999
		yangzhouzhang OBJECT IDENTIFIER ::= { enterprises 99999 }

		
		-- 1.3.6.1.4.1.99999.1
		iotGatewayMIB OBJECT IDENTIFIER ::= { yangzhouzhang 1 }

		
		-- 1.3.6.1.4.1.99999.1.3
		deviceInfoGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 3 }

		
		-- 1.3.6.1.4.1.99999.1.3.1
		deviceModel OBJECT-TYPE
			SYNTAX OCTET STRING
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"The model identifier for the IoT Gateway."
			::= { deviceInfoGroup 1 }

		
		-- 1.3.6.1.4.1.99999.1.3.2
		deviceName OBJECT-TYPE
			SYNTAX OCTET STRING (SIZE (0..255))
			MAX-ACCESS read-write
			STATUS current
			DESCRIPTION
				"Name of the gateway device"
			::= { deviceInfoGroup 2 }

		
		-- 1.3.6.1.4.1.99999.1.3.4
		serialNumber OBJECT-TYPE
			SYNTAX OCTET STRING
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"The serial number of the IoT Gateway."
			::= { deviceInfoGroup 4 }

		
		-- 1.3.6.1.4.1.99999.1.3.5
		firmwareVersion OBJECT-TYPE
			SYNTAX OCTET STRING
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Description."
			::= { deviceInfoGroup 5 }

		
		-- 1.3.6.1.4.1.99999.1.3.6
		uptime OBJECT-TYPE
			SYNTAX TimeTicks
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"The time since the IoT Gateway last restarted."
			::= { deviceInfoGroup 6 }

		
		-- 1.3.6.1.4.1.99999.1.3.7
		devInfoGroup OBJECT-GROUP
			OBJECTS { deviceModel, deviceName, serialNumber, firmwareVersion, uptime
				 }
			STATUS current
			DESCRIPTION 
				"Description."
			::= { deviceInfoGroup 7 }

		
		-- 1.3.6.1.4.1.99999.1.5
		networkConfigGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 5 }

		
		-- 1.3.6.1.4.1.99999.1.5.1
		ipAddress OBJECT-TYPE
			SYNTAX IpAddress
			MAX-ACCESS read-write
			STATUS current
			DESCRIPTION
				"IP address of the gateway"
			::= { networkConfigGroup 1 }

		
		-- 1.3.6.1.4.1.99999.1.5.2
		subnetMask OBJECT-TYPE
			SYNTAX IpAddress
			MAX-ACCESS read-write
			STATUS current
			DESCRIPTION
				"Subnet mask of the gateway"
			::= { networkConfigGroup 2 }

		
		-- 1.3.6.1.4.1.99999.1.5.3
		defaultGateway OBJECT-TYPE
			SYNTAX IpAddress
			MAX-ACCESS read-write
			STATUS current
			DESCRIPTION
				"Default gateway IP address"
			::= { networkConfigGroup 3 }

		
		-- 1.3.6.1.4.1.99999.1.5.4
		dnsServers OBJECT-TYPE
			SYNTAX OCTET STRING (SIZE (0..255))
			MAX-ACCESS read-write
			STATUS current
			DESCRIPTION
				"List of DNS server IP addresses"
			::= { networkConfigGroup 4 }

		
		-- 1.3.6.1.4.1.99999.1.5.5
		ntpServer OBJECT-TYPE
			SYNTAX IpAddress
			MAX-ACCESS read-write
			STATUS current
			DESCRIPTION
				"NTP server IP address"
			::= { networkConfigGroup 5 }

		
		-- 1.3.6.1.4.1.99999.1.5.6
		netConfigGroup OBJECT-GROUP
			OBJECTS { ipAddress, subnetMask, defaultGateway, dnsServers, ntpServer
				 }
			STATUS current
			DESCRIPTION 
				"Description."
			::= { networkConfigGroup 6 }

		
		-- 1.3.6.1.4.1.99999.1.8
		devicePerformanceGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 8 }

		
		-- 1.3.6.1.4.1.99999.1.8.1
		dataThroughput OBJECT-TYPE
			SYNTAX Integer32
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Data throughput in bytes per second"
			::= { devicePerformanceGroup 1 }

		
		-- 1.3.6.1.4.1.99999.1.8.2
		packetLossRate OBJECT-TYPE
			SYNTAX Integer32 (0..100)
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Packet loss rate in percentage"
			::= { devicePerformanceGroup 2 }

		
		-- 1.3.6.1.4.1.99999.1.8.3
		responseTime OBJECT-TYPE
			SYNTAX Integer32
			UNITS "milliseconds"
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Response time in milliseconds"
			::= { devicePerformanceGroup 3 }

		
		-- 1.3.6.1.4.1.99999.1.8.4
		deviceTemperature OBJECT-TYPE
			SYNTAX Integer32 (-50..100)
			UNITS "degrees Celsiu"
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Device temperature in degrees Celsius"
			::= { devicePerformanceGroup 4 }

		
		-- 1.3.6.1.4.1.99999.1.8.5
		devPerformanceGroup OBJECT-GROUP
			OBJECTS { dataThroughput, packetLossRate, responseTime, deviceTemperature }
			STATUS current
			DESCRIPTION 
				"Description."
			::= { devicePerformanceGroup 5 }

		
		-- 1.3.6.1.4.1.99999.1.11
		eventsAndAlarmsGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 11 }

		
		-- 1.3.6.1.4.1.99999.1.11.2
		currentActiveAlarms OBJECT-TYPE
			SYNTAX Gauge32
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Number of current active alarms"
			::= { eventsAndAlarmsGroup 2 }

		
		-- 1.3.6.1.4.1.99999.1.11.3
		historicalAlarmsRecord OBJECT-TYPE
			SYNTAX OCTET STRING
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Historical alarms record"
			::= { eventsAndAlarmsGroup 3 }

		
		-- 1.3.6.1.4.1.99999.1.11.4
		eventLog OBJECT-TYPE
			SYNTAX OCTET STRING
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Event log"
			::= { eventsAndAlarmsGroup 4 }

		
		-- 1.3.6.1.4.1.99999.1.11.5
		evAndAlaGroup OBJECT-GROUP
			OBJECTS { eventLog, historicalAlarmsRecord, currentActiveAlarms }
			STATUS current
			DESCRIPTION 
				"Description."
			::= { eventsAndAlarmsGroup 5 }

		
		-- 1.3.6.1.4.1.99999.1.12
		connectedDevicesGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 12 }

		
		-- 1.3.6.1.4.1.99999.1.12.1
		connectedDevicesTable OBJECT-TYPE
			SYNTAX SEQUENCE OF ConnectedDevicesEntry
			MAX-ACCESS not-accessible
			STATUS current
			DESCRIPTION
				"Table of connected devices information"
			::= { connectedDevicesGroup 1 }

		
		-- 1.3.6.1.4.1.99999.1.12.1.1
		connectedDevicesEntry OBJECT-TYPE
			SYNTAX ConnectedDevicesEntry
			MAX-ACCESS not-accessible
			STATUS current
			DESCRIPTION
				"Connected device entry"
			INDEX { deviceId }
			::= { connectedDevicesTable 1 }

		
		ConnectedDevicesEntry ::=
			SEQUENCE { 
				connectedDevicesCount
					Counter32,
				deviceId
					Integer32,
				deviceStatus
					OCTET STRING,
				networkStats
					OCTET STRING
			 }

		-- 1.3.6.1.4.1.99999.1.12.1.1.1
		connectedDevicesCount OBJECT-TYPE
			SYNTAX Counter32
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Description."
			::= { connectedDevicesEntry 1 }

		
		-- 1.3.6.1.4.1.99999.1.12.1.1.2
		deviceId OBJECT-TYPE
			SYNTAX Integer32 (1..25535)
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Device ID"
			::= { connectedDevicesEntry 2 }

		
		-- 1.3.6.1.4.1.99999.1.12.1.1.3
		deviceStatus OBJECT-TYPE
			SYNTAX OCTET STRING (SIZE (0..255))
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Device status information"
			::= { connectedDevicesEntry 3 }

		
		-- 1.3.6.1.4.1.99999.1.12.1.1.4
		networkStats OBJECT-TYPE
			SYNTAX OCTET STRING
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Description."
			::= { connectedDevicesEntry 4 }

		
		-- 1.3.6.1.4.1.99999.1.12.2
		connDevicesGrouup OBJECT-GROUP
			OBJECTS { connectedDevicesCount, deviceId, deviceStatus, networkStats }
			STATUS current
			DESCRIPTION 
				"Description."
			::= { connectedDevicesGroup 2 }

		
		-- 1.3.6.1.4.1.99999.1.13
		deviceStatusGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 13 }

		
		-- 1.3.6.1.4.1.99999.1.13.1
		deviceStatusTable OBJECT-TYPE
			SYNTAX SEQUENCE OF DeviceStatusEntry
			MAX-ACCESS not-accessible
			STATUS current
			DESCRIPTION
				"Table of device status information"
			::= { deviceStatusGroup 1 }

		
		-- 1.3.6.1.4.1.99999.1.13.1.1
		deviceStatusEntry OBJECT-TYPE
			SYNTAX DeviceStatusEntry
			MAX-ACCESS not-accessible
			STATUS current
			DESCRIPTION
				"Device status entry"
			INDEX { deviceStatusIndex }
			::= { deviceStatusTable 1 }

		
		DeviceStatusEntry ::=
			SEQUENCE { 
				deviceStatusIndex
					Integer32,
				cpuUtilization
					Integer32,
				memoryUtilization
					Integer32,
				storageUtilization
					Integer32,
				statusDescription
					OCTET STRING
			 }

		-- 1.3.6.1.4.1.99999.1.13.1.1.1
		deviceStatusIndex OBJECT-TYPE
			SYNTAX Integer32 (1..100)
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Index for device status entry"
			::= { deviceStatusEntry 1 }

		
		-- 1.3.6.1.4.1.99999.1.13.1.1.2
		cpuUtilization OBJECT-TYPE
			SYNTAX Integer32 (0..100)
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"CPU utilization percentage"
			::= { deviceStatusEntry 2 }

		
		-- 1.3.6.1.4.1.99999.1.13.1.1.3
		memoryUtilization OBJECT-TYPE
			SYNTAX Integer32 (0..100)
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Memory utilization percentage"
			::= { deviceStatusEntry 3 }

		
		-- 1.3.6.1.4.1.99999.1.13.1.1.4
		storageUtilization OBJECT-TYPE
			SYNTAX Integer32 (0..100)
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Storage utilization percentage"
			::= { deviceStatusEntry 4 }

		
		-- 1.3.6.1.4.1.99999.1.13.1.1.6
		statusDescription OBJECT-TYPE
			SYNTAX OCTET STRING (SIZE (0..255))
			MAX-ACCESS read-only
			STATUS current
			DESCRIPTION
				"Description of the device status"
			::= { deviceStatusEntry 6 }

		
		-- 1.3.6.1.4.1.99999.1.13.2
		devStatusGroup OBJECT-GROUP
			OBJECTS { cpuUtilization, memoryUtilization, storageUtilization, statusDescription, deviceStatusIndex
				 }
			STATUS current
			DESCRIPTION 
				"Description."
			::= { deviceStatusGroup 2 }

		
		-- 1.3.6.1.4.1.99999.1.14
		iotGatewayTrapGroup OBJECT IDENTIFIER ::= { iotGatewayMIB 14 }

		
		-- 1.3.6.1.4.1.99999.1.14.1
		iotGatewayTraps OBJECT-IDENTITY
			STATUS current
			DESCRIPTION 
				"Description."
			::= { iotGatewayTrapGroup 1 }

		
		-- 1.3.6.1.4.1.99999.1.14.1.1
		iotGatewayHighCpuUsage NOTIFICATION-TYPE
			OBJECTS { cpuUtilization }
			STATUS current
			DESCRIPTION 
				"This trap is sent when the CPU usage exceeds a predefined threshold."
			::= { iotGatewayTraps 1 }

		
		-- 1.3.6.1.4.1.99999.1.14.3
		iotTrapGroup NOTIFICATION-GROUP
			NOTIFICATIONS { iotGatewayHighCpuUsage }
			STATUS current
			DESCRIPTION 
				"Description."
			::= { iotGatewayTrapGroup 3 }

		
	
	END

--
-- IOTGATEWAY-MIB.my
--

开源项目地址

文章来源:https://blog.csdn.net/yang2330648064/article/details/135093052
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。