网络、服务器等相关设备SNMP配置的指南

合集下载

网络设备SNMP配置

网络设备SNMP配置

⽹络设备SNMP配置1、Cisco⽹络设备SNMP的配置 1.进⼊全局配置状态 config terminal 2.配置本路由器的只读字串为public snmp-server community public ro (只读) 3.配置本路由器的读写字串为private snmp-server community public rw (读写) show run命令查看设备的团体名2、华为⽹络设备SNMP配置 1.查看当前配置 display current-configuration 2.进⼊到系统配置状态(相当于CISCO设备的EN 命令) system-view 3.配置本路由器的只读字串为public snmp-agent community read public (只读) 4.配置本路由器的读写字串为private snmp-agent community write private (读写) 5.查看配置的只读团体名Display snmp-agent community read # 设置SNMP基本信息,包括版本、团体名。

system-view [Sysname] snmp-agent sys-info version v1 v2c [Sysname] snmp-agent community read public3、H3C⽹络设备SNMP配置 # 设置SNMP基本信息,包括版本、团体名。

system-view [Sysname] snmp-agent sys-info version v1 v2c [Sysname] snmp-agent community read public。

SNMP的配置

SNMP的配置

一、在思科的路由器上配置SNMP(启用SNMP代理)、开启SNMP服务5、案例:配置网管工作站接收被管设备的陷阱消息(1)启用陷阱消息接收器----打开162端口(2)配置团体名(3)在snmp代理上配置陷阱消息snmp-server host 192.168.4.231 sdxh #配置陷阱消息的目标snmp-server enable traps config #配置启用trap 配置事件(注:只是其中的一种消息类型,可以配置多个)(4)效果二、在思科交换机上配置SNMP1、配置管理地址三、在思科ASA上启用SNMP1、防火墙只支持只读SNMP2、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 8091 view mib2 included .dod.internet.mgmt.mib-2 fc 设置团体名的权限(在文件的结尾)snmpwalk -v 2c 192.168.4.213 -c sdxh systemsnmpwalk -v 2c 192.168.4.254 -c sdxh ifDescr.1snmpnetstat -v 2c -c sdxh -Ca -Cp tcp 192.168.4.213 #查看tcp连接启用SNMP-V3:3、【补充】Setting Up SNMPThis 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 binariesDepending on your operating system, you'll find packages or tarballs to install Net-SNMP :LinuxUsually every Linux distribution comes with Net-SNMP packages :RedHat / Fedora : install the net-snmp, net-snmp-libs and net-snmp-utils packagesDebian / Ubuntu: install the libsnmp-base, libsnmp5, snmp and snmpd packagesSuSE : install the net-snmp packageGentoo : simply emerge the net-snmp ebuildMandriva : install the libnet-snmp5, net-snmp and net-snmp-utils packages.agentaddress 10.20.30.40:10000You can also make it listens on TCP, which is supported by Cactiagentaddress tcp:161The “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 DESgroup groupv3 usm fredericview all included .iso 80access groupv3 "" any auth exact all all allThis 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.0SNMPv2-MIB::sysName.0 = STRING: cyclopesIn 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. C2syscontact 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 trueNext step is to graph filesystems in Cacti; the easyest way is to add this line in snmpd.conf:includeAllDisksWhen 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:ignoredisk /dev/rdsk/c0t2d0Unfortunatly, some older versions of Net-SNMP do not fully work with the includeAllDisks keywordYou'll then have to list explicitly all filesystems you want to graph:disk /disk /usrdisk /vardisk /oracleYou can also specify NFS mount points.Please note that the Net-SNMP agent can only report filesystems which where mounted before its start.If you manually mount filesystems later, you'll have to reload the Net-SNMP agent (send the HUP signal).You can also graph processes, by adding this to snmpd.conf:proc httpdThe result will be accessible under the ucdavis.prTable.prEntry tree:prCount, number of current processes running with the name in questionprNames, the process name you're counting.In our example, the number of Apache processes will be available under the .1.3.6.1.4.1.2021.2.1.5 OID Some useful mib modules are:mibII/mta_sendmail, to graph MTA (Sendmail, Postfix, etc.) statisticsdiskio, to enable to graph I/O statisticsucd-snmp/lmSensors, for hardware monitoring (Linux and Solaris only)Mib modules can be added like this:$ ./configure --with-mib-modules="module1 module2"To compile Net-SNMP and build a compressed archive, follow these steps:$ ./configure --with-your-options$ make# mkdir /usr/local/dist# make install prefix=/usr/local/dist/usr/local exec_prefix=/usr/local/dist/usr/local# cd /usr/local/dist# tar cvf /tmp/net-snmp-5.3.1-dist.tar usr# gzip /tmp/net-snmp-5.3.1-dist.tar# rm -rf /usr/local/distYou can then copy the /tmp/net-snmp-5.3.1-dist.tar.gz file to other servers, and uncompress it from the root directory (everything will get extracted to /usr/local).Test your configurationOnce Net-SNMP is configured and started, here's how to test it:$ snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0SNMPv2-MIB::sysDescr.0 = STRING: Linux cronos 2.4.28 #2 SMP ven jan 14 14:12:01 CET 2005 i686This basic query shows that your Net-SNMP agent is reachable.You can even query which Net-SNMP version is running on a host:$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.100.2.0UCD-SNMP-MIB::versionTag.0 = STRING: 5.2.1.2An answer like that one$ snmpwalk -v 1 -c foo localhost .1.3.6.1.2.1.1.1.0Timeout: No Response from localhostindicates that either the agent is not started, or that the community string is incorrect, or that this device is unreachable. Check your community string, add firewall rules if necessary, etc.If using SNMP version 3, specifying an unknown user will result in this error message :$ snmpget -v 3 -l AuthNoPriv -u john -A mypassphrase 10.50.80.45 sysName.0snmpget: Unknown user nameAn incorrect passphrase will result in this error message :$ snmpget -v 3 -l AuthNoPriv -u frederic -A badpassphrase 10.50.80.45 sysName.0snmpget: Authentication failure (incorrect password, community or key)This query will show you what filesystems are mounted:$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9.1.2UCD-SNMP-MIB::dskPath.1 = STRING: /UCD-SNMP-MIB::dskPath.2 = STRING: /BBUCD-SNMP-MIB::dskPath.3 = STRING: /dev/shmIf the answer is empty, usually it means the includeAllDisks is not supported by your Net-SNMP agent (you'll have to list each filesystem you want to graph as explained in previous chapter).Finally, this query will you display your network interfaces:$ snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.2.2.1.2IF-MIB::ifDescr.1 = STRING: loIF-MIB::ifDescr.2 = STRING: eth0IF-MIB::ifDescr.3 = STRING: eth1Extending the SNMP AgentA great functionnality of Net-SNMP is that you can “extend” it.Let's run the /tmp/foo.sh script:$ /tmp/foo.sh -arg1123Now put this in snmpd.conf:exec foo /bin/sh /tmp/foo.sh -arg1The result of your script will be accessible under the ucdavis.extTable.extEntry tree: * output of the script :ucdavis.extTable.extEntry.extOutput * exit status: ucdavis.extTable.extEntry.extResult * command:ucdavis.extTable.extEntry.extCommandYou can check the result with this SNMP query:$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8.1UCD-SNMP-MIB::extIndex.1 = INTEGER: 1UCD-SNMP-MIB::extNames.1 = STRING: fooUCD-SNMP-MIB::extCommand.1 = STRING: /bin/sh /tmp/foo.sh -arg1UCD-SNMP-MIB::extResult.1 = INTEGER: 0UCD-SNMP-MIB::extOutput.1 = STRING: 123UCD-SNMP-MIB::extErrFix.1 = INTEGER: 0UCD-SNMP-MIB::extErrFixCmd.1 = STRING:extOutput translates to .1.3.6.1.4.1.2021.8.1.101 As “foo” is our first exec directive, add .1 at the end of the OID.In Cacti, use the “SNMP - Generic OID Template” like this:Voila! Result of the /tmp/foo.sh script is now graphed in Cacti.Now let's run this second script, which returns more than one result:$ /tmp/bar.sh456789It returns two values, one per line (this is important).Another way to call scripts from snmpd.conf is by specifying an OID, like this:exec .1.3.6.1.4.1.2021.555 /bin/sh /tmp/bar.shRun this query:$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.555UCD-SNMP-MIB::ucdavis.555.1.1 = INTEGER: 1UCD-SNMP-MIB::ucdavis.555.2.1 = STRING: "/bin/sh"UCD-SNMP-MIB::ucdavis.555.3.1 = STRING: "/tmp/bar.sh"UCD-SNMP-MIB::ucdavis.555.100.1 = INTEGER: 0UCD-SNMP-MIB::ucdavis.555.101.1 = STRING: "456"UCD-SNMP-MIB::ucdavis.555.101.2 = STRING: "789"UCD-SNMP-MIB::ucdavis.555.102.1 = INTEGER: 0UCD-SNMP-MIB::ucdavis.555.103.1 = ""First line returned by the script will be available at .1.3.6.1.4.1.2021.555.101.1, second one at .1.3.6.1.4.1.2021.555.101.2, and so on.You can then use the “SNMP - Generic OID Template” in Cacti (one Data Source per OID).Let's say you want to count the number of entries in a log file. Add this to snmpd.conf:logmatch cactistats /home/cactiuser/cacti/log/cacti.log 120 SYSTEM STATS* the global count of matches will be available under the .1.3.6.1.4.1.2021.16.2.1.5.1 OID * the “Regex match counter” (which is reset with each file rotation) will be available under the .1.3.6.1.4.1.2021.16.2.1.7.1 OIDTo list all the available variables, use this query:$ snmpwalk -v 1 -c public localhost logMatchUCD-SNMP-MIB::logMatchMaxEntries.0 = INTEGER: 50UCD-SNMP-MIB::logMatchIndex.1 = INTEGER: 1UCD-SNMP-MIB::logMatchName.1 = STRING: cactistatsUCD-SNMP-MIB::logMatchFilename.1 = STRING: /home/cactiuser/cacti/log/cacti.logUCD-SNMP-MIB::logMatchRegEx.1 = STRING: SYSTEM STATSUCD-SNMP-MIB::logMatchGlobalCounter.1 = Counter32: 301634UCD-SNMP-MIB::logMatchGlobalCount.1 = INTEGER: 301634UCD-SNMP-MIB::logMatchCurrentCounter.1 = Counter32: 6692UCD-SNMP-MIB::logMatchCurrentCount.1 = INTEGER: 6692https:///autho/forms/CDClogin.html# 获取端口Index[root@redhat mibs]# snmpwalk -v 2c 192.168.4.254 -c sdxh 1.3.6.1.2.1.2.2.1.1 IF-MIB::ifIndex.1 = INTEGER: 1IF-MIB::ifIndex.2 = INTEGER: 2IF-MIB::ifIndex.3 = INTEGER: 3# 获取端口列表及其描述[root@redhat mibs]# snmpwalk -v 2c 192.168.4.254 -c sdxh 1.3.6.1.2.1.2.2.1.2 IF-MIB::ifDescr.1 = STRING: FastEthernet0/0# 以下为获取交换机第2个端口(INT E GE R: 2)所连接主机的M AC地址操作例子################################### 步骤 1 ##############################snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.25 1.3.6.1.2.1.17.4.3.1 | grep -w "INTEGER: 2"返回结果:SNMPv2-SMI::mib-2.17.4.3.1.2.0.7.233.63.136.173 = INTEGER: 2################################### 步骤 2 ############################### 从以上步骤1的返回结果获取粗体字"0.7.233.63.136.173" ,并执行以下命令snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.25 1.3.6.1.2.1.17.4.3.1 | grep "0.7.233.63.136.173" | grep "mib-2.17.4.3.1.1"返回结果:SNMPv2-SMI::mib-2.17.4.3.1.1.0.7.233.63.136.173 = Hex-STRING: 00 07 E9 3F 88 AD00 07 E9 3F 88 AD为交换机的第2口所连接的主机网卡地址################################### 步骤 3 ##############################snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.25 1.3.6.1.2.1.17.1.4.1.2 | grep -w "SNMPv2-SMI::mib-2.17.1.4.1.2.2"这里的红色2是步骤1的 INTEGER: 2返回结果:SNMPv2-SMI::mib-2.17.1.4.1.2.2 = INTEGER: 2步骤3中获取到的INTEGER: 2才是对应的IfIndexsnmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.41 1.3.6.1.2.1.17.4.3.1.1snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.41 1.3.6.1.2.1.17.4.3.1.2snmpwalk -v 2c -c Pub_PCon9-CT 192.168.232.41 1.3.6.1.2.1.17.1.4.1.2/en/US/tech/tk648/tk362/technologies_tech_note09186a00801576ff.shtml在华为-H3C设备上启用SNMP服务六、六、在华为在线文档:实验环境:1、开启SNMP-Agent<Huawei> system-view[Huawei]interface g0/0/1[Huawei]acl 2001[Huawei]snmp-agent community write xinhua acl 20013、配置SNMP trap消息[AR2220]snmp-agent target-host trap-hostname mbxb address 192.168.4.231 udp-port 162 trap-paramsname sdxh4、保存配置七、在华为交换机上启用SNMP华为交换机的基本操作:[Huawei]interface vlanif 1[Huawei-Vlanif1]ip address 192.168.1.4 24[Huawei]interface GigabitEthernet0/0/1port link-type access #设置接口的类型-accessport default vlan 1 #设置默认VLANundo shutdown[Huawei]snmp-agent community read xinhua[Huawei]snmp-agent sys-info contact 12345[Huawei]snmp-agent sys-info location jinanshi[Huawei]snmp-agent sys-info version all[Huawei]snmp-agent target-host trap address udp-domain 192.168.1.230 udp-port 162 params securityname xinhua [Huawei]snmp-agent trap enable。

如何使用路由器的SNMP功能

如何使用路由器的SNMP功能

如何使用路由器的SNMP功能路由器(router)是一种常见的网络设备,可以在不同的网络之间转发数据包。

网络管理员通常使用SNMP(Simple Network Management Protocol,简单网络管理协议)来监视和管理路由器的性能和状态。

本文将介绍如何使用路由器的SNMP功能。

一、SNMP简介SNMP是一种基于Internet标准协议的网络管理协议,用于监控网络设备和服务器的性能和状态。

SNMP包含多个版本,其中最常用的是SNMPv2c和SNMPv3。

SNMPv2c协议使用社区名称(community name)来认证和授权管理请求,而SNMPv3协议使用更强的认证和授权机制,如用户名和密码(user name and password)和/或数字证书(digital certificate)。

二、启用SNMP功能大多数路由器都具有内置的SNMP功能。

启用SNMP功能前,您需要了解以下内容:1. 路由器的SNMP版本和相关参数;2. 路由器可能支持的SNMP管理工具;3. 路由器的管理IP地址和SNMP读写(read/write)访问权限。

假设您的路由器支持SNMPv2c协议,您可以按照以下步骤启用SNMP功能:1. 登录到路由器的Web管理界面;2. 在管理界面中找到SNMP配置页面(通常在“高级设置”或“管理”菜单下);3. 配置SNMP社区名称和读写(read/write)访问权限;4. 点击“保存”按钮。

成功启用SNMP功能后,您可以使用SNMP管理工具来监视和管理路由器的性能和状态。

三、使用SNMP管理工具SNMP管理工具可用于监视和管理路由器的性能和状态。

以下是使用SNMP管理工具的一些基本步骤:1. 安装SNMP管理工具,如Cacti、MRTG或SolarWinds等;2. 配置SNMP管理工具的社区名称和管理IP地址;3. 添加路由器到SNMP管理工具中;4. 执行SNMP管理任务,如获取路由器的CPU使用率、内存使用情况、接口状态等。

网络设备及linux主机snmp

网络设备及linux主机snmp

一.网络设备及服务器设备纳入综合运维平台所需具备条件如下1、被纳管设备到运维平台网络通,即在运维平台服务器能够ping通被纳管设备。

2、被纳管设备需要开启SNMP协议,且网络策略需要放行UDP 161端口。

3、snmp协议团体字定义为“”二、网络设备开启snmp协议参考命令1、锐捷网络设备配置SNMP:ruijie>enableruijie#conf truijie(config)#snmp-server community zbt155@2018 ro ---配置本路由器的只读字串为chinacoal2、华三网络设备配置SNMP:在系统视图模式下:启用SNMP协议:snmp-agent开启SNMP协议相应版本:snmp-agent sys-info version all配置只读团体字:snmp-agent community read chinacoal ---配置本路由器的只读字串为chinacoal3、华为网络设备配置SNMP:在系统视图模式下:启用SNMP协议:snmp-agent开启SNMP协议相应版本:snmp-agent sys-info version all配置只读团体字:snmp-agent community read chinacoal ---配置本路由器的只读字串为chinacoal4、防火墙可登陆相应命令行模式配置或登陆web页面进行配置,具体请联系防火墙厂商协助。

