快速业务通道

MRTG监控 ON RHEL6

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-03-26
Step # 1 : Make sure snmp server installed

# rpm -qa | grep snmp



# yum install net-snmp-utils net-snmp



Step # 2 : Determine if snmp server is running or not

Run ''ps'' command to see if snmp server is running or not:


# ps -aux | grep snmp



Output:


root   5512  0.0  2.3  5872 3012 pts/0    S    22:04   0:00 /usr/sbin/snmpd

Alternatively, you can try any of the following two commands as well:


# lsof -i :199



Output:


COMMAND  PID USER   FD   TYPE DEVICE SIZE NODE NAME

snmpd   5512 root    4u  IPv4  34432       TCP *:smux (LISTEN)

OR try out netstat command:


# netstat -natv | grep '':199''



Output:


tcp        0      0 0.0.0.0:199             0.0.0.0:*               LISTEN

If you found service is running or listing on port 199 then please see step #3; otherwise start service using following command:


# service snmpd start



Make sure snmpd service starts automatically, when linux comes us (add snmpd service):


# chkconfig --add snmpd



Step # 3 : Make sure snmp server configured properly

Run snmpwalk utility to request for tree of information about network entity. In simple words query snmp server for your IP address (assigned to eth0, eth1, lo etc):


# snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex




ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.127.0.0.1 = 1

ip.ipAddrTable.ipAddrEntry.ipAdEntIfIndex.192.168.0.3 = 2

If you can see your IP address then please proceed to step 4; else it is a time to configure snmp server as follows (by default RHEL and RH 8/9 are not configured for snmp server for security reason):

Configure SNMP

(1) Edit file /etc/snmp/snmpd.conf using text editor:

Empire CMS,phome.net

# vi /etc/snmp/snmpd.conf



Change/Modify line(s) as follows:

Find following Line:


com2sec notConfigUser  default       public



Replace with (make sure you replace 192.168.0.0/24 replace with your network IPs) following lines:


com2sec local     localhost           public

com2sec mynetwork 192.168.0.0/24      public



Scroll down bit and change:

Find Lines:


group   notConfigGroup v1           notConfigUser

group   notConfigGroup v2c           notConfigUser



Replace with:


group MyRWGroup v1         local

group MyRWGroup v2c        local

group MyRWGroup usm        local

group MyROGroup v1         mynetwork

group MyROGroup v2c        mynetwork

group MyROGroup usm        mynetwork



Again scroll down bit and locate following line:

Find line:


view    systemview     included      system



Replace with:


view all    included  .1                               80



Again scroll down bit and change:

Find line:


access  notConfigGroup ""      any       noauth    exact  systemview none none



Replace with:


access MyROGroup ""      any       noauth    exact  all    none   none

access MyRWGroup ""      any       noauth    exact  all    all    none



Scroll down bit and change:

Find lines:


s

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号