- 当我们部署好zabbix监控,为监控主机添加各种监控项完毕后主机出现问题我们如何在第一时间获得报警信息及时处理里问题呢?
- one alter云告警,可以为我们提供这个服务
-实现云告警平台,必须要有部署好的zabbix服务,虚拟机的要能联网
一.注册云高警帐号
访问 www.onealert.com 登陆云告警系统注册一个帐号并设置个人信息
登陆选择CA
点击集成->监控工具(企业级监控:zabbix)->
二.在服务机上
vim /etc/zabbix/zabbix_server.conf
物理机设置打开路由功能:
[root@foundation46 ~]# systemctl start firewalld ##打开防火墙
[root@foundation46 ~]# firewall-cmd --permanent --add-masquerade ##添加路由功能
Warning: ALREADY_ENABLED: masquerade
success
[root@foundation46 ~]# firewall-cmd --reload ##重启
success
[root@foundation46 ~]# 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@foundation46 ~]# sysctl -a | grep ip_forward ##茶看状态
net.ipv4.ip_forward = 1
net.ipv4.ip_forward_use_pmtu = 0
[root@foundation46 ~]# vim /etc/sysctl.conf ##永久开启
net.ipv4.ip_forward=1
[root@foundation46 ~]# sysctl -p
net.ipv4.ip_forward = 1
[root@foundation46 ~]# ping www.baidu.com
PING www.a.shifen.com (220.181.38.150) 56(84) bytes of data.
64 bytes from 220.181.38.150 (220.181.38.150): icmp_seq=1 ttl=52 time=30.1 ms
64 bytes from 220.181.38.150 (220.181.38.150): icmp_seq=2 ttl=52 time=47.1 ms
64 bytes from 220.181.38.150 (220.181.38.150): icmp_seq=3 ttl=52 time=48.2 ms
^C
server1:
[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 774125a3-bcc0-2bab-050b-85ae9dbadf36
./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.46.1/zabbix
Zabbix管理员账号: Admin
Zabbix管理员密码:
[root@server1 bin]# systemctl stop zabbix-agent
[root@server1 bin]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 #添加网关
GATEWAY=172.25.46.250
[root@server1 bin]# systemctl start network
[root@server1 bin]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.25.46.250 0.0.0.0 UG 0 0 0 eth0
[root@server1 bin]# vim /etc/resolv.conf
nameserver 114.114.114.114
[root@server1 bin]# ping www.baidu.com
PING www.a.shifen.com (220.181.38.150) 56(84) bytes of data.
64 bytes from 220.181.38.150 (220.181.38.150): icmp_seq=1 ttl=51 time=56.1 ms
64 bytes from 220.181.38.150 (220.181.38.150): icmp_seq=2 ttl=51 time=64.9 ms
^C
动作:触发器
cloudalert action