三、linux主机开启snmp协议方法1、 Centos服务器snmp协议开启:修改共同体名称: vi /etc/snmp/snmpd.conf对其进行配置如下;A、修改默认的community string (标红位置)com2sec notConfigUser default shenhuaCentOS_ruijiesnmp_roB、把下面的#号去掉:#view mib2 included .dod.internet.mgmt.mib-2 fcaccess notConfigGroup " " any noauth exact mib2 none noneC、第二步,将如下位置的systemview改为all(标红位置),如下:##### 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 noneaccess notConfigGroup "" any noauth exact all none noneD、将如下标红行前面的注释去掉,如下:## incl/excl subtree maskview all included .1 80## -or just the mib2 tree-view mib2 included .dod.internet.mgmt.mib-2 fcE、将下面标红行前的注释去掉,如下#access notConfigGroup "" any noauth exact roview rwview none access notConfigGroup "" any noauth exact mib2 none none启动snmpd,并设置开机自动启:#service snmpd restart#chkconfig --level 345 snmpd on若有防火墙,添加如下防火墙策略:iptables -A RH-Firewall-1-INPUT -p udp -m udp --dport 161 -j ACCEPT2 Linux 服务器snmp协议开启:修改共同体名称: vi /etc/snmp/snmpd.conf对其进行配置如下:A、修改默认的community stringcom2sec notConfigUser default shenhuaLinux_ruijiesnmp_roB、把下面的#号去掉#view mib2 included .dod.internet.mgmt.mib-2 fcaccess notConfigGroup " " any noauth exact mib2 none none启动snmp:/etc/rc.d/init.d/snmpd restart若有防火墙,添加如下防火墙策略:iptables -A RH-Firewall-1-INPUT -p udp -m udp --dport 161 -j ACCEPT。

12-网络管理和监控配置指导-SNMP配置

12-网络管理和监控配置指导-SNMP配置

目录1 SNMP ························································································································· 1-11.1 SNMP简介 ··············································································································· 1-11.1.1 SNMP的网络架构······························································································ 1-11.1.2 MIB和MIB视图 ································································································ 1-21.1.3 SNMP基本操作································································································· 1-21.1.4 SNMP版本介绍································································································· 1-21.1.5 SNMP支持的访问控制方式·················································································· 1-31.2 配置SNMP基本参数··································································································· 1-31.2.1 配置SNMPv1/v2c版本基本参数 ··········································································· 1-31.2.2 配置SNMPv3版本基本参数················································································· 1-51.3 配置SNMP日志········································································································· 1-91.4 配置SNMP告警········································································································· 1-91.4.1 开启告警功能···································································································· 1-91.4.2 配置告警信息发送参数······················································································ 1-101.5 SNMP显示和维护 ···································································································· 1-111.6 SNMPv1/v2c典型配置举例························································································· 1-121.7 SNMPv3典型配置举例 ······························································································ 1-141 SNMP设备运行于FIPS 模式时,本特性部分配置相对于非FIPS 模式有所变化,具体差异请见本文相关描述。

SNMP服务的配置

SNMP服务的配置

SNMP服务的配置Windows系统下SNMP服务配置的操作说明:首先在Windows的控制面板里“添加删除程序”里,添加Windows组件。

在Windows 列表里选择“管理和监视工具”,点“详细情况”,将“简单网络管理协议”选择上,然后“下一步”,进行安装。

安装SNMP组件时候需要系统安装盘,也可以指定操作系统文件的网络路径安装。

SNMP组件装好后,进行如下的设置:1.从系统桌面上“开始”菜单里选择:开始->设置->控制面版->管理工具,打开管理工具,找到“服务”菜单并打开。

2.从服务列表里找到“SNMP Service”,按右键选择“属性”,对snmp服务进行配置。

选择“属性”后出现如下配置页面:在“常规”这个选项里,保持原来的设置不变。

选择“登录”选项,显示如下页面,并保持缺省值不变。

选择“恢复”选项,出现如下页面,保持缺省值不变选择“代理”选项,出现如下页面,保持缺省值不变。

选择“陷井”,出现如下页面。

在团体名称里,填写上团体名称,比如nxepc-public,这是为了在配置监控系统时提供相应的community。

