Chinaunix首页 | 论坛 | 博客
  • 博客访问: 24785899
  • 博文数量: 271
  • 博客积分: 10025
  • 博客等级: 上将
  • 技术积分: 3358
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-12 15:28
文章分类

全部博文(271)

文章存档

2010年(71)

2009年(164)

2008年(36)

我的朋友

分类: LINUX

2010-05-17 16:19:36

Release found: Red Hat Enterprise Linux 4, Red Hat Enterprise Linux 5

Problem

You want to configure an SNMP for basic operation on Red Hat Enterprise Linux 4 or 5.

Solution

First, install the required packages:

* net-snmp (this provides the snmp server)

* net-snmp-utils (this provides tools like snmp-walk)

To configure an SNMP server, community strings need to be defined. This is done in the following configuration file:


/etc/snmp/snmpd.conf

The version of the configuration file that comes with SNMP is quite complicated. A simpler version will suffice for the setup discussed in this article.

Before proceeding further, make a backup of the old configuration file. It is highly recommended to do this any time that a configuration file is changed. Use the following commands:


# cd /etc/snmp/
# mv snmpd.conf snmpd.conf.old

Follow these steps:

  • Enter the following line in the new configuration file to set the Read Only community string to testuser:

 rocommunity testuser 127.0.0.1
 

  • Now, configure the SNMP services on each reboot with the following chkconfig command:

 # chkconfig snmpd on
 

  • Restart SNMP to load the new configuration file:

 # service snmpd restart
 

If the service does not start up correctly, check the configuration file for errors. 
 
  Test whether SNMP can read the system and interface information from the localhost with the following two commands.

 snmpwalk -v 1 -c testuser localhost system
 snmpwalk -v 1 -c testuser localhost interface
 

If these return information, then SNMP is set up correctly. If not, then make sure your firewall allows access and that there's no other security policy in place that prevents access (tcpwrappers/selinux). If those are OK, check the configuration file for errors.

See `man snmpd.conf` for more details, or read the EXAMPLE.conf annotated configuration file in /usr/share/doc/net-snmp-$(version).

Alternatively you can use the `snmpconf` perl script to create a working SNMP configuration for you. This utility can create SNMP v1, v2c and v3 configuration files. This script will create a snmpd.conf in the current directory, you will need to copy it into /etc/snmp/ and restart the snmpd service for the changes to become active.

For an example setup where you can use snmp and mrtg to monitor network traffic see:

If you want more information on setting up SNMP on a Red Hat Cluster on Red Hat Enterprise Linux 5, see:

阅读(1606) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~