网络、服务器等相关设备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。
h3c交换机snmp配置、h3c交换机开启snmp、h3csnmp配置实例

h3c交换机snmp配置、h3c交换机开启snmp、h3csnmp配置实例有时候处于⽹络管理的需要,我们需要开启交换机的snmp功能,本⽂以H3C交换机为例,具体加以说明:# 设置SNMP基本信息,包括版本、团体名。
system-view[Sysname] snmp-agent sys-info version v1 v2c[Sysname] snmp-agent community read public[Sysname] snmp-agent community write private# 设置交换机的联系⼈和位置信息,以⽅便维护。
[Sysname] snmp-agent sys-info contact Mr.Wang-Tel:3306[Sysname] snmp-agent sys-info location telephone-closet,3rd-floor# 允许向⽹管⼯作站(NMS)1.1.1.2/24发送Trap报⽂,使⽤的团体名为public。
[Sysname] snmp-agent trap enable[Sysname] snmp-agent target-host trap address udp-domain 1.1.1.2 params securityname public v1snmp-agent target-host命令中的指定的版本必须和NMS上运⾏的SNMP版本⼀致,如果NMS上运⾏的是SNMP v2c版本,则需要将snmp-agent target-host命令中的版本参数设置为v2c。
否则,⽹管站将收不到Trap信息。
详细命令如下(以下仅供参考)1.启动/关闭SNMP Agent服务在系统视图模式下:启⽤:snmp-agent关闭:undo snmp-agent注:缺省情况下snmp agent是关闭的2. 使能或禁⽌SNMP相应版本在系统视图下:使能SNMP协议相应版本:snmp-agent sys-info version v1Snmp-agent sys-info version v2cSnmp-agent sys-info version v3Snmp-agent sys-info version all禁⽌SNMP协议相应版本:undo snmp-agent sys-info version v1Undo snmp-agent sys-info version v2cUndo sump-agent sys-info version v3Undo sump-agent sys-info version all\注:缺省情况下为 snmp v33. 配置团体名(community name)Snmpv1 snmpv2 采⽤团体名认证,于设备认可的团体名不符的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。
网络设备及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。
网络、服务器等相关设备SNMP配置指南

SNMP配置模板一.中兴交换机系列1.1中兴28系列(2852)conf snmpcreate community IDCI-SYSJ publiccreate view AllViewset community public view AllViewset community IDCI-SYSJ view AllViewset host 85.60.16.17 trap v2c IDCI-SYSJset trap all enableexit1.2中兴39、59、89系列snmp-server trap-source 3.9.9.2snmp-server community IDCI-XNXJ view AllView rosnmp-server host 3.9.9.253 trap version 2c IDCI-XNXJ udp-port 162 snmp-server enable trapexit二.迈普系列2.1迈普3840conf tsnmp-server community IDCI-XNXJ view default rosnmp-server trap-source 3.9.9.1snmp-server host 3.9.9.253 traps community IDCI-XNXJ version 2 snmp-server enable trapssnmp-server startexit2.2迈普4152Sconf tsnmp-server enablesnmp-server trap-source 3.9.9.3(网口地址)snmp-server securityip disablesnmp-server host 3.9.9.253 v2c IDCI-XNXJsnmp-server community ro IDCI-XNXJsnmp-server enable traps2.3迈普6800、7500、7600conf tsnmp-server community IDCI-YYSJ view default rosnmp-server trap-source 3.0.0.3snmp-server host 3.0.0.253 traps community IDCI-YYSJ version 2 snmp-server enable traps三.H3C(华为)系列3.1H3C(华为)sysnmp-agentsnmp-agent community read IDCI-YXXJsnmp-agent sys-info version v2c v3snmp-agent target-host trap address udp-domain 85.72.88.240 params securityna me IDCI-YXXJ v2csnmp-agent trap source vlan-interface 1000(可以为VLAN、端口、地址等)qusave四.锐捷系列4.1锐捷交换机conf tsnmp-server trap-source ip 85.20.16.2snmp-server host 85.20.16.46 traps version 2c IDCI-CSSJsnmp-server enable trapssnmp-server community IDCI-CSSJ roexit五.天融信防火墙5.1天融信防火墙通过WEB方式登录到防火墙,在网络管理下面找到SNMP,添加共同体串等相关信息即可,配置如下图:六.方正防病毒网关6.1方正防病毒网关通过WEB登录到方正防病毒网关,修改共同体串等相关参数,具体配置方法事下图:七.主机服务器系列7.1W INDOWS系列7.1.1在目标windows服务器上安装SNMP 代理依次点击“开始”,“控制面板”,“添加或删除程序”,“添加/删除Windows组件”。
如何设置路由器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地址。
snmp配置方法哈

SNMP服务器搭建1服务器端配置本111服务器搭建基于Windows Server 2008 R2操作系统。
1.1角色添加打开服务器的“服务器管理器”,在“功能”选项里面点击“添加功能”,如图1 所示。
在弹出的“添加功能向导”对话框里面选择SNMP服务,单击下一步。
后续操作按照默认选项即可安装成功,为服务器添加了SNMP服务功能。
图11.2服务器端SNMP服务设置添加好SNMP服务功能后需要对服务器的SNMP服务进行一些配置才能正常使用,配置SNMP服务参数是通过对“服务器管理器” →“配置” →“服务”选项里面的SNMP Service服务进行设置来完成的。
如图2。
图2服务器的SNMP Service属性设置见图2所示。
需要添加接受的社区名称与权限,并勾选“接受来自任何主机的SNMP数据包”,如果只想让某一个客户端登录也可以手动指定接收到主机列表。
编辑完此项后服务器端配置完成。
2客户机配置客户端需要安装相应的SNMP软件才能连接SNMP服务器,下面演示在Windows 7中使用Mib Browser软件来完成SNMP配置。
在SNMP协议属性设置中必须指定读写团体字(Read/Set community)设置,如图3。
其中,public与private为Mib Browser软件的默认设置,要求服务器端必须有这两个用户,如果服务器端是其他用户名,则需要手动修改此参数。
图3Windows Server 2008 R2使用10.205.60.150 IP地址,客户端连接后对其进行Walk操作即可验证SNMP环境是否搭建成功,图4演示了Walk的结果,从获取的服务器主机名可以看出,客户端已经成功获取了服务器的名称。
图4图5中查询了服务器端的相应参数,说明客户端获取的信息是此服务器对应的内容,到此基本的SNMP服务器与客户端配置完成。
常见网络设备SNMP配置指南

错误!未找到引用源。
文档说明本文档目的是为了推进互相交流学习使用,具体配置根据实际环境为准,本文档仅供参考!目录1文档说明 (5)1.1字体约定 (5)2交换机部分 (6)2.1RuiJie/Cisco交换机 (6)2.1.1SNMP配置 (6)2.1.2TRAP配置 ....................................................................... 错误!未定义书签。
2.1.3Syslog配置....................................................................... 错误!未定义书签。
2.2华为/H3C交换机 (6)2.2.1SNMP配置 (7)2.2.2TRAP配置 ....................................................................... 错误!未定义书签。
2.2.3Syslog配置....................................................................... 错误!未定义书签。
2.3ZTE交换机 (7)2.3.1SNMP配置 (8)2.3.2TRAP配置 ....................................................................... 错误!未定义书签。
2.3.3Syslog配置....................................................................... 错误!未定义书签。
3路由器部分 (9)3.1RuiJie/Cisco路由器 (9)3.1.1SNMP配置 (9)3.1.2TRAP配置 ....................................................................... 错误!未定义书签。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 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
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、端口、地址等)
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。