一、lamp环境部署(yum方式)
1.系统环境
server端:192.168.46.138
client端;192.168.46.130,192.168.46.134,192.168.46.135
2.关闭iptables和selinux
iptables -F && /zh-cn/p_w_picpaths/localp_w_picpath.png") no-repeat scroll center;border:1px solid rgb(221,221,221);" alt="spacer.gif" height="138" width="554"/>
客户端安装agentd
使用脚本的方式,脚本如下:
#!/bin/bash #auto install zabbix #by jfedu.net 2017 ############# ZABBIX_SOFT="zabbix-3.2.7.tar.gz" INSTALL_DIR="/usr/local/zabbix/" SERVER_IP="192.168.46.138" IP=`ifconfig|grep Bcast|awk '{print $2}'|sed 's/addr://g'` AGENT_INSTALL(){ yum -y install curl curl-devel net-snmp net-snmp-devel perl-DBI groupadd zabbix; useradd -g zabbix zabbix; usermod -s /sbin/nologin zabbix tar -xzf $ZABBIX_SOFT; cd `echo $ZABBIX_SOFT|sed 's/.tar.*//g'` ./configure --prefix=/usr/local/zabbix --enable-agent&&make install if [ $? -eq 0 ]; then ln -s /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/ fi cd /opt/; cd zabbix-3.2.7 cp misc/init.d/tru64/zabbix_agentd /etc/init.d/zabbix_agentd; chmod o+x /etc/init.d/zabbix_agentd #config zabbix agentd cat >$INSTALL_DIR/etc/zabbix_agentd.conf<<EOF LogFile=/tmp/zabbix_agentd.log Server=$SERVER_IP ServerActive=$SERVER_IP Hostname = $IP EOF #start zabbix agentd /etc/init.d/zabbix_agentd restart } AGENT_INSTALL |
安装完成之后,到server web上查看,发现都已经正常
2.Snmp方式
四、zabbix邮件监控
1.配置邮件服务器
AdministrationàMedia typesàCreate media type,填写邮件服务器信息
2.配置用户(接收报警邮件)
3.添加触发器
ActionàNew condition选择“Trigger serverity>=Warning”;
Operationsà设置报警间隔为60s,自定义报警信息,报警信息发送至administrators组
Recovery operations à自定义恢复信息,恢复信息发送至administrators组
4.测试
server web查看
邮箱查看