Last active
March 27, 2017 03:54
-
-
Save ThinkZ/24d434513fafb22e9b7f2799e3b85be5 to your computer and use it in GitHub Desktop.
about network snmp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
路由器打开方法: | |
snmp-server community crm RO //crm为自定义的共同体名称,常用Public | |
snmp-server trap-source FastEthernet0/3/0 //监控的端口 | |
snmp-server host x.x.x.x crm //在哪台终端(公网地址x.x.x.x)上应用共同体 | |
snmp-server enable traps //启用snmp | |
交换机打开方法 | |
Switch(config)#snmp-server community public ro #设置只读字符串,public为团体名称,ro为只读 | |
Switch(config)#snmp-server enable traps #启用snmp陷井,允许路由器将所有类型SNMP Trap发送出去 | |
Switch(config)#snmp-server enable traps snmp authentication #snmp trap 验证 | |
Switch(config)#snmp-server host *.*.*.* version 2c public #SNMP采用版本2,public作为团体名称 | |
Switch(config)#snmp-server host *.*.*.* traps public #指定SNMP Trap的接收者为192.68.98.166,发送Trap时采用public作为团体名称 | |
Switch(config)#snmp-server trap-source vlan 1 #设置vlan1虚接口IP地址做为为snmp trap信息的发布地址 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h3c路由器开启snmp功能 | |
转载 | |
2015-03-31 11:49:05 | |
[H3C]snmp-agent #H3C默认SNMP是关闭的,需要先开启 | |
[H3C]snmp-agent community read public #设置团体名【public】为可读权限。 | |
[H3C]snmp-agent sys-info version all #设置交换机支持的SNMP协议为所有(All参数还可以使用v1\v2\v3) | |
[H3C]snmp-agent trap enable #允许发送Trap | |
[H3C]snmp-agent target-host trap address udp-domain 10.33.0.100 udp-port 161 params securityname public #配置trap主机的地址和端口 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
在日常监控中,经常会用到snmp服务,而snmpwalk命令则是测试系统各种信息最有效的方法,现总结一些常用的方法如下: | |
1、snmpwalk -c public -v 1 -m ALL 192.168.30.49 .1.3.6.1.2.1.25.1 得到取得windows端的系统进程用户数等 | |
2、snmpwalk -c public -v 1 -m ALL 192.168.30.49 .1.3.6.1.2.1.25.2.2 取得系统总内存 | |
3、snmpwalk -c public -v 1 -m ALL 192.168.30.49 hrSystemNumUsers | |
4、snmpwalk -c public -v 1 -m ALL 192.168.30.49 .1.3.6.1.2.1.4.20 取得IP信息 | |
5、snmpwalk -v 2c -c public 192.168.30.49 system 查看系统信息 | |
6、snmpwalk -v 1 192.168.30.49 -c public ifDescr | |
1、snmpwalk -v 2c -c public 10.103.33.1 .1.3.6.1.2.1.25.1 得到取得windows端的系统进程用户数等 | |
其中-v是指版本,-c 是指密钥,也就是客户端snmp.conf里面所设置的,下面类同. | |
2、snmpwalk -v 2c -c public 10.103.33.1 .1.3.6.1.2.1.25.2.2 取得系统总内存 | |
3、snmpwalk -v 2c -c public 10.103.33.1 hrSystemNumUsers 取得系统用户数 | |
4、snmpwalk -v 2c -c public 10.103.33.1 .1.3.6.1.2.1.4.20 取得IP信息 | |
5、snmpwalk -v 2c -c public 10.103.33.1 system 查看系统信息 | |
6、snmpwalk -v 2c -c public 10.103.33.1 ifDescr 获取网卡信息 | |
以上只是一些常用的信息,snmpwalk功能很多,可以获取系统各种信息,只要更改后面的信息类型即可.如果不知道什么类型,也可以不指定,这样所有系统信息都获取到: | |
snmpwalk -v 2c -c public 10.103.33.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment