zabbix-3.2.7之使用ICMP ping来判断主机是否存活并发邮件报警
一、在zabbix-server服务器上面安装。
必须先安装gcc
yum install gcc -y
安装fping
[root@zabbix-server ~]# cd /home/nulige/tools/ [root@zabbix-server tools]# wget http://www.fping.org/dist/fping-3.10.tar.gz [root@zabbix-server tools]# tar zxvf fping-3.10.tar.gz [root@zabbix-server fping-3.10]# ./configure --prefix=/usr/local/sbin/ [root@zabbix-server fping-3.10]# make && make install make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/home/nulige/tools/fping-3.10/src' make[1]: Leaving directory `/home/nulige/tools/fping-3.10/src' make[1]: Entering directory `/home/nulige/tools/fping-3.10' make[2]: Entering directory `/home/nulige/tools/fping-3.10' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/home/nulige/tools/fping-3.10' make[1]: Leaving directory `/home/nulige/tools/fping-3.10'
[root@zabbix-server fping-3.10]# echo $? 0
安装完成,修改属组和权限
#更改所属组 [root@zabbix-server fping-3.10]# chown root:zabbix /usr/sbin/fping #并授权4710 [root@zabbix-server fping-3.10]# chmod 4710 /usr/sbin/fping #检查 [root@zabbix-server fping-3.10]# ll /usr/sbin/fping -rws--x--- 1 root zabbix 36544 Jul 29 2015 /usr/sbin/fping
二、开启Fping参数
[root@zabbix-server ~]# vi /etc/zabbix/zabbix_server.conf ### Option: FpingLocation # Location of fping. # Make sure that fping binary has root ownership and SUID flag set. # # Mandatory: no # Default: # FpingLocation=/usr/sbin/fping FpingLocation=/usr/sbin/fping #取消这行注释
#重启zabbix-server
[root@zabbix-server fping-3.10]# systemctl restart zabbix-server
#判断是否存活
[root@zabbix-server fping-3.10]# cd [root@zabbix-server ~]# /usr/sbin/fping 192.168.30.136 192.168.30.136 is alive # 说明命令返回成功。
三、添加监控模板和图形
点zabbix-client--->添加Template ICMP ping模板
点图形
创建图形
输入名称--->选择三个参数
查看效果:
查看效果: