AAC-MIB DEFINITIONS ::= BEGIN
****************************************************************************************************
MIB文件是以DEFINITIONS ::= BEGIN 开始,最后一行以END结束。
DEFINITIONS ::= BEGIN 前面是库名称,如这里的是AAC-MIB,这里库名称就像是一个系统中的
对象名,是唯一的!
****************************************************************************************************
IMPORTS
****************************************************************************************************
IMPORTS标识当前库文件需要引入其它的类文件,编译才不会出错.引入格式为[对象]FROM[库文件],像:
IpAddress
FROM RFC1155-SMI
MODULE-IDENTITY,OBJECT-TYPE
FROM SNMPv2-SMI
****************************************************************************************************
IpAddress
FROM RFC1155-SMI
MODULE-IDENTITY, OBJECT-TYPE
FROM SNMPv2-SMI
RowStatus,DisplayString
FROM SNMPv2-TC
MODULE-COMPLIANCE, OBJECT-GROUP
FROM SNMPv2-CONF
-- EntryStatus
-- FROM RMON-MIB
dlink-common-mgmt FROM DLINK-ID-REC-MIB;
****************************************************************************************************
要引人的对象
****************************************************************************************************
swDlinkAACMIB MODULE-IDENTITY
LAST-UPDATED "9911220000Z"
ORGANIZATION "Working Group"
CONTACT-INFO
" "
DESCRIPTION
"The Link AAC module MIB."
::= { dlink-common-mgmt 5}
swAACCtrl OBJECT IDENTIFIER ::= { swDlinkAACMIB 1 }
-- -------------------------------------------------------------
-- Textual Conventions
-- -------------------------------------------------------------
swAACAuthenAdminState OBJECT-TYPE
SYNTAX INTEGER {
other(1),
disabled(2),
enabled(3)
}
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"This object indicates the Access Authentication is enable or
disable."
::= { swAACCtrl 1}
****************************************************************************************************
引入文件标识结束后就是本类的对象节点描述.
节点描述格式为:
NODENAME NODETYPE
[DATA]
::={PARENT_NODENAME id}
NODENAME为当前节点的名称,如sysDescs,这个名称应该是唯一的;
NODETYPE为当前节点的类型,如MODULE-IDENTITY,OBJECT-TYPE等等;
DATA为节点的内容说明,包含数据类型,访问模式,状态,描述;
PARENT_NODENAME为当前节点的父节点,这个父节点可能在本类中,也可以要引用的外部类中;
id为当前节点在父类中的索引顺序号.
****************************************************************************************************
END
****************************************************************************************************
最后一行以END结束
****************************************************************************************************
例子:
LOOGSON-MIB DEFINITIONS::=BEGIN
IMPORTS
enterprises,OBJECT-TYPE,Integer32,TimeTicks
FROM SNMPv2-SMI
OBJECT-GROUP, NOTIFICATION-GROUP
FROM SNMPv2-CONF
TEXTUAL-CONVENTION, DisplayString
FROM SNMPv2-TC;
loogson OBJECT IDENTIFIER ::= { enterprises 29881 }
cq8401 OBJECT IDENTIFIER ::= { loogson 3 }
test OBJECT IDENTIFIER ::= { cq8401 1 }
MachType OBJECT-TYPE
SYNTAX OCTET STRING
ACCESS read-only
STATUS current
DESCRIPTION "设备类型"
::={ test 1 }
END
You then need to force the reading of all mibs like this:
# export MIBS=ALL
Or, alternatively, create '/usr/share/snmp/snmp.conf' and add this line:
mibfile /usr/share/snmp/mibs/DS11INTEG-MIB.txt
阅读(1672) | 评论(0) | 转发(0) |