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配置1.1概述SNMP是Simple Network Manger Protocol(简单网络管理协议)的缩写,在1988年8月就成为一个网络管理标准RFC1157。

到目前,因众多厂家对该协议的支持,SNMP已成为事实上的网管标准,适合于在多厂家系统的互连环境中使用。

利用SNMP协议,网络管理员可以对网络上的节点进行信息查询、网络配置、故障定位、容量规划,网络监控和管理是SNMP的基本功能。

SNMP是一个应用层协议,为客户机/服务器模式,包括三个部分:●SNMP网络管理器●SNMP代理●MIB管理信息库SNMP网络管理器,是采用SNMP来对网络进行控制和监控的系统,也称为NMS(Network Management System)。

常用的运行在NMS上的网管平台有HPOpenView 、CiscoView、CiscoWorks 2000,锐捷网络针对自己的网络设备,开发了一套网管软件--Star View。

这些常用的网管软件可以方便的对网络设备进行监控和管理。

SNMP代理(SNMP Agent)是运行在被管理设备上的软件,负责接受、处理并且响应来自NMS的监控和控制报文,也可以主动发送一些消息报文给NMS。

NMS和Agent的关系可以用如下的图来表示:图1 网络管理站(NMS)与网管代理(Agent)的关系图MIB(Management Information Base)是一个虚拟的网络管理信息库。

被管理的网络设备中包含了大量的信息,为了能够在SNMP报文中唯一的标识某个特定的管理单元,MIB采用树形层次结构来描述网络设备中的管理单元。

树的节点表示某个特定的管理单元。

如下图MIB对象命名树,为了唯一标识网络设备中的某个管理单元System,可以采用一串的数字来表示,如{1.3.6.1.2.1.1}这一串数字即为管理单元的Object Identifier(单元标识符),MIB则是网络设备的单元标识符的集合。

SNMP配置说明

SNMP配置说明

SNMP配置说明一.配置说明修改配置文件的目的是为了添加代理用户1.MIB version说明:net-snmp代理支持v1, v2c, v3版本,可根据管理侧的版本信息自适应回复相同版本格式的回复。

无需配置。

Mib节点项:无2.Trap community说明:trap共同体,适用于v1/v2c版本。

管理侧侧只有在配置了相同的参数后才能接收到trap.配置方法:trapsink localhost public 162trap2sink 172.18.100.148 public 162以上两条配置项中,共同体名均为public。

其中第一条配置项适用于发送v1版本trap,第二条配置项适用于发送v2c版本trapMib节点项:无3.RO/RW community说明:只读/读写共同体,适用于v1/v2c版本。

管理侧和代理侧在配置了相同的共同体参数后,管理侧才可以对代理侧进行读取或者设置操作。

配置方法:com2sec get default publiccom2sec set default netman只读共同体设置为public, 读写共同体设置为netman。

此配置需要与group和access配置共同使用实现只读/读写功能。

Mib节点项:无4.SNMP Engine ID说明:SNMP引擎标识,适用于v3版本。

SnmpEngineID值可指定也通过某种算法计算得到,目的是为了标识唯一一个SNMP实体。

在net-snmp中是通过计算生成的,使用如下的方法:SnmpEnglineID长度为12个字节,最高bit设置为1,表示使用框架定义的方法(如果为0表示企业定义)。

前4个字节设为生产代理的企业标识(prvate.enterprise下的企业标识,同IANA分配),如ECI的企业标识为1286。

其他8个字节通过使用IP地址并在地址后面增补随机数来确定。

配置方法:修改net-snmp源代码,将NETSNMP_ENTERPRISE_OID更改为1286.Mib节点项:snmpEngineID(1.3.6.1.6.3.10.2.1.1)5.View name, oid name, include说明:VACM配置相关,适用于v1/v2c/v3版本。

SNMP的配置

SNMP的配置

SNMP(Simple Network Management Protocol,简单网络管理协议)首先是由IETF的研究小组为了解决Internet上的路由器管理问题而提出的。

SNMP的设计原则是简单性和扩展性。

简单性是通过信息类型限制、请求响应或协议而取得。

扩展性是通过将管理信息模型与协议、被管理对象的详细规定(MIB)分离而实现的。

网络管理体系结构SNMP的网络管理模型包括以下关键元素:管理站、代理者、管理信息库、网络管理协议。

管理站一般是一个分立的设备,也可以利用共享系统实现。

管理站作为网络管理员与网络管理系统的接口,它的基本构成为:一组具有分析数据、发现故障等功能的管理程序; 一个用于网络管理员监控网络的接口; 将网络管理员的要求转变为对远程网络元素的实际监控的能力; 一个从所有被管网络实体的MIB中抽取信息的数据库。

网络管理系统中另一个重要元素是代理者。

装备了SNMP的平台,如主机、网桥、路由器及集线器均可作为代理者工作。

代理者对来自管理站的信息请求和动作请求进行应答,并随机地为管理站报告一些重要的意外事件。

网络资源被抽象为对象进行管理。

但SNMP中的对象是表示被管资源某一方面的数据变量。

对象被标准化为跨系统的类,对象的集合被组织为管理信息库(MIB)。

MIB作为设在代理者处的管理站访问点的集合,管理站通过读取MIB中对象的值来进行网络监控。

管理站可以在代理者处产生动作,也可以通过修改变量值改变代理者处的配置。

管理站和代理者之间通过网络管理协议通信,SNMP通信协议主要包括以下能力。

Get:管理站读取代理者处对象的值。

Set:管理站设置代理者处对象的值。

Trap:代理者向管理站通报重要事件。

在标准中,没有特别指出管理站的数量及管理站与代理者的比例。

一般地,应至少要有两个系统能够完成管理站功能,以提供冗余度,防止故障。

网络管理协议环境SNMP为应用层协议,是TCP/IP协议族的一部分。

它通过用户数据报协议(UDP)来操作。

SNMP配置手册

SNMP配置手册

S N M P配置手册(总22页) -CAL-FENGHAI.-(YICAI)-Company One1-CAL-本页仅作为文档封面,使用请直接删除1交换机部分1.1Cisco交换机使用以下配置命令前,均需要执行以下步骤:1.登陆交换机。

(可以使用串口线直接连接,如果交换机配置有管理IP 并且允许telnet登陆,则也可以通过telnet进行登陆。

)2.输入enable命令进入特权模式。

3.输入config terminal进行配置模式。

使用完配置命令后,均需要执行以下步骤进行保存:1.输入end命令退出配置模式。

2. copy running start保存配置文件。

1.1.1SNMP配置1.配置snmp 只读communitysnmp-server community public ro配置交换机的只读community为public2.配置snmp 读写communitysnmp-server community public rw配置交换机的读写community为public1.1.2TRAP配置1.配置交换机允许发送trapsnmp-server enable traps2.配置交换机接收trap的主机snmp-server host traps public指定交换机SNMP Trap的接收者为,发送Trap时采用public作为字串1.1.3Syslog配置1.打开交换机的syslog功能logging on2. 直接配置相应的syslog发送到的接收主机,为该主机的ip地址。

logging3.配置发送syslog的主机格式类型。

logging facility local44.选择发送warning以上级别的log信息。

logging trap warnings1.2 华为交换机使用以下配置命令前,均需要执行以下步骤:1.登陆交换机。

(可以使用串口线直接连接,如果交换机配置有管理IP 并且允许telnet登陆,则也可以通过telnet进行登陆。

SNMP配置手册

精心整理1交换机部分1.1Cisco交换机使用以下配置命令前,均需要执行以下步骤:1.登陆交换机。

(可以使用串口线直接连接,如果交换机配置有管理IP并且允许telnet登陆,则也可以通过telnet进行登陆。

)231212配置交换机的读写community为public1.1.2TRAP配置1.配置交换机允许发送trapsnmp-serverenabletraps2.配置交换机接收trap的主机snmp-serverhosttraps public指定交换机SNMPTrap的接收者为,发送Trap时采用public作为字串1.1.3Syslog配置1.打开交换机的syslog功能2.341.21登2.输入system命令进入配置模式。

使用完配置命令后,均需要执行以下步骤进行保存:1.输入return命令退出配置模式。

2.Save保存配置文件。

1.2.1SNMP配置1.启用SNMPsnmp-agent2.配置snmp协议的版本号snmp-agentsys-infoversionall上面的命令是指对SNMPV1、V2C、V3都支持。

3.配置snmp只读community41.2.2TRAP121.2.3Syslog配置1.启用交换机的syslog功能info-centerenable2.指定接收syslog的主机,为该主机的ip地址。

info-centerloghostlanguageEnglish以上命令是配置接收syslog,syslog的语言为英文。

3.选择发送warning以上级别的syslog信息。

info-centersourcedefaultchannelloghostloglevelwarning1.3中兴交换机1.登2.3.1.1.3.1SNMP1snmp-serverviewAllViewinternetincludedsnmp-serverviewtestzxr10IPAddrTableincludedsnmp-serverviewtestzteincludedsnmp-serverviewtestmib-2included1.3.2TRAP配置1.配置交换机允许发送trapsnmp-serverenabletrap2.配置交换机接收trap的主机snmp-serverhosttrapversion2cpublic1.3.3Syslog12.3.2在操作系统缺省的SNMP团体名。

路由器的SNMP配置指南

路由器的SNMP配置指南SNMP(Simple Network Management Protocol)是一种TCP/IP协议,它允许网络管理系统与连接在网络上的设备之间通信。

SNMP可以用于路由器的远程管理和监控。

本文将介绍如何配置SNMP,以及如何使用SNMP进行路由器的监控和管理。

一、SNMP基本概念SNMP是一种网络管理协议,用于监测网络设备的状态和性能。

SNMP包括三个组件:管理器、代理和MIB。

- 管理器:监测网络中的设备,并从这些设备中收集信息。

管理器可以通过SNMP查询设备的状态、配置和性能等信息。

- 代理:响应管理器的请求,并提供管理器所需要的数据。

代理还可以将设备的状态和性能信息报告给管理器。

- MIB(管理信息库):包含了所有可以被SNMP管理器访问的对象的信息。

每个对象都由一个唯一的标识符来识别。

二、配置SNMPSNMP可以通过路由器的命令行界面(CLI)或者路由器的Web界面来配置。

CLI是更常用的一种方法,因为它更加灵活和强大。

以下是一些基本的SNMP配置:1. 开启SNMP服务首先,需要在路由器上开启SNMP服务。

使用下面的命令来开启SNMP服务:Router(config)#snmp-server engineID remote 1.3.6.1.4.1.8072.99992. 配置团体名团体名是SNMP中的一个重要概念,它用于标识允许访问SNMP的设备。

使用下面的命令来配置团体名:Router(config)#snmp-server community public RO在上面的命令中,public是团体名,RO表示只读权限。

如果需要设置读写权限,则使用如下命令:Router(config)#snmp-server community private RW在上面的命令中,private是团体名,RW表示读写权限。

3. 配置SNMP目标SNMP目标是SNMP代理,它用于接收SNMP请求并返回SNMP 响应。

华为交换机 01-01 SNMP配置

1.2 设备支持的SNMP特性 本节通过对SNMP协议各个版本的对比,以及应用场景的介绍,为用户进行网络部署时 选取SNMP版本提供参考依据。
1.3 缺省配置 介绍系统常见参数的缺省配置。
1.4 配置设备使用SNMPv1与网管通信 配置SNMPv1功能后,网管和设备之间将使用SNMPv1进行通信。为了保证网管和设备 之间的正常通信,需要配置网管侧和Agent侧,本节只介绍Agent侧的配置,网管侧的 配置请参考网管的操作手册。
版权所有 © 华为技术有限公司
3
S2700, S3700 系列以太网交换机 配置指南-网络管理
1 SNMP 配置
表 1-3 SNMP 各版本的应用场景
版本
应用场景
SNMPv1 适用于小型网络,组网简单,对网络安全性要求不高或者网络环境本身 比较安全,且比较稳定的网络,比如校园网,小型企业网。
SNMPv2 c
错误码
错误码用来标识特定的故障现象,有助于管理员快速定位和解决故障, 因此错误码越丰富越有利于管理员对设备进行管理。
文档版本 07 (2020-04-15)
版权所有 © 华为技术有限公司
2
S2700, S3700 系列以太网交换机 配置指南-网络管理
1 SNMP 配置
特性
功能描述
Trap告警
Trap告警是被管理设备主动向网管发送告警。以便管理员能够及时发现 设备的异常。
说明
NMS上配置的团体名需和Agent上配置的团体名保持一致,否则NMS将无法访问Agent。
步骤5 执行命令snmp-agent target-host trap address udp-domain ip-address [ udpport port-number ] [ source interface-type interface-number ] [ public-net | vpninstance vpn-instance-name ] params securityname { security-name | cipher security-name } [ v1 ] [ ext-vb ],配置设备发送告警和错误码的目的IP地址。

snmp交换机配置

华为交换机
1、查询交换机当前是snmp配置命令
dis cur
2、进入全局模式 int ethernet1/0/7 shutdown 关 undoshutdown 激活
sys
6、保存 save
中兴交换机
1、进入配置模式
enable
2、进入snmp配置模式
config snmp
3、设置读取管理字符串
create community XXXX public
4、设置视图
create view zteview
5、设置字符串和视图关系
3、进入SNMP配置
snmp-agent
4、配置只读字符串snmp-agent community read abcd
5、配置写字符串snmp-agent community write abcd
6、开启snmp版本支持功能 snmp-agent sys-info version all
set community XXXX view zteview
6、保存
save config
7、退出
exit
8、查看snmp是否正常
show snmp community
锐捷交换机
1、进入特权模式
enable
2、进入全局配置模式
config terminal
3、设置读写ห้องสมุดไป่ตู้限
snmp-server community ruije rw
4、结束配置
end
5、确认配置是否正确,并保存
write
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Cisco snmp配置:思科一:设置IOS设备在IOS的Enable状态下,敲入config terminal 进入全局配置状态Cdp run 启用CDPsnmp-server community gsunion ro 配置本路由器的只读字串为gsunion snmp-server community gsunion rw 配置本路由器的读写字串为gsunions nmp-server enable traps 允许路由器将所有类型SNMP Trap发送出去snmp-server host IP-address-server traps trapcomm 指定路由器SNMP Trap 的接收者为10.238.18.17,发送Trap时采用trapcomm作为字串snmp-server trap-source loopback0 将loopback接口的IP地址作为SNMP Trap 的发送源地址logging on 起动log机制logging IP-address-server 将log记录发送到10.238.18.17 (CW2K安装机器的IP地址)上的syslog serverlogging facility local7 将记录事件类型定义为local7logging trap warning 将记录事件严重级别定义为从warningl开始,一直到最紧急级别的事件全部记录到前边指定的syslog server.logging source-interface loopback0 指定记录事件的发送源地址为loopback0的IP地址service timestamps log datetime 发送记录事件的时候包含时间标记enable password ******line tty 0 4password ******login local 设置Enable口令和Telnet口令show runningcopy running start或write terminal 显示并检查配置保存配置配置Cisco设备的SNMP代理配置Cisco设备上的SNMP代理的步骤如下:启用SNMP:configure terminalsnmp-server community rw/ro (example: snmp-server community public ro)endcopy running-configstartup-config启用陷阱:configure terminalsnmp-server enable traps snmp authenticationendcopy running-configstartup-config配置snmp#conf t#snmp-server community cisco ro(只读);配置只读通信字符串#snmp-server community secret rw(读写);配置读写通信字符串#snmp-server enable traps ;配置网关SNMP TRAP#snmp-server host 10.254.190.1 rw ;配置网关工作站地址设置CatOS设备在CatOS的Enable状态下,敲入set interface sc0 VLAN ID IP address 配置交换机本地管理接口所在VLAN ID,IP地址,子网掩码Set cdp enable all 启用CDPset snmp community read-only gsunion 配置本交换机的只读字串为public set snmp community read-write-all gsunion 配置本交换机的读写字串为privateset snmp trap server-ip gsunion指定交换机SNMP Trap的接收者为网管服务器,发送Trap时采用gsunion作为字串set snmp trap enable all 将全部类型的SNMP Trap发送出去set snmp rmon enable 激活交换机的SNMP RMON功能set logging server IP-address-server 将log记录发送到网管服务器的IP (CW2K安装机器的IP地址)上的syslog serverset logging level 6 将记录事件严重级别定义为从informational开始,一直到最紧急级别的事件全部记录到前边指定的syslog serverset logging server facility local7 将记录事件类型定义为local7set logging timestamp 发送记录事件的时候包含时间标记set logging enable 起动log机制set password ******set enablepass ******设置Enable口令和Telnet口令show runningwrite terminal 显示并检查配置保存配置配置PIX设备Logging on 在PIX上面启用日志记录Snmp-server community gsunion 为PIX设备配置共同体串gsunionSnmp-server enable traps 配置PIX设备将SNMP消息发送到网管服务器Snmp-server host server-ip 在PIX设备上面配置SNMP网管服务器Logging history warning为PIX设备SNMP系统日志消息设置warning级别。

华为:1. V1sys进入系统视图, 键入Ctrl+Z退回到用户视图.[Quidway]interface vlan 1[Quidway-Vlan-interface1]ip address 192.168.1.2 24[Quidway-Vlan-interface1]%2000/4/1 23:58:06:914 Quidway IFNET/5/UPDOWN:- 1 -链路协议在接口Vla n-interface1上状态变为UP[Quidway-Vlan-interface1]quit[Quidway]snmp-agent sys-info version v1[Quidway]snmp-agent community ?read 该团体名在指定视图内有只读权限write 该团体名在指定视图内有读写权限[Quidway]snmp-agent community read public[Quidway]snmp-agent community write private[Quidway]snmp-agent trap enable[Quidway]snmp-agent target-host trap address udp-domain 192.168.1.1 u dp-port 5000 params securityname public[Quidway]dis cur2. V2C[Quidway]snmp-agent sys-info version v2c[Quidway]snmp-agent community ?read 该团体名在指定视图内有只读权限write 该团体名在指定视图内有读写权限[Quidway]snmp-agent community read public[Quidway]snmp-agent community write private[Quidway]snmp-agent trap enable[Quidway]snmp-agent target-host trap address udp-domain 192.168.1.1 u dp-port 5000 params securityname public[Quidway]dis cur3. V3 SHA认证dis hissysint vlan 1ip address 192.168.1.2 24quitsnmp-agent sys-info version v3snmp-agent mib-view included pingyangview internetsnmp-agent group v3 pingyanggroup privacy read-view pingyangview wr ite-view pingyangview notify-view pingyangviewsnmp-agent usm-user v3 pingyang pingyanggroup authentication-mode s ha 12345 privacy-mode des56 12345snmp-agent trap enablesnmp-agent target-host trap address udp-domain 192.168.1.1 udp-port 5000 params securityname pingyang v2c[Quidway]dis cur4.V3 MD5认证[Quidway] dis hissysint vlan 1ip address 192.168.1.2 24quitsnmp-agent sys-info version v3snmp-agent mib-view included pingyangview internetsnmp-agent group v3 pingyanggroup privacy read-view pingyangview wr ite-view pingyangview notify-view pingyangviewsnmp-agent usm-user v3 pingyang pingyanggroup authentication-mode m d5 12345 privacy-mode des56 12345snmp-agent trap enablesnmp-agent target-host trap address udp-domain 192.168.1.2 udp-por t 5000 params securityname pingyang v2c[Quidway]dis curH3C一、交换机简单管理协议增加指令----以便接入H3C的管理软件中snmp-agentsnmp-agent community read publicsnmp-agent community write privatesnmp-agent sys-info version v1 v3snmp-agent trap enable神码神码dcr-5526配置如下:!hostname Digitalchina DCRS-5526snmp-server location Chinasnmp-server contact Digitalchina Networks Limited!snmp-server community private rwsnmp-server community public ro!username admin access-level 15username admin password 7 7d7b16c803fd10461c44f8b7db3826fd username guest access-level 0username guest password 7 084e0343a0486ff05530df6c705c8bb4 enable password level 15 7 1b3231655cebb7a1f783eddf27d254ca !。

相关文档
最新文档