**本实验是在zabbix已经安装配置好的基础上开始做的:
基础实验配置请参考:https://mp.csdn.net/mdeditor/81736380**
在真机添加策略:
[root@foundation38 Desktop]# iptables -t nat -I POSTROUTING -s 172.25.38.0/24 -j MASQUERADE
在企业7的主机进行配置:
[root@localhost zabbix]# ls
web zabbix_java_gateway.conf zabbix_server.conf
zabbix_agentd.conf zabbix_java_gateway_logback.xml
zabbix_agentd.d zabbix_proxy.conf
[root@localhost zabbix]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.25.0.0 0.0.0.0 255.255.0.0 U 100 0 0 eth0
[root@localhost zabbix]# route add default gw 172.25.38.250 添加网关
[root@localhost zabbix]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.25.38.250 0.0.0.0 UG 0 0 0 eth0
172.25.0.0 0.0.0.0 255.255.0.0 U 100 0 0 eth0
[root@localhost zabbix]# vim /etc/resolv.conf
[root@localhost zabbix]# cat /etc/resolv.conf
nameserver 114.114.114.114
[root@localhost zabbix]# ping baidu.com 必须保证可以上网
PING baidu.com (220.181.57.216) 56(84) bytes of data.
64 bytes from 220.181.57.216 (220.181.57.216): icmp_seq=1 ttl=48 time=119 ms
64 bytes from 220.181.57.216 (220.181.57.216): icmp_seq=2 ttl=48 time=368 ms
^C
--- baidu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 119.696/244.046/368.397/124.351 ms
[root@localhost zabbix]#
在网页操作先开始注册oneAlert云告警平台并添加应用生成KEY:
[root@localhost zabbix]# vim /etc/zabbix/zabbix_server.conf
[root@localhost zabbix]# cd /usr/lib/zabbix/alertscripts/
[root@localhost alertscripts]# ls
oneitsm_zabbix_release-1.2.0.tar.gz
[root@localhost alertscripts]# tar zxf oneitsm_zabbix_release-1.2.0.tar.gz
[root@localhost alertscripts]# ls
oneitsm oneitsm_zabbix_release-1.2.0.tar.gz
[root@localhost alertscripts]# cd oneitsm
[root@localhost oneitsm]# ls
bin logs release update
[root@localhost oneitsm]# cd bin/
[root@localhost bin]# ls
alert.sh install.sh log.sh update.sh
[root@localhost bin]# ./install.sh 08619cba-b2f6-d2f9-cd25-ec20c34a9b86
./log.sh: line 6: /usr/lib/zabbix/alertscripts/oneitsm/bin/oneitsm.conf: No such file or directory
start to create config file...
Zabbix管理地址: 172.25.38.11/zabbix
Zabbix管理员账号: Admin
Zabbix管理员密码: westos就是登陆zabbix的密码
start to auth by zabbix admin user and password...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 195 100 70 100 125 764 1364 --:--:-- --:--:-- --:--:-- 1373
auth success!
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 109 100 41 100 68 770 1277 --:--:-- --:--:-- --:--:-- 1283
start to create mediatype...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 356 100 56 100 300 500 2682 --:--:-- --:--:-- --:--:-- 2702
create media type success!
start to create user group...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 214 100 54 100 160 762 2259 --:--:-- --:--:-- --:--:-- 2285
create user group success!
start to create user in zabbix...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 623 100 51 100 572 725 8134 --:--:-- --:--:-- --:--:-- 8056
create user success!
start to create action...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2013 100 51 100 1962 351 13534 --:--:-- --:--:-- --:--:-- 13625
create action success!
安装成功:
在网页进行部署添加媒介:
在企业6主机停止zabbix-agent模拟报警:
[root@server3 bin]# /etc/init.d/zabbix-agent stop
Shutting down Zabbix agent: [ OK ]
[root@server3 bin]#
在网页查看会有报警信息:
会给你绑定的邮箱发消息:
在OneAlert会有待处理信息认领之后就会变成处理中:
server3再次打开服务:
[root@server3 bin]# /etc/init.d/zabbix-agent start
Starting Zabbix agent: [ OK ]
[root@server3 bin]#
刷新ONeAlert会跑到已关闭邮件:
手机邮箱会出来信息显示已经处理:
进行监控项的更新: