如何配置snmpd.conf文件以在net-snmp中制作工作集命令?
我已经配置了snmpd.conf,如下所示
com2sec AllUser default public
group AllGroup v2c AllUser
view AllView included .1
access AllGroup "" any noauth exact AllView none none
mibs +GET-PDU-INFO-MIB
mibs +NOTIFICATION-TEST-MIB
rocommunity private localhost
rwcommunity private localhost
pass .1.3.6.1.4.1.53864.1 /bin/sh /etc/snmp/pduMIBScript.sh
之后
/etc/snmp/snmpd.conf
我尝试发送以下命令
- 在
- ,
- ,
- 除了
- 尝试所有上述所有命令之后,
我观察到的所有命令是所有命令都可以正常工作了 “设置”命令。
要调试这个问题,我确认的第一件事是,我要设置的变量是在MIB文件中具有读写访问权限。 从MIB浏览器发送“ SET”命令后,我使用的MIB文件会以下内容
GET-PDU-INFO-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, enterprises FROM SNMPv2-SMI
;
pduInfo MODULE-IDENTITY
LAST-UPDATED "202005100000Z"
ORGANIZATION "XYZ"
CONTACT-INFO
"postal: admin @ admin"
DESCRIPTION
"This Mib module defines objects for signal statistics"
REVISION "202005100000Z"
DESCRIPTION
"Corrected notification example definitions"
REVISION "200202060000Z"
DESCRIPTION
"First draft"
::= { enterprises 53864 }
--
-- top level structure
--
pduVar OBJECT IDENTIFIER ::= { pduInfo 1 }
--
-- Example scalars
--
gpsVar1 OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"the latest value of signal"
DEFVAL { "hello" }
::= { pduVar 1 }
END
我得到以下误差
src =“ https://i.sstatic.net/kkrdx.jpg” alt =“在此处输入图像描述”>
“设置命令问题”的原因是什么。谁能帮助我了解此问题的问题?
I have configured the snmpd.conf as follows
com2sec AllUser default public
group AllGroup v2c AllUser
view AllView included .1
access AllGroup "" any noauth exact AllView none none
mibs +GET-PDU-INFO-MIB
mibs +NOTIFICATION-TEST-MIB
rocommunity private localhost
rwcommunity private localhost
pass .1.3.6.1.4.1.53864.1 /bin/sh /etc/snmp/pduMIBScript.sh
having the path
/etc/snmp/snmpd.conf
So after that i tried to send the following commands
- Get Next
- Get
- Get Bulk
- Walk
- Set
After trying all the above commands one thing I observe is that all the commands are working perfectly fine except the "Set" command.
To debug this issue first thing I confirmed was that the variable which I was trying to set is having read-write access in the MIB file. MIB file which I was using as follows
GET-PDU-INFO-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, enterprises FROM SNMPv2-SMI
;
pduInfo MODULE-IDENTITY
LAST-UPDATED "202005100000Z"
ORGANIZATION "XYZ"
CONTACT-INFO
"postal: admin @ admin"
DESCRIPTION
"This Mib module defines objects for signal statistics"
REVISION "202005100000Z"
DESCRIPTION
"Corrected notification example definitions"
REVISION "200202060000Z"
DESCRIPTION
"First draft"
::= { enterprises 53864 }
--
-- top level structure
--
pduVar OBJECT IDENTIFIER ::= { pduInfo 1 }
--
-- Example scalars
--
gpsVar1 OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"the latest value of signal"
DEFVAL { "hello" }
::= { pduVar 1 }
END
After sending "SET" command from MIB browser I was getting following error
What will be the reason for the "SET command issue". Can anyone please help me to understand the issue behind this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在搜索很多之后,我终于找到了解决方案。现在,我已经编辑了snmpd.conf,如下所示
After searching a lot finally I found the solution. Now I have edited the snmpd.conf as follows,