Instalação fácil do Zabbix 3 no CentOS 6.7

Publicado por Paulo Bandeira em 06/06/2016

[ Hits: 11.253 ]

 


Instalação fácil do Zabbix 3 no CentOS 6.7



1. Adicionar os repositórios para o MariaDB e para o PHP 5.5:

# nano /etc/yum.repos.d/mariadb.repo

[mariadb]
name = mariadb
baseurl = http://yum.mariadb.org/10.0/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

# nano /etc/yum.repos.d/remi.repo

[remi]
name=Remi's RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-php55]
name=Remi's PHP 5.5 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php55/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php55/mirror
# NOTICE: common dependencies are in "remi-safe"
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# NOTICE: common dependencies are in "remi-safe"
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

# yum update -y

2. Instalar o MariaDB e criar a base da dados do Zabbix.

# yum install MariaDB-server MariaDB-client -y
# service mysql start

2.1. Após a instalação do banco, vamos colocar uma senha de acesso para o root:

# mysql_secure_installation

Note:

RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.


Enter:

current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
... skipping.

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
- Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
... Success!


2.2. Criar a base de dados para o Zabbix:

# mysql -u root -p

mysql> CREATE DATABASE zabbix;
mysql> GRANT ALL PRIVILEGES on zabbix.* to 'zabbixusr'@'localhost' IDENTIFIED BY 'SECRET_PASSWORD';
mysql> FLUSH PRIVILEGES;
mysql> quit

3. Instalar o Apache e iniciar:

# yum install httpd -y
# chkconfig httpd on
# service httpd start

4. Instalar os pacotes PHP:

# yum install php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml php-bcmath

5. Instalação do repositório do Zabbix:

# rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm

5.1. Instalação dos pacotes do Zabbix:

# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

5.2. Importar o shema e os dados para o banco do Zabbix criado anteriormente:

# cd /usr/share/doc/zabbix-server-mysql-3.0.3/
# zcat create.sql.gz | mysql -u root -p zabbix

5.3. Configuração de conexão do Zabbix Server ao banco de dados:

# nano /etc/zabbix/zabbix_server.conf

DBHost=localhost
DBName=zabbix
DBUser=zabbixusr
DBPassword=SECRET_PASSWORD

# chkconfig zabbix-server on
# service zabbix-server start

6. Alterar os valores abaixo no "php.ini":

# nano /etc/php.ini

max_execution_time 300
memory_limit 128M
post_max_size 16M
upload_max_filesize 2M
max_input_time 300
always_populate_raw_post_data -1
date.timezone America/Sao_Paulo

7. Criar o vhost para o Zabbix:

# nano /etc/httpd/conf.d/vhosts.conf

NameVirtualHost *:80

<VirtualHost *:80>
  ServerName zabbix.inpi.gov.br
  ServerAlias zabbix
  DocumentRoot /usr/share/zabbix/

<Directory "/usr/share/zabbix/">
  php_admin_flag register_globals on
  Options Indexes -MultiViews FollowSymLinks
  AllowOverride all
  Order deny,allow
  Allow from all
  </Directory>
</VirtualHost>

7.1. Reiniciar o Apache e acessar a URL:

# service httpd restart

7.2. URL para acesso após criar o vhost.
Fim.

Outras dicas deste autor

Rotacionar log antes de configurar o logrotate

Instalação e configuração do ratticweb no Centos 6.7

Instalando VNC e o ambiente desktop MATE no Kali Linux 2.0

Instalação do SOLR no CentOS 6.7

Zimbra - Alterando tamanho de exibição da coluna no zmaccts

Leitura recomendada

Deixe programas no topo das outras janelas no Ubuntu em dois cliques

Automatix2 em Debian Etch 4.0r1

Salvando trechos de arquivos PDF com o CUPS-PDF

Alterando o local do Drive do Gnome-Boxes

Unreal Tournament para Linux

  

Comentários
[1] Comentário enviado por SrKayque em 11/12/2016 - 15:39h

Boa Tarde, queria saber se seria possível fazer um tutorial ensinado a instalar o zabbix 3 no CentOS 6.5, pq eu sigo os passo-a-passo e não funciona.

[2] Comentário enviado por pbsband em 12/12/2016 - 13:21h


[1] Comentário enviado por SrKayque em 11/12/2016 - 15:39h

Boa Tarde, queria saber se seria possível fazer um tutorial ensinado a instalar o zabbix 3 no CentOS 6.5, pq eu sigo os passo-a-passo e não funciona.


É só você atualizar o centOS se esse for o problema.

# yum update -y



[3] Comentário enviado por SrKayque em 15/12/2016 - 16:30h

Uma pergunta, se não por esse vhost, é só acessar o Zabbix direto pelo ip, certo?



Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts