Skip to content

Instantly share code, notes, and snippets.

@sebastianwebber
Last active April 6, 2019 01:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save sebastianwebber/5f7dd76d0b7eabb1d388fbfdcbafebda to your computer and use it in GitHub Desktop.
Save sebastianwebber/5f7dd76d0b7eabb1d388fbfdcbafebda to your computer and use it in GitHub Desktop.
Zabbix 3 Install on CEntOS 7 with PostgreSQL 9.5

Zabbix 3 Install on CEntOS 7 with PostgreSQL 9.5

Repo installation

Zabbix repo

yum install http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

PostgreSQL repo

yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm

PostgreSQL Configuration

Installation

yum install postgresql95-server postgresql95-contrib

Setup

Create the database cluster:

/usr/pgsql-9.5/bin/postgresql95-setup initdb

Start the database:

systemctl start postgresql-9.5

Adjust the pg_hba.conf, allowing local access without password, replacing:

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident

By:

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust

Then, apply this changes:

systemctl reload postgresql-9.5

Now, apply the server tuning (based on pgconfig.org suggestions):

Configuration

Create the database and user zabbix:

CREATE USER zabbix;
CREATE DATABASE zabbix OWNER zabbix;

Zabbix

Installation

yum install zabbix-server-pgsql zabbix-web-pgsql zabbix-agent zabbix-get

Server Configuration

Run the database setup:

cd /usr/share/doc/zabbix-server-pgsql-3.0.4/
zcat create.sql.gz | psql -U zabbix -d zabbix

Configure the system auto-start:

systemctl enable zabbix-server
systemctl enable zabbix-agent

Adjust the /etc/zabbix/zabbix_server.conf, adding:

DBUser=zabbix
DBPort=5432
DBHost=localhost

Now, start the services:

systemctl start zabbix-server
systemctl start zabbix-agent

Web interface Configuration

Adjust the /etc/httpd/conf.d/zabbix.conf, uncommenting the date.timezone configuration:

php_value date.timezone America/Sao_Paulo

Configure the system auto-start:

systemctl enable httpd

Finally, start the server:

systemctl start httpd

References

  1. http://blog.dnslink.com.br/BG/instalando-zabbix-3-no-centos-7/
  2. https://www.zabbix.com/documentation/3.0/pt/manual/installation/install_from_packages
  3. https://www.zabbix.com/documentation/3.0/pt/manual/appendix/install/db_scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment