1.警报环境的搭建
[root@foundation44 3.4]# iptables -t nat -I POSTROUTING -s 172.25.44.0/24 -j MASQUERADE #真机加伪装
[root@foundation44 3.4]# ping www.baidu.com #ping通代表伪装添加成功
PING www.baidu.com (183.232.231.172) 56(84) bytes of data.
64 bytes from 183.232.231.172 (183.232.231.172): icmp_seq=1 ttl=53 time=115 ms
64 bytes from 183.232.231.172 (183.232.231.172): icmp_seq=2 ttl=53 time=299 ms
# 测试虚拟机是否可以上网
[root@server1 zabbix]# route add default gw 172.25.44.250 # 虚拟机加真机网关
[root@server1 zabbix]# route -n #查看网关
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.25.44.250 0.0.0.0 UG 0 0 0 eth0
172.25.44.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
[root@server1 zabbix]# cat /etc/resolv.conf
# Generated by NetworkManager
search example.com
[root@server1 zabbix]# vim /etc/resolv.conf # 添加解析
1 # Generated by NetworkManager
2 nameserver 114.114.114.114
[root@server1 zabbix]# ping www.baidu.com
[root@test1 ~]# ping www.baidu.com
PING www.a.shifen.com (180.149.132.151) 56(84) bytes of data.
64 bytes from 180.149.132.151 (180.149.132.151): icmp_seq=1 ttl=52 time=72.5 ms
64 bytes from 180.149.132.151 (180.149.132.151): icmp_seq=2 ttl=52 time=40.8 ms
浏览器添加应用:
[root@server1 zabbix]# vim /etc/zabbix/zabbix_server.conf # 查看脚本路径
490 AlertScriptsPath=/usr/lib/zabbix/alertscripts
[root@server1 zabbix]# cd /usr/lib/zabbix/alertscripts/
[root@server1 alertscripts]# pwd
/usr/lib/zabbix/alertscripts
[root@server1 alertscripts]# ls
oneitsm_zabbix_release-1.2.0.tar.gz
[root@server1 bin]# ./install.sh 912bb306-1006-0c63-1388-e7bdace713f5
start to create config file...
Zabbix管理地址: http://172.25.44.11/zabbix
Zabbix管理员账号: Admin
Zabbix管理员密码:
start to auth by zabbix admin user and password...
create action success!
安装成功.
关闭其他警报媒介,只打开oneitsm media
点击Admin,添加报警媒介
[root@server2 zabbix_agentd.d]# /etc/init.d/zabbix-agent stop
Shutting down Zabbix agent: [ OK ]
# 关闭客户端zabbix-agent,就会出现报警
# 有报警,且发送邮件成功
解决问题:/etc/init.d/zabbix-agent start
# 警告显示已解决