在陷井目标里,填写完类似于“nxepc-public”的团体名称后,点“添加到列表”,然后界面显示成如下状态:然后在“陷井目标”下,点“添加”按钮,出现如下输入框:在输入页面上填写监控服务器所在的地址,目前服务器所在地址为“10.216.2.248”。

填写完点“添加”按钮,此窗口关闭,原来窗口显示如下:点“安全”菜单,出现如下页面:在“接受团体名称”区域内,点“添加”按钮,出现如下页面:刚刚在“陷井”页面内输入的团体名称“nxepc-public”会自动出现在这个页面的“团体名称”里,不做任何改变,保持“团体权利”为“只读”。

点“添加”按钮,此窗口自动关闭,回复到如下页面:为了安全起见,把上页面的中下面一个区域内的选项选择到“接受来自这些主机的SNMP 包”。

如何设置路由器SNMP

如何设置路由器SNMP

如何设置路由器SNMP在企业网络环境中,路由器是网络通信的关键设备,它们可以控制数据包流向、决策最佳路径、管理网络流量等。

但是,当网络规模不断扩大时,对路由器进行实时监控变得越来越困难。

这时候,SNMP (简单网络管理协议)就能发挥它的重要作用。

本文将介绍如何设置路由器SNMP以及如何使用SNMP监控路由器。

一、了解SNMP1.1 SNMP的概念和作用SNMP是一种用于网络管理的协议,它可以监控许多不同类型的设备,包括路由器、交换机、打印机、服务器等。

SNMP协议是标准协议,已经得到广泛应用。

SNMP的主要作用是收集、分析和管理网络设备的状态信息,并提供通知和警告,使得管理员可以及时诊断和解决问题。

1.2 SNMP的工作原理SNMP基于C/S架构,主要包括三个组件:管理系统、代理和管理信息库。

其中,管理系统是指用于监控设备的软件系统,代理是指嵌入设备中的软件程序,管理信息库是指代理存储设备状态信息的数据库。

当管理系统需要获取设备状态信息时,它会向代理发送请求。

代理会根据请求从管理信息库中检索相应信息,并将信息返回给管理系统。

当代理监测到设备状态异常时,它会向管理系统发送通知或警报。

二、设置路由器SNMP2.1 收集路由器信息在设置路由器SNMP之前,需要先收集路由器信息。

可以通过以下命令在路由器上收集信息:show version # 显示路由器版本信息show running-config # 显示当前路由器配置信息show snmp # 显示SNMP配置信息此外,可以在路由器的官方网站上找到SNMP相关的文档和配置指南。

2.2 配置SNMP配置路由器SNMP需要设置SNMP版本、SNMP团体字符串和SNMP管理系统IP地址。

SNMP版本可以设置为SNMPv2c或SNMPv3。

SNMP团体字符串是一种安全特性,用于确保只有获得该字符串的SNMP管理系统才能访问设备。

SNMP管理系统IP地址是指用于获取设备状态信息的计算机的IP地址。

linux和windows的SNMP配置方法

linux和windows的SNMP配置方法
2/4
[root@ ]# rpm –ivh net-snmp-xxx.rpm
或者
[root@ ]#yum install net-snmp
(3)安装后打开默认的/etc/snmp/snmpd.conf 文件,更改如下配置:
1) 查找以下代码:
# source
1/4
然后重启 snmp 服务即可生效 2、 Linux 系统可以装 rpm 包或源码编译(如果你的系统已安装直接跳到第(3)步) (1)源码编译安装 net-snmp
[root@]# tar zxvf net-snmp-xxx.tar.tar [root@ ]# cd net-snmp-xxx [root@ net-snmp-xxx]# ./configure [root@ ]# make [root@ ]# make install (2)rpm 包安装 net-snmp(安装系统盘里可以找到)
将"read"字段改为 all.
修改后:access notConfigGroup "" any noauth exact all none none
3) 查找以下代码:
3/4

#view all included .1 80 将该行前面的"#"去掉. 保存关闭. 4) 运行/etc/init.d/snmpd start 命令运行 snmpd.或 service snmpd start. 5) 如果有防火墙,打开 UDP 161 端口。 最后运行 netstat -ln 查看 161 端口是否打开了. 使用 ntsysv,让 snmp 服务,每次开机自动运行。 排错 在 cacti 监控管理工作站上 1. 首先检查一下 rra/下面,有没有数据 2. snmpwalk -v 2c -c public ServerIP if 用来测试被控对象(serverIP)是否开启了 SNMP 服务 3. snmpwalk -v 2c ServerIP -c public .1.3.6.1.4.1.2021.10.1.3 查看被控端是否有 CPU 负载的数据返回 4. php /var/www/html/poller.php 用来测试 PHP 是否可以采集到数据。
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

