当我们部署好zabbix监控,为监控主机添加各种监控项完毕后,主机出现问题,我们能在one alter云告警这个服务,第一时间获得报警信息及时处理问题
- 实现云告警平台,必须要有部署好的zabbix服务,虚拟机要能联网
让虚拟机上网
物理机打开路由功能:
[root@foundation25 ~]# systemctl start firewalld #打开防火墙
[root@foundation25 ~]# firewall-cmd --permanent --add-masquerade #添加路由功能
[root@foundation25 ~]# firewall-cmd --reload #重启
[root@foundation25 ~]# firewall-cmd --list-all
trusted (active)
target: ACCEPT
icmp-block-inversion: no
interfaces: br0 enp2s0 wlp3s0
sources:
services:
ports:
protocols:
masquerade: yes ##路由功能打开
forward-ports:
sourceports:
icmp-blocks:
rich rules:
[root@foundation25 ~]# sysctl -a | grep ip_forward #查看状态
net.ipv4.ip_forward = 1
net.ipv4.ip_forward_use_pmtu = 0
[root@foundation25 ~]# vim /etc/sysctl.conf #永久开启
net.ipv4.ip_forward=1
[root@foundation25 ~]# sysctl -p
net.ipv4.ip_forward = 1
[root@foundation25 ~]# ping www.baidu.com
server1设置gateway:
[root@server1 bin]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 #添加网关
GATEWAY=172.25.25.250
[root@server1 bin]# systemctl restart network
[root@server1 bin]# route -n
[root@server1 bin]# vim /etc/resolv.conf
nameserver 114.114.114.114
[root@server1 bin]# ping www.baidu.com
一.注册云告警帐号
访问 www.onealert.com 登陆云告警系统注册一个帐号并设置个人信息
登陆后选择CA
点击集成->监控工具(企业级监控:zabbix)->
server1
vim /etc/zabbix/zabbix_server.conf
[root@server1 ~]# tar zxf ca_zabbix_release-2.1.0.tar.gz -C /usr/lib/zabbix/alertscripts
[root@server1 ~]# cd /usr/lib/zabbix/alertscripts/
[root@server1 alertscripts]# ls
cloudalert
[root@server1 alertscripts]# cd cloudalert/
[root@server1 cloudalert]# ls
bin logs release update
[root@server1 cloudalert]# cd bin/
[root@server1 bin]# ./install.sh 755df434-3514-3803-6a12-c1f956bae73c
./log.sh: line 6: /usr/lib/zabbix/alertscripts/cloudalert/bin/cloudalert.conf: No such file or directory
start to create config file...
Zabbix管理地址: http://172.25.25.1/zabbix
Zabbix管理员账号: Admin
Zabbix管理员密码:
[root@server1 bin]# systemctl stop zabbix-agent
动作:触发器
设置通知方式
收到处理问题后
![](https://img-blog.csdnimg.cn/20190802144733768.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzM3MzgyMDc3,size_16,color_FFFFFF,t_70)