Browsing the archives for the snmp tag

为CentOS配置snmp代理(转)

in 服务器类

切换到系统管理员帐户 安装snmp 确认snmp代理已安装 rpm -q net-snmp 如果未安装,安装snmp yum install net-snmp 设置开机自动运行snmp /sbin/chkconfig snmpd on 配置snmp 编辑/etc/snmp/snmpd.conf

0 Comments

SNMP AGNET 调试总结

in 服务器类

很久以前就有个想法自己做个snmp agent,看了若干遍snmp相关资料,还是没有见到最终的效果,下定决心实现自己的agent,下面为调试的过程。 1.       从网上下载 net-snmp-5.0.6.src.rpm; 2.       按装源码: rpm –i snmp-5.0.6.src.rpm(虚拟机的linux采用redhat7.3,没有开启默认的snmpd服务哦):cd /usr/src/redhat/SPECS, rpmbuild –bp net-snmp.spec; 3.       cd /usr/src/redhat/BUILD 目录,按照<<USING NET-SNMP UNDER LINUX AND μCLINUX INTRODUCTION TO NETWORK MANAGEMENT>>文档进行编译和安装; 4.       ./configure ;make;make install; 5.       cp EXAMPLE.conf 到/usr/local/share/snmp/snmpd.conf 6.       修改默认的配置,比如NETWORK COMMUNITY等; 7.       为了验证snmpd.conf,启动snmpd时添加 –d –L 参数,这样会报告启动信息,具体看snmpd –help; 8.       为了保证测试,请输出 MIBS变量: export MIBS=ALL; 9.       测试snmpd ,snmpwalk –c public –v 1 localhost system(注意system的识别就是从MIBS变量中读) 10.   ok,下面编写自己的agent吧,直接参考文档,编写ENSEIRB-MIB.txt,然后copy 的到/usr/local/share/snmp/mibs/ 11.   编译# cd ~/net-snmp,# cd agent/mibgroup, # mib2c -c ../../local/mib2c.scalar.conf enseirb 好像编译老是出错,从网上看了一下,发现些个脚本就可以解决

0 Comments