Instalação compilada do Zabbix no PHP 5.6 e PHP 7.0

** Devido a um bug no editor do WordPress quando digito – – junto, o que é o correto no prompt ele agrega para — portanto em todos os posts pode ser necessário essa correção em algum momento. Outro problema são as aspas duplas e simples que quando copiadas não são reconhecidas no linux.
Instalar os seguintes pacotes para PHP 5:
# apt-get install build-essential gcc libacl1-dev apache2 mysql-server libapache2-mod-log-sql-mysql php5 libapache2-mod-php5 php5-ldap php5-gd php5-mcrypt php5-mysql libattr1-dev libblkid-dev libgnutls-openssl27 libreadline-dev python-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev acl chkconfig
Instalar os seguintes pacotes para PHP 7:
# apt-get install build-essential gcc libacl1-dev php7.0 php7.0-ldap apache2 apache2-mod-php7.0 php7.0-mysql php7.0-gd php7.0-mcrypt libapache2-mod-log-sql-mysql libattr1-dev libblkid-dev libgnutls-openssl27 libreadline-dev python-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev libmariadbd18 acl libcurl4-gnutls-dev libcurl3 curl automake dh-autoreconf debhelper dh-linktree apache2-dev libgnutls28-dev  gnutls-dev libiksemel-dev default-libmysqlclient-dev libopenipmi-dev libpq-dev libsnmp-dev libssh2-1-dev libxml2-dev pkg-config libjs-prototype gettext ruby-sass php7.0-xml php7.0-mbstring php7.0-bcmath php7.0-snmp python-netsnmp libnet-snmp-perl php7.0-cli fping openjdk-8-jdk unixodbc-dev php7.0-common php7.0-json php7.0-xmlrpc
Instalação do MySQL Server ao invés do MariaDB: 
# echo -e “deb http://repo.mysql.com/apt/debian/ stretch mysql-5.7\ndeb-src http://repo.mysql.com/apt/debian/ stretch mysql-5.7″ > /etc/apt/sources.list.d/mysql.list
# wget -O /tmp/RPM-GPG-KEY-mysql https://repo.mysql.com/RPM-GPG-KEY-mysql –no-check-certificate
# apt-key add /tmp/RPM-GPG-KEY-mysql
# apt update
# apt install mysql-server
# systemctl status mysql
# mysql -p
Edição do arquivo do PHP:
# vim /etc/php5/apache2/php.ini
# vim /etc/php/7.0/apache2/php.ini
post_max_size = 16M
max_execution_time = 300
date.timezone = America/Sao_Paulo
max_input_time = 300
always_populate_raw_post_data = -1
# groupadd zabbix
# useradd -g zabbix zabbix
# cd /zabbix_3.2.7
# ./configure –enable-server –enable-agent –with-mysql –enable-ipv6 –with-net-snmp –with-libcurl –with-libxml2 –enable-java –with-jabber=/usr –with-openipmi –with-unixodbc –with-ssh2 -with-gnutls –with-ldap
# make
# make install
# groupadd zabbix
# useradd -g zabbix zabbix
# adduser zabbix zabbix
# sudo useradd -g zabbix -d /usr/local/share/zabbix -s /bin/false zabbix
# sudo usermod -aG www-data zabbix
# mysql -uroot -p
create database zabbix character set utf8;
use zabbix;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@10.5.1.201 IDENTIFIED BY ‘zabbix’ WITH GRANT OPTION;
grant all privileges on zabbix.* to ‘zabbix’@’localhost’ identified by ‘zabbix’;
flush privileges;
# cd zabbix-3.2.7/database/mysql
# mysql -u zabbix -p zabbix < schema.sql
# mysql -u zabbix -p zabbix < images.sql
# mysql -u zabbix -p zabbix < data.sql
–> Arquivo de serviços
# cp /tmp/zabbix-3.2.7/misc/init.d/debian/zabbix-server /etc/init.d/
# cp /tmp/zabbix-3.2.7/misc/init.d/debian/zabbix-agent /etc/init.d/
# update-rc.d zabbix-server defaults
# update-rc.d zabbix-agent defaults
# ln -s /usr/local/etc/ /etc/zabbix
# vim /etc/init.d/zabbix-server
### BEGIN INIT INFO
# Provides:  zabbix-server
# Required-Start:  $remote_fs $network
# Required-Stop:  $remote_fs
# Default-Start:  2 3 4 5
# Default-Stop:  0 1 6
# Should-Start:  mysql
# Should-Stop:  mysql
# Short-Description: Start zabbix-server daemon
### END INIT INFO
# vim /etc/init.d/zabbix-agent
### BEGIN INIT INFO
# Provides:  zabbix-agent
# Required-Start:  $remote_fs $network
# Required-Stop:  $remote_fs
# Default-Start:  2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start zabbix-agent daemon
### END INIT INFO
# systemctl daemon-reload
# service zabbix-server start
# service zabbix-agent start
# cp -a /tmp/zabbix-3.2.7/frontends/php/ /var/www/html/zabbix
# chown www-data. -R /var/www/html/zabbix
ListenPort=10051/
LogFile=/var/log/zabbix_server.log
DBHost=localhost   ## Replace with the IP of the remote database in case MySQL server is located on a different host
DBName=zabbix  ## Zabbix MySQL/Mariab database name
DBUser =zabbix   ## Zabbix MySQL/Mariab database username
DBPassword=password  ## Zabbix MySQL/Mariab database password
DBSocket=/var/run/mysqld/mysqld.sock
DBPort=3306
# touch /var/log/zabbix_server.log
# chmod 775 /var/log/zabbix_server.log
# chgrp zabbix /var/log/zabbix_server.log
# chown www-data. -Rf /var/www/html/zabbix_frontend
# chmod 775 -Rf /var/www/html/zabbix_frontend
Inicie o agente e o servidor zabbix:
/usr/local/sbin/zabbix_server
/usr/local/sbin/zabbix_agentd
/usr/local/sbin/zabbix_agent
# netstat -tulpn
–> instalação pela gui
# locale -a
# locale-gen pt_BR.UTF-8 UTF-8
# locale-gen pt_BR ISO-8859-1
# dpkg-reconfigure locales
# /etc/init.d/apache2 restart
bibliografia
=========================================================
Monitoramento snmp zabbix server debian 9 php7.0
Para testar se está funcionando:
# snmpwalk -v 2c -c Nome_Comunidade IP_Dispositivo
# snmpwalk -v 2c -c Nome_Comunidade IP_Dispositivo
Pode ser necessário instalar os pacotes abaixo relacionados para que funcione:
apt-get install snmp snmp-mibs-downloader
Autor: Giusepe Dias

8 thoughts on “Instalação compilada do Zabbix no PHP 5.6 e PHP 7.0”

  1. We’re a group of volunteers and starting a new scheme in our community. Your website provided us with valuable info to work on. You have done an impressive activity and our whole community will probably be thankful to you.

  2. Hi there! I could have sworn I’ve been to this website before but after reading through some of the post I realized it’s new to me. Anyhow, I’m definitely happy I found it and I’ll be book-marking and checking back often!

  3. Good post. I study one thing tougher on totally different blogs everyday. It should all the time be stimulating to learn content from other writers and apply a bit something from their store. I’d favor to use some with the content material on my blog whether you don’t mind. Natually I’ll offer you a hyperlink in your web blog. Thanks for sharing.

  4. I used to be very pleased to seek out this web-site.I needed to thanks in your time for this glorious read!! I definitely enjoying every little bit of it and I’ve you bookmarked to check out new stuff you weblog post.

Leave a Reply

Your email address will not be published. Required fields are marked *