<span style="font-size:14px;">本文介绍怎样在CentOS环境下配置一个简单的SNMP服务</span>

软件安装

切换到系统管理员帐户

安装snmp

确认snmp代理已安装

rpm -q net-snmp

假设未安装。安装snmp

yum install net-snmp

设置开机自己主动执行snmp

/sbin/chkconfig snmpd on配置snmp

改动配置文件

将原来的配置文件备份。编辑/etc/snmp/snmpd.conf,简单配置例如以下

# First, map the community name "public" into a "security name"

#       sec.name  source          community
com2sec notConfigUser default public ####
# Second, map the security name into a group name: # groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser ####
# Third, create a view for us to let the group have rights to: # Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1 ####
# Finally, grant the group read-only access to the systemview view. # group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact systemview none none

启动snmp

/etc/init.d/snmpd start

假设已启动则重新启动snmp服务

/etc/init.d/snmpd restart

測试snmp

查看port是否打开

netstat -ln | grep 161

安装snmp測试工具

yum install net-snmp-utils

本机測试snmp数据(改动monit为配置的团体名)

snmpwalk -v 2c -c public localhost system

snmpwalk -v3 -u username -l auth -a MD5 -A password localhost

创建SNMP(v3)用户

net-snmp-config --create-snmpv3-user -ro -a MD5 lyceemsnmp lyceem.com

远程測试snmp数据(改动ip为serverip,snmpwalk命令须要安装net-snmp)

snmpwalk -v 2c -c public ip system

故常处理

错误排除假设本地測试snmp有数据。远程測试snmp无数据则因为server防火墙禁止了外部訪问serverudp 161port,则:

改动 /etc/sysconfig/iptables (或者:/etc/sysconfig/iptables-config ) ,添加例如以下规则:

-A RH-Firewall-1-INPUT -p udp -m state Cstate NEW -m udp Cdport 161 -j ACCEPT

重新启动iptables

/etc/init.d/iptables restart

版权声明:本文博主原创文章,博客,未经同意不得转载。

CentOS构造SNMP的更多相关文章

  1. CentOS下SNMP的安装与使用

    CentOS下SNMP的安装与使用   导读 简单网络管理协议(SNMP),由一组网络管理的标准组成,包含一个应用层协议(application layer protocol).数据库模型(datab ...

  2. Hadoop之——CentOS构造ssh否password登录注意事项

    转载请注明出处:http://blog.csdn.net/l1028386804/article/details/46388809 前提配置:使用root登录改动配置文件:/etc/ssh/sshd_ ...

  3. 能ping通虚拟机,但snmp报文 Destination unreachable(Host administratively prohibited

    如题目,使用virtual box 虚拟机,虚拟机系统为centos6.5, 主机系统为win10 内外设置ip在同一网段后,互相能ping通,centos 系统开启snmp服务,此处说明以下, sn ...

  4. 监控部署nagios+snmp

    参看是否有安装:rpm -q gcc glibc glibc-common gd gd-devel xinetd openssl-devel 未安装基础支持套件的先安装: yum install -y ...

  5. Centos 6.5 SNMP客户端安装及配置版本net-snmp-5.7.3

    Centos 6.5 SNMP客户端安装及配置SNMP版本:net-snmp-5.7.3.tar.gz1.下载软件cd /usr/local/srcyum -y install gccwget htt ...

  6. CentOS 6用snmp配合MRTG显示系统状态

    1. 软件安装以yum的方式安装snmp/MRTG 安装SNMP(要记得安装net-snmp-utils,不然snmpwalk将不能使用)yum -y install net-snmp* 安装MRTG ...

  7. Centos 6.5下一个SNMP简单配置(snmp protocol v3,监控宝)

    Centos 6.5下一个SNMP简单配置(snmp protocol v3.监控宝) jom_ch@2014/7/25 1,安装 >yum -y install net-snmp net-sn ...

  8. 如何在CentOS系统中安装配置SNMP服务

    CentOS(Community Enterprise Operating System,中文意思是:社区企业操作系统)是Linux发行版之一,现在有一大部分服务器在使用此操作系统:SNMP(简单网络 ...

  9. CentOS 下安装 SNMP 服务

    CentOS 中搭建 SNMP 服务 0.前言 首先这个服务我不知道有什么用,学习CCNA的也许有了解.所以这里仅仅只是教做题,下面还有一些搜到的配置文件希望会大家有所帮助. 简单网络管理协议(SNM ...

随机推荐

  1. WPF案例(二)模拟Apple OS 界面前后180度反转

    原文:WPF案例(二)模拟Apple OS 界面前后180度反转 我们在设计应用程序界面的时候,为了充分利用界面空间,住住需要灵活的界面布局方式,比如可以在界面正面空间上定义一个Chart,背面空间上 ...

  2. linux centos 卸载jdk

    1.先看看OpenJDK的安装包 $ rpm -qa |grep java tzdata-java-2013b-1.el6.noarch java-1.6.0-openjdk-1.6.0.0-1.61 ...

  3. 自写jquery网页回到顶部效果,渐隐图标,引用js文件就可以

    唔.进来开发需求,当网页内容草鸡多的时候,用户就须要有个button高速回到顶部,而不是自己去滚滑轮~ 原本以为比較难的说,由于上头要求所实用js来实现,哪个页面引用,哪个页面显示. 于是乎,本屌丝就 ...

  4. 2014年百度之星程序设计大赛 - 资格赛 第三题 Xor Sum

    小记:艹蛋呢, 取long long的低30,32,34位都WA, 取31位才AC. .. 思路:依据求数组中两个数异或最大值.參考 代码: #include <stdio.h> #inc ...

  5. SE 2014年4月2日

    一 描述OSPF协议 LSA(Type 1~5)的名称,始发者以及特点 第一类LSA (router lsa)该类lSA为启动了ospf进程的所有路由器都可以产生,该类LSA主要含有本地路由器的接口状 ...

  6. Python使用MySQLdb操作MySQL

    import MySQLdb,sys try: conn=MySQLdb.connect(host=,user=',db='db1') except Exception,e: print e sys. ...

  7. JsonCpp Documentation

    JsonCpp - JSON data format manipulation library JsonCpp Documentation 0.6.0-rc2 Introduction JSON (J ...

  8. [POJ 3735] Training little cats (结构矩阵、矩阵高速功率)

    Training little cats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9613   Accepted: 2 ...

  9. 数据库关于group by 两个或以上条件的分析

    首先group by 的简单说明:    group by 一般和聚合函数一起使用才有意义,比如 count sum avg等,使用group by的两个要素:    (1) 出现在select后面的 ...

  10. The Building Blocks-Enterprise Applications Part 2- Information Management and Business Analytics

    1. Business Analytic Applications Data Analytics Also referred to as 'Business Analytics' or 'Busine ...