SNMP的配置

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

一、在思科的路由器上配置SNMP(启用SNMP代理)、开启SNMP服务

5、案例:配置网管工作站接收被管设备的陷阱消息(1)启用陷阱消息接收器----打开162端口

(2)配置团体名

(3)在snmp代理上配置陷阱消息

snmp-server host 192.168.4.231 sdxh #配置陷阱消息的目标

snmp-server enable traps config #配置启用trap 配置事件(注:只是其中的一种消息类型,可以配置多个)(4)效果

二、在思科交换机上配置SNMP

1、配置管理地址

三、在思科ASA上启用SNMP

1、防火墙只支持只读SNMP

2、SNMPv3支持更强的认证:用户名、认证密钥、加密密钥

四、在Windows Server上启用SNMP

在Linux中启用SNMP

五、

五、在

1、yum仓库的配置(以本地光盘为yum安装源)

mount /dev/cdrom /media/cdrom/

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 导入签名密钥1)、vi /etc/yum.repos.d/rhel6.repo

[rhel-source] #仓库的名称

name=Red Hat Enterprise Linux $releasever - $basearch - Source #描述

baseurl=file:///media/cdrom #位置

enabled=1 #启用仓库

gpgcheck=1 #启用签名检查

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release #签名密钥

3)、相关软件包

将snmp服务设为开机自动启动:

修改允许查看的MIB库信息

87 view all included .1 80

91 view mib2 included .dod.internet.mgmt.mib-2 fc 设置团体名的权限(在文件的结尾)

snmpwalk -v 2c 192.168.4.213 -c sdxh system

snmpwalk -v 2c 192.168.4.254 -c sdxh ifDescr.1

snmpnetstat -v 2c -c sdxh -Ca -Cp tcp 192.168.4.213 #查看tcp连接

启用SNMP-V3:

3、【补充】

Setting Up SNMP

This HowTo will explain how to install and configure the Net-SNMP agent. At time of writing, the latest version available is 5.4 (published on 12/06/2006).

Getting Net-SNMP binaries

Depending on your operating system, you'll find packages or tarballs to install Net-SNMP :

Linux

Usually every Linux distribution comes with Net-SNMP packages :

RedHat / Fedora : install the net-snmp, net-snmp-libs and net-snmp-utils packages

Debian / Ubuntu: install the libsnmp-base, libsnmp5, snmp and snmpd packages

SuSE : install the net-snmp package

Gentoo : simply emerge the net-snmp ebuild

Mandriva : install the libnet-snmp5, net-snmp and net-snmp-utils packages.

agentaddress 10.20.30.40:10000

You can also make it listens on TCP, which is supported by Cacti

agentaddress tcp:161

The “tcp” keyword can then be used in Cacti :

For those who want some more security, you can use the SNMP version 3 protocol, with MD5 or SHA hashing:

createUser frederic MD5 mypassphrase DES

group groupv3 usm frederic

view all included .iso 80

access groupv3 "" any auth exact all all all

This creates a user “frederic” whose password is “mypassphrase”. To test it:

# snmpget -v 3 -l AuthNoPriv -u frederic -A mypassphrase 10.50.80.45 sysName.0

SNMPv2-MIB::sysName.0 = STRING: cyclopes

In Cacti, add your device, choose SNMP version 3, and fill the username and password fields:

Now that you're done with access control, add these 2 lines in snmpd.conf to indicate the location and contact name of your device:

syslocation Bat. C2

syscontact someone@

They will then appear in Cacti management interface :

Some OIDs return a unit, eg ”-153.1 dBm”.

It's a safe idea to turn this off, by adding this to snmpd.conf:

dontPrintUnits true

Next step is to graph filesystems in Cacti; the easyest way is to add this line in snmpd.conf:

includeAllDisks

When you'll run the “ucd/net - Get Monitored Partitions” Data Query, all the mounted filesystems will show up:

If you want a filesystem not to be listed here, add this line to snmpd.conf:

相关文档
最新文档