免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1509 | 回复: 2
打印 上一主题 下一主题

关于运行SNMP的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-11-11 16:08 |只看该作者 |倒序浏览
安装了SNMP并加了如下的启动脚本:
# vi /etc/rc.local

if [ -x /usr/local/sbin/snmpd ]; then
/usr/local/sbin/snmpd -c /etc/snmpd.conf
fi

但开机不运行,可是在命令行可以手动用/usr/local/sbin/snmpd -c /etc/snmpd.conf启动,不知那里有问题,我用的是OPENBSD 3.6

论坛徽章:
0
2 [报告]
发表于 2004-11-12 08:01 |只看该作者

关于运行SNMP的问题

下面是我安装SNMP的过程,各位看看那里有问题:


1、安装ucd-snmp-4.2.6
# pkg_add http://ftp.it.net.au/OpenBSD/3.6/packages/i386/ucd-snmp-4.2.6.tgz

2、配置ucd-snmp-4.2.6
# snmpconf -g basic_setup

将会出现一个询问菜单,按如下步骤进行回答:

Do you want to configure the information returned in the system MIB group (contact info, etc)? (default = y): y

The location of the system: HeBei,China

The contact information: llzqq@126.com
Do you want to properly set the value of the sysServices.0 OID (if you don't know, just say no)? (default = y): y

does this host offer physical services (eg, like a repeater) [answer 0 or 1]: 1
does this host offer datalink/subnetwork services (eg, like a bridge): 0
does this host offer internet services (eg, supports IP): 1
does this host offer end-to-end services (eg, supports TCP): 1
does this host offer application services (eg, supports SMTP): 1

Do you want to configure the agent's access control? (default = y): y
Do you want to allow SNMPv3 read-write user based access (default = y): n
Do you want to allow SNMPv3 read-only user based access (default = y): n
Do you want to allow SNMPv1/v2c read-write community access (default = y): n
Do you want to allow SNMPv1/v2c read-only community access (default = y): y

The community name to add read-only access for: bsd
The hostname or network address to accept this community name from [RETURN for all]: localhost
The OID that this community should be restricted to [RETURN for no-restriction]: (RETURN)

Do you want to configure where and if the agent will send traps? (default = y): n

将会生成具有如下内容的snmpd.conf:

rocommunity bsd 192.168.0.1
sysservices 77
syscontact llzqq@126.com
syslocation hebei,china
注意:请删除无用的说明部分!之后执行下列命令:

# cp snmpd.conf /usr/local/share/snmp/
# cp snmpd.conf /etc/snmpd.conf

启动snmpd

# vi /etc/rc.local

if [ -x /usr/local/sbin/snmpd ]; then
/usr/local/sbin/snmpd -c /etc/snmpd.conf && echo -n ' snmpd'
fi

论坛徽章:
0
3 [报告]
发表于 2004-11-12 10:15 |只看该作者

关于运行SNMP的问题

终于找到原因了,原来在启动PPP接口“tun0”之前SNMP是不能启动的,我把/usr/local/sbin/snmpd -c /etc/snmpd.conf加到/etc/ppp/ppp.linkup后就可以了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP