Advertisement
h3tec

Zabbix Server no Debian 9

Feb 25th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. # Ajustando o repositorio
  2. apt intall net-tools -y
  3. vim /etc/apt/sources.list
  4. deb http://ftp.br.debian.org/debian/ jessie-updates main contrib non-free
  5. apt-get update
  6.  
  7. # Instalando as dependencias
  8. apt-get install build-essential mysql-server install libmysqld-dev libiksemel-dev libxml2-dev unixodbc-dev libsnmp-dev libssh2-1-dev libopenipmi-dev libgnutls28-dev openjdk-7-jdk libldap2-dev libcurl4-gnutls-dev mysql-client-5.5 fping
  9.  
  10. # Baixar o pacote para copilação.
  11. https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.4.7/zabbix-3.4.7.tar.gz/download
  12.  
  13. # Descompactando
  14. tar xf zabbix-3.4.7.tar.gz
  15.  
  16. # Realizando as configurações dos pacotes
  17. ./configure --enable-server --enable-agent --enable-java --with-mysql --with-net-snmp --with-jabber=/usr --with-libxml2 --with-openipmi --with-unixodbc --with-ssh2 --with-gnutls --with-ldap --with-libcurl
  18.  
  19. make install
  20.  
  21. # Criando o banco de dados
  22. mysql -u root -p
  23. mysql> create database zabbix character set utf8;
  24. mysql> use zabbix;
  25. mysql> GRANT ALL PRIVILEGES ON zabbix.* TO
  26. zabbix@localhost IDENTIFIED BY 'zabbix'
  27. WITH GRANT OPTION;
  28. mysql> quit;
  29.  
  30. # Carga da base de dados
  31. cd /tmp/zabbix-3.2.0/database/mysql
  32. mysql -uzabbix -p zabbix < schema.sql
  33. mysql -uzabbix -p zabbix < images.sql
  34. mysql -uzabbix -p zabbix < data.sql
  35.  
  36. # Arquivos de serviços
  37. cp /tmp/zabbix-3.2.0/misc/init.d/debian/zabbix-server /etc/init.d/
  38. cp /tmp/zabbix-3.2.0/misc/init.d/debian/zabbix-agent /etc/init.d/
  39. update-rc.d zabbix-server defaults
  40. update-rc.d zabbix-agent defaults
  41. ln -s /usr/local/etc/ /etc/zabbix
  42.  
  43. # Configurando o zabbix-server
  44. vim /etc/zabbix/zabbix_server.conf
  45. LogFile=/tmp/zabbix_server.log
  46. LogFileSize=10
  47. DebugLevel=3
  48. PidFile=/tmp/zabbix_server.pid
  49. DBHost=localhost
  50. DBName=zabbix
  51. DBUser=zabbix
  52. DBPassword=zabbix
  53.  
  54. # Configurando o zabbix-agentd
  55. vim /etc/zabbix/zabbix_agentd.conf
  56. PidFile=/tmp/zabbix_agentd.pid
  57. LogFile=/tmp/zabbix_agentd.log
  58. LogFileSize=10
  59. Server=127.0.0.1
  60. ServerActive=127.0.0.1
  61. Hostname=Zabbix Server
  62.  
  63. # Ajustar script de inicialização zabbix-server
  64. vim /etc/init.d/zabbix-server
  65. ### BEGIN INIT INFO
  66. # Provides: zabbix-server
  67. # Required-Start: $remote_fs $network
  68. # Required-Stop: $remote_fs
  69. # Default-Start: 2 3 4 5
  70. # Default-Stop: 0 1 6
  71. # Should-Start: mysql
  72. # Should-Stop: mysql
  73. # Short-Description: Start zabbix-server daemon
  74. ### END INIT INFO
  75.  
  76. # Ajustar script de inicialização zabbix-agentd
  77. vim /etc/init.d/zabbix-agent
  78. ### BEGIN INIT INFO
  79. # Provides: zabbix-server
  80. # Required-Start: $remote_fs $network
  81. # Required-Stop: $remote_fs
  82. # Default-Start: 2 3 4 5
  83. # Default-Stop: 0 1 6
  84. # Short-Description: Start zabbix-agent daemon
  85. ### END INIT INFO
  86.  
  87. # Recarregar configurações e iniciar os serviços
  88. systemctl daemon-reload
  89. service zabbix-server start
  90. service zabbix-agent start
  91.  
  92. # Instalação da interface web
  93. ################################
  94. # Atualizar script para php7
  95. ################################
  96. apt-get install apache2 php5 php5-gd php5-ldap php5-mysql php5-cli php5-common php5-curl php5-json php5-xmlrpc php5-mcrypt
  97. cp -a /tmp/zabbix-3.2.0/frontends/php/ /var/www/html/zabbix
  98. chown www-data. -R /var/www/html/zabbix
  99.  
  100. # Configurando o PHP
  101. vim /etc/php5/apache2/php.ini
  102. post_max_size = 16M
  103. max_execution_time = 300
  104. max_input_time = 300
  105. date.timezone = ‘America/Sao_Paulo’
  106. always_populate_raw_post_data = -1
  107.  
  108. # Acessando a interface web com o navegador no
  109. http://<host>/zabbix
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement