This is an Ansible role for installing Zabbix web using nginx as a reverse proxy and PHP-FPM for FastCGI.
You may also be interested in:
- an Ansible role for Zabbix agent
- an Ansible role for the Zabbix server
- an Ansible role for nginx
- an Ansible role for php-fpm
This role explicitly assumes you have already installed nginx and PHP-FPM.
It also (more implicitly) assumes you have correctly installed Zabbix server and (at least one) agent. Without these pieces there will be little data in Zabbix web to see. (Though, honestly, it is often the case that only by seeing partially correct data through Zabbix web can Zabbix server & agents be properly configured...).
Installs the zabbix-frontend-php
package. This unfortunately forces
the installation of
Apache 2 but this
service is turned off immediately.
Creates the files:
/etc/zabbix/zabbix.conf.php
-- configuration file for Zabbix web PHP application/etc/php5/fpm/pool.conf/zabbix-web.conf
-- configuration file for pool of PHP-FPM resources/etc/logstash/conf.d/zabbix-web.conf
-- input file for logstash/var/log/zabbix-web
-- log directory/etc/nginx/sites-available/zabbix-web.conf
-- nginx configuration file
Adds a virtual host for nginx running over SSL on port 443 reverse proxying a newly created pool of PHP-FPM resources.
Use the role in a playbook like this:
- hosts: all
roles:
- zabbix-server
Set the zabbix_server_use_logstash
to false
to skip the logstash
configuration.
The following variables are exposed for configuration
mysql_root_password
-- the password for the MySQL root userzabbix_database_host
-- host for the databasezabbix_database_port
-- port for the databasezabbix_database_username
-- username to connect to the database aszabbix_database_password
-- password to connect to the database withzabbix_database_name
-- name of the databasezabbix_server_use_logstash
-- set tofalse
to skip logstash configuration
You will also want to set the following PHP-FPM variables (Zabbix web is aggressive...):
php_fpm_time_zone: UTC
php_fpm_memory_limit: 128M
php_fpm_post_max_size: 16M
php_fpm_upload_max_file_size: 2M
php_fpm_max_execution_time: 300
php_fpm_max_input_time: 300