1).postgres安裝
? ? ? ? # yum install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm
? ? ? ? # yum list postgres*
? ? ? ? # yum install postgresql94-server
? ? ? ? # su - postgres
? ? ? ? $ /usr/pgsql-9.4/bin/initdb -D /var/lib/pgsql/9.4/data
? ? ? ? # systemctl enable postgresql-9.4
? ? ? ? # systemctl start postgresql-9.4
2).zabbix數(shù)據(jù)庫初始化
? ? ? ? #su - postgres
? ? ? ? $createuser -W zabbix
? ? ? ? $createdb -U postgres -O zabbix -E UTF8 zabbix
? ? ? ? $psql
$\password postgres
Enter password for new role:
Enter it again:
$\password zabbix
Enter password for new role:
Enter it again:
$ \q
3).PostgreSQL的設(shè)置文件pg_hba.conf修改
?? ? ? ?#?cp -f? /var/lib/pgsql/9.4/data/pg_hba.conf? /var/lib/pgsql/9.4/data/pg_hba.conf.bk
?? ? ? ?#vi /var/lib/pgsql/9.4/data/pg_hba.conf
local? all? all trust
host? ? all? ? ? ? all? ? ? ? 127.0.0.1/32? ? ? ? ? trust
host? ? all? ? ? ? all? ? ? ? ::1/128? ? ? ? ? ? ? trust
?? ? ? ?#service postgresql-9.4 restart
?? ? ? ?#ps ax | grep postgres
?? ? ? ?#psql -U zabbix -d zabbix -h 127.0.0.1 -p 5432
?? ? ? ?#\q
?? ? ? ?#exit
4).zabbix安裝
?? ? ? ?# rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
?? ? ? ?# yum-config-manager --enable rhel-7-server-optional-rpms
?? ? ? ?# yum install zabbix-server-pgsql zabbix-web-pgsql
?? ? ? ?# yum install zabbix-agent
?? ? ? ?# yum install zabbix-get
5).導(dǎo)入zabbix初始數(shù)據(jù)
?? ? ? ?# zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix? psql zabbix
6).Zabbix配置文件修改
?? ? ? ?#cp -f /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_server.conf.bk
?? ? ? ?#vi /etc/zabbix/zabbix_server.conf
DBHost=
DBName=zabbix
DBUser=zabbix
DBPassword=<password>
DBPort=5432
ListenPort=10051
7).Zabbix服務(wù)啟動
?? ? ? ?#systemctl enable zabbix-server.service
?? ? ? ?#systemctl restart zabbix-server.service
8).httpd和PHP及必要包安裝
?? ? ? ?# yum install httpd php php-pgsql php-mbstring php-bcmath php-xml php-gd
?? ? ? ?# yum install readline-devel zlib-devel
9).httpd和PHP設(shè)定及httpd啟動
?? ? ? ?# cp /etc/php.ini? /etc/php.ini.org
?? ? ? ?# vi /etc/php.ini
變更前:;date.timezone =
變更后:date.timezone = Asia/Shanghai
?? ? ? ?# cd? /var/www/html/
?? ? ? ?# ln -s /usr/share/zabbix .
?? ? ? ?# systemctl enable httpd.service'.
?? ? ? ?# systemctl status httpd
10).Zabbix agent設(shè)定文件修改
?? ? ? ?# cp -f /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.org
?? ? ? ?# vi /etc/zabbix/zabbix_agentd.conf
Server=[zabbix server IP]
ListenPort=10050
Hostname=[本agent主機(jī)名]
ServerActive=[zabbix server IP]
11).zabbix agent啟動及自啟動設(shè)定
?? ? ? ?# systemctl enable zabbix-agent.service
?? ? ? ?# systemctl start zabbix-agent.service
接下來就是登錄Web端初始化設(shè)定及添加Agent啦