1. 前置条件:
完成gcmonitor监控系统安装部署,包括如下组件:
1) 配置库(GBase 8a单机数据库)
2) 监控网站
3) 采集中心
4) 采集代理(集群所有节点上进行安装)
2. SNMP Trap功能原理说明:

3. 配置说明:
开启gcmonitor监控系统的SNMP Trap推送功能,需要修改对应采集中心的配置文件,配置文件位置在采集中心安装目录的 gcmonitor_center/conf/ snmp_udp_config.properties文件
具体配置文件配置项包括容下:
#开启开关, 0 :关闭 1 :开启。
isOpen=0
#传送信息编码格式 默认值为GBK
outputEncoding=GBK
#SNMP Trap接收端 IP
trapIp=192.168.2.28
#SNMP Trap接收端 Port
trapPort=161
#传递失败时,重传次数,默认值为2
retries=2
#超时设置,单位为毫秒,默认值为15s
timeout=1500
修改配置文件后需要重启采集中心服务使配置生效
4. 启动测试小工具,模拟外部SNMP Trap信息接收server:
gbase提供了一个测试用的小程序,用于模拟外部SNMP Trap信息接收server的功能并可以将接收到的Trap告警信息打屏到console控制台上,以确认推动功能正常。
小工具的位置在采集中心安装目录下:
本例中的位置在:服务器192.168.56.211 /opt/GMonitor/GMCenter/gcmonitor_center/startTestSnmp.sh 脚本
该脚本有两个执行参数:
$1:IP地址
模拟外部接收server的IP地址,由于脚本在采集中心安装的服务器上执行,此处IP地址填写采集中心服务器IP,本例中为192.168.56.211
$2: 端口号
模拟外部接收server的端口号,本例中使用采集中心配置文件snmp_udp_config.properties中配置的端口号5001
启动测试小程序:
cd /opt/GMonitor/GMCenter/gcmonitor_center/
sh startTestSnmp.sh
手动造一个告警测试Trap推送,如停止 gbased服务 ,界面报警 信息如下 :
[gbase@redhat82danji gcmonitor_center]$ sh startTestSnmp.sh 192.168.56.211 5001
create snmp receiver[192.168.56.211:5001]
snmp reciver listener start.
1.3.6.1.4.1.39649.1.9999.1:192.168.56.191
1.3.6.1.4.1.39649.1.9999.2:GBase-26
1.3.6.1.4.1.39649.1.9999.3:redhat952-192.168.56.191-gbased_state occured an alarm,the current value breaked through threshhold at 2021-08-12 17:27:59. Process breaked through threshhold are as follows: CLOSE, and the threshhod is CLOSE.
1.3.6.1.4.1.39649.1.9999.4:gbased_state
1.3.6.1.4.1.39649.1.9999.5:2
1.3.6.1.4.1.39649.1.9999.6:2021-08-12 17:27:59
1.3.6.1.4.1.39649.1.9999.7:1
1.3.6.1.4.1.39649.1.9999.8:1
1.3.6.1.4.1.39649.1.9999.9:gnode进程是否开启
1.3.6.1.4.1.39649.1.9999.10:progress
1.3.6.1.4.1.39649.1.9999.11:CLOSE
1.3.6.1.4.1.39649.1.9999.12:CLOSE
1.3.6.1.4.1.39649.1.9999.13:--
1.3.6.1.4.1.39649.1.9999.14:redhat952
--------------------------
1.3.6.1.4.1.39649.1.9999.1:192.168.56.191
1.3.6.1.4.1.39649.1.9999.2:GBase-26
1.3.6.1.4.1.39649.1.9999.3:redhat952-192.168.56.191-gbased_state occured an alarm,the current value breaked through threshhold at 2021-08-12 17:28:59. Process breaked through threshhold are as follows: CLOSE, and the threshhod is CLOSE.
1.3.6.1.4.1.39649.1.9999.4:gbased_state
1.3.6.1.4.1.39649.1.9999.5:2
1.3.6.1.4.1.39649.1.9999.6:2021-08-12 17:28:59
1.3.6.1.4.1.39649.1.9999.7:1
1.3.6.1.4.1.39649.1.9999.8:1
1.3.6.1.4.1.39649.1.9999.9:gnode进程是否开启
1.3.6.1.4.1.39649.1.9999.10:progress
1.3.6.1.4.1.39649.1.9999.11:CLOSE
1.3.6.1.4.1.39649.1.9999.12:CLOSE
1.3.6.1.4.1.39649.1.9999.13:--
1.3.6.1.4.1.39649.1.9999.14:redhat952
--------------------------
1.3.6.1.4.1.39649.1.9999.1:192.168.56.191
1.3.6.1.4.1.39649.1.9999.2:GBase-26
1.3.6.1.4.1.39649.1.9999.3:redhat952-192.168.56.191-gbased_state restore an alarm at 2021-08-12 17:29:59. Process breaked through threshhold are as follows: OPEN, and the threshhod is CLOSE.
1.3.6.1.4.1.39649.1.9999.4:gbased_state
1.3.6.1.4.1.39649.1.9999.5:2
1.3.6.1.4.1.39649.1.9999.6:2021-08-12 17:29:59
1.3.6.1.4.1.39649.1.9999.7:0
1.3.6.1.4.1.39649.1.9999.8:1
1.3.6.1.4.1.39649.1.9999.9:gnode进程是否开启
1.3.6.1.4.1.39649.1.9999.10:progress
1.3.6.1.4.1.39649.1.9999.11:CLOSE
1.3.6.1.4.1.39649.1.9999.12:OPEN
1.3.6.1.4.1.39649.1.9999.13:--
1.3.6.1.4.1.39649.1.9999.14:redhat952
--------------------------




