修改selinux
cat /etc/selinux/config sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config cat /etc/selinux/config reboot
防火墙修改为iptables
systemctl stop firewalld.service systemctl disable firewalld.service firewall-cmd --state yum install iptables-services -y systemctl restart iptables.service systemctl enable iptables.service
添加80端口
vim /etc/sysconfig/iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT systemctl restart iptables
同步时间
yum -y install ntp ntpdate ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime ntpdate us.pool.ntp.org systemctl start ntpd.service systemctl enable ntpd.service
设置每30分钟同步一次时间
crontab -e */30 * * * * /usr/sbin/ntpdate us.pool.ntp.org >> /var/log/crontab.log 2>&1
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm yum install -y postgresql12 yum install -y postgresql12-server
/usr/pgsql-12/bin/postgresql-12-setup initdb systemctl enable postgresql-12.service systemctl start postgresql-12.service
su - postgres psql -U postgres
create database zabbix; #创建数据库zabbix create user zabbix; #创建用户zabbix ALTER USER zabbix WITH PASSWORD 'zabbix'; #设置zabbix用户密码为zabbix grant all on database zabbix to zabbix; #给zabbix用户权限 \q exit #退出
vim /var/lib/pgsql/12/data/pg_hba.conf #修改为MD5 # "local" is for Unix domain socket connections only local all all md5 # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 # Allow replication connections from localhost, by a user with the # replication privilege. local replication all md5 host replication all 127.0.0.1/32 md5 host replication all ::1/128 md5 host all all 0.0.0.0/0 md5 #添加 systemctl restart postgresql-12.service
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm yum clean all
yum -y install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-agent
zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix
vim /etc/zabbix/zabbix_server.conf DBHost=localhost #91行 DBName=zabbix #100行 DBuscr=zabbix #116行 DBPassword=zabbix #124行 DBport=5432 #139行
vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai
systemctl restart httpd systemctl restart zabbix-server zabbix-agent httpd systemctl enable zabbix-server zabbix-agent httpd