SNMP配置模板
一.中兴交换机系列
1.1中兴28系列(2852)
conf snmp
create community IDCI-SYSJ public
create view AllView
set community public view AllView
set community IDCI-SYSJ view AllView
set host 85.60.16.17 trap v2c IDCI-SYSJ
set trap all enable
exit
1.2中兴39、59、89系列
snmp-server trap-source 3.9.9.2
snmp-server community IDCI-XNXJ view AllView ro
snmp-server host 3.9.9.253 trap version 2c IDCI-XNXJ udp-port 162 snmp-server enable trap
exit
二.迈普系列
2.1迈普3840
conf t
snmp-server community IDCI-XNXJ view default ro
snmp-server trap-source 3.9.9.1
snmp-server host 3.9.9.253 traps community IDCI-XNXJ version 2 snmp-server enable traps
snmp-server start
exit
2.2迈普4152S
conf t
snmp-server enable
snmp-server trap-source 3.9.9.3(网口地址)
snmp-server securityip disable
snmp-server host 3.9.9.253 v2c IDCI-XNXJ
snmp-server community ro IDCI-XNXJ
snmp-server enable traps
2.3迈普6800、7500、7600
conf t
snmp-server community IDCI-YYSJ view default ro
snmp-server trap-source 3.0.0.3
snmp-server host 3.0.0.253 traps community IDCI-YYSJ version 2
snmp-server enable traps
三.H3C(华为)系列
3.1H3C(华为)
sy
snmp-agent
snmp-agent community read IDCI-YXXJ
snmp-agent sys-info version v2c v3
snmp-agent target-host trap address udp-domain 85.72.88.240 params securityname I DCI-YXXJ v2c
snmp-agent trap source vlan-interface 1000(可以为VLAN、端口、地址等)
qu
save
四.锐捷系列
4.1锐捷交换机
conf t
snmp-server trap-source ip 85.20.16.2
snmp-server host 85.20.16.46 traps version 2c IDCI-CSSJ
snmp-server enable traps
snmp-server community IDCI-CSSJ ro
exit
五.天融信防火墙
5.1天融信防火墙
通过WEB方式登录到防火墙,在网络管理下面找到SNMP,添加共同体串等相关信息即可,配置如下图:
六.方正防病毒网关
6.1方正防病毒网关
通过WEB登录到方正防病毒网关,修改共同体串等相关参数,具体配置方法事下图:
七.主机服务器系列
7.1WINDOWS系列
7.1.1在目标windows服务器上安装SNMP 代理
依次点击“开始”,“控制面板”,“添加或删除程序”,“添加/删除Windows组件”。

按后面图片提示进行后续配置。

在后面按windows提示完成组件安装。

7.1.2在目标服务器上设置代理
单击“开始”,单击“运行”,键入 services.msc,然后单击“确定”。

按后面图片提示进行后续配置。

重复上面的步骤,可以添加多个团体名称。

7.1.3在目标windows2003服务器上打开监控系统需要连接的端口
单击“开始”,单击“运行”,键入 gpedit.msc,然后单击“确定”。

按后面图片提示进行后续配置。

7.2LINUX系列
7.2.1检查snmp安装是否成功
执行rpm -qa|grep snmp,查看安装的snmp包;
#rpm -qa|grep snmp
7.2.29、修改snmp配置文件
配置snmp文件,/etc/snmp/snmpd.conf;
vi /etc/snmp/snmpd.conf
7.2.310、检查snmp是否已启动
#ps -ef |grep snmp
7.2.412、重启snmp服务
#/etc/init.d/snmpd restart
7.2.513、设置snmp服务开启自启动
#chkconfig snmpd on
7.2.614、查看snmp服务自启动是否设置成功
#chkconfig --list |grep snmpd
7.2.715、配置防火墙
#iptables -I INPUT -p udp --dport 161 -j ACCEPT 7.2.816、保存防火墙配置
#service iptables save
7.2.918、查看161端口是否放开
#iptables -L -n。

相关文档
最新文档