Instalação do Zabbix Server 2.4.5 em CentOS 6.6 (com MySQL)

zabbix_logo

vi /etc/hosts ### O nome da máquina deve responder com o IP externo.
### Liberar portas 10050 e 10051 no Firewall.
yum -y update
reboot
rpm -i http://mirror.globo.com/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -i http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum -y install mysql-community-server.x86_64 mysql-community-devel.x86_64 wget gcc httpd php php-gd php-bcmath php-ctype php-xml php-session php-mbstring php-gettext php-mysql libcurl-devel net-snmp-devel libssh2-devel make unzip nmap telnet telnet-server screen links gnome-utils perl-ExtUtils-MakeMaker perl-IO-Socket-SSL openssh-clients fping
groupadd zabbix
useradd -g zabbix zabbix
passwd zabbix
cd
wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.4.5/zabbix-2.4.5.tar.gz
tar xfzv zabbix-2.4.5.tar.gz
cd zabbix-2.4.5
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-libcurl --with-mysql
make
make install
echo 'DBUser=zabbix' >> /usr/local/zabbix/etc/zabbix_server.conf
echo 'DBPassword=Nerv2015' >> /usr/local/zabbix/etc/zabbix_server.conf
echo 'DBPort=3306' >> /usr/local/zabbix/etc/zabbix_server.conf
echo 'AlertScriptsPath=/etc/zabbix/scripts' >> /usr/local/zabbix/etc/zabbix_server.conf
echo 'Hostname=Melquior.localdomain' >> /usr/local/zabbix/etc/zabbix_agentd.conf
echo 'Server=Melquior.localdomain' >> /usr/local/zabbix/etc/zabbix_agentd.conf
echo 'ServerActive=Melquior.localdomain' >> /usr/local/zabbix/etc/zabbix_agentd.conf
mkdir /var/www/html/zabbix
cd /root/zabbix-2.4.5/frontends/php
cp -a . /var/www/html/zabbix
chown -R apache:apache /var/www/html/zabbix
cp /root/zabbix-2.4.5/misc/init.d/fedora/core5/zabbix_server /etc/init.d/ ### Corrigir: ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_server"
cp /root/zabbix-2.4.5/misc/init.d/fedora/core5/zabbix_agentd /etc/init.d/ ### Corrigir: ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_agentd"
chkconfig --add zabbix_server
chkconfig --add zabbix_agentd
chkconfig --level 35 zabbix_server on
chkconfig --level 35 zabbix_agentd on
chmod 755 /etc/init.d/zabbix_server
chmod 755 /etc/init.d/zabbix_agentd
echo 'post_max_size = 16M' >> /etc/php.ini
echo 'max_execution_time = 300' >> /etc/php.ini
echo 'max_input_time = 300' >> /etc/php.ini
echo "date.timezone = 'America/Sao_Paulo'" >> /etc/php.ini
vi /etc/httpd/conf/httpd.conf ### Verificar hostname e porta.
chkconfig httpd on
service httpd start
service mysqld start
chkconfig mysqld on
mysqladmin -u root password 'Nerv2015'
mysql -u root -pNerv2015 -e "CREATE DATABASE zabbix"
mysql -u root -pNerv2015 -e "CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'Nerv2015'"
mysql -u root -pNerv2015 -e "GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost'"
mysql -u root -pNerv2015 -e "FLUSH PRIVILEGES"
cd /root/zabbix-2.4.5/database/mysql/
mysql -u root -pNerv2015 zabbix < schema.sql
mysql -u root -pNerv2015 zabbix < images.sql
mysql -u root -pNerv2015 zabbix < data.sql
service zabbix_server start
service zabbix_server status
service zabbix_agentd start
service zabbix_agentd status
cat /tmp/zabbix_server.log
chcon -R --reference=/var/www/ /var/www/html/zabbix/
setsebool -P httpd_can_network_connect on
http://localhost/zabbix/ ### Executar os procedimentos de instalação indicados na página.
mkdir -p /etc/zabbix/scripts
chown zabbix:zabbix /etc/zabbix/scripts
cd
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz
tar xfzv sendEmail-v1.56.tar.gz
cp -a sendEmail-v1.56/sendEmail /usr/local/bin
chmod +x /usr/local/bin/sendEmail
vi /etc/zabbix/scripts/sendEmail.sh
chmod +x /etc/zabbix/scripts/sendEmail.sh ### Teste: /etc/zabbix/scripts/sendEmail.sh ricardo@nervinformatica.com.br Teste Teste

8 comments

  1. Mano, depois de fazer o tutorial inteiro, seja na parte do service zabbix_service start
    Ele diz que o serviço não está instalado é frustrante rs

    1. Este comandos retornaram algum erro?

      cp /root/zabbix-2.4.5/misc/init.d/fedora/core5/zabbix_server /etc/init.d/ ### Corrigir: ZABBIX_BIN=”/usr/local/zabbix/sbin/zabbix_server”
      cp /root/zabbix-2.4.5/misc/init.d/fedora/core5/zabbix_agentd /etc/init.d/ ### Corrigir: ZABBIX_BIN=”/usr/local/zabbix/sbin/zabbix_agentd”
      chkconfig –add zabbix_server
      chkconfig –add zabbix_agentd

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.