Skip to content

Instantly share code, notes, and snippets.

@sebastianwebber
Last active November 25, 2015 10:22
Show Gist options
  • Select an option

  • Save sebastianwebber/6019f8c43a5ffe196833 to your computer and use it in GitHub Desktop.

Select an option

Save sebastianwebber/6019f8c43a5ffe196833 to your computer and use it in GitHub Desktop.
Zabbix Installation (with PostgreSQL) on EL7

Zabbix Installation (with PostgreSQL) on EL7

Install the necessary repositories

yum install http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-2.noarch.rpm http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/zabbix-release-2.4-1.el7.noarch.rpm epel-release

Install the necessary software:

yum install zabbix-server-pgsql zabbix-agent zabbix-web-pgsql postgresql94-server httpd php

Disable SELinux

sed -i 's/SELINUX=\(enforcing\|permissive\)/SELINUX=disabled/g' /etc/selinux/config
setenforce 0

Configure PostgreSQL

Inicialize the PGDATA dir

/usr/pgsql-9.4/bin/postgresql94-setup  initdb

Adjust the pg_hba.conf file

Change the lines 77~84 from:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "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                 trust

To:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "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

Enable auto start and start the service

systemctl enable postgresql-9.4.service
systemctl start postgresql-9.4.service

Create de zabbix user and database

Create the users and db:

createuser -U postgres zabbix
createdb -U postgres -O zabbix zabbix

Then run the database scripts

psql -U zabbix -f /usr/share/doc/zabbix-server-pgsql-2.4.7/create/schema.sql
psql -U zabbix -f /usr/share/doc/zabbix-server-pgsql-2.4.7/create/images.sql
psql -U zabbix -f /usr/share/doc/zabbix-server-pgsql-2.4.7/create/data.sql

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment