一、安装zabbix-server
系统环境:CentOS-7-x86_64-Minimal-1708
1.首先把Centos7安装完毕并关闭防火墙与SElinux。
关闭防火墙
systemctl stop firewalld&&systemctl disable firewalld
关闭SELinux:
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
然后重启reboot
2、替换阿里云Zabbix源
shell脚本zabbix_aliyun.sh
vi zabbix_aliyun.sh
复制下面脚本
#!/bin/bash
echo -e "请给出要安装的zabbix版本号,建议使用4.x的版本 \033[31musage:./zabbix_aliyun.sh 4.0|4.4|4.5|5.0 \033[0m"
echo "例如要安装4.4版本,在命令行写上 ./zabbix_aliyun.sh 4.4"
if [ -z $1 ];then
exit
fi
VERSION=$1
if [ -f /etc/yum.repos.d/zabbix.repo ];then
rm -rf /etc/repos.d/zabbix.repo
fi
rpm -qa | grep zabbix-release && rpm -e zabbix-release
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/$VERSION/rhel/7/x86_64/zabbix-release-$VERSION-1.el7.noarch.rpm
sed -i "s@zabbix/.*/rhel@zabbix/$VERSION/rhel@g" /etc/yum.repos.d/zabbix.repo
sed -i 's@repo.zabbix.com@mirrors.aliyun.com/zabbix@g' /etc/yum.repos.d/zabbix.repo
[ $? -eq 0 ] && echo "阿里云的zabbix源替换成功" || exit 1
yum clean all
yum makecache fast
然后执行命令:
bash zabbix_aliyun.sh 5.0
3.由于zabbix提供集中的web监控管理界面,因此服务在web界面的呈现需要LAMP架构支持。安装httpd php
yum install -y httpd php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mhash
4.安装常用的开发软件
yum groups install "Development Tools"
查看工具包
yum groups info "Development Tools"
5.安装Zabbix5.0