Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:monitoring:zabbix:install [2019/10/22 11:53] jlucas |
linux:monitoring:zabbix:install [2019/11/06 12:43] (current) jlucas |
||
---|---|---|---|
Line 7: | Line 7: | ||
For this install, I have setup an OpenBSD vmm instace with a fresh install of OpenBSD 6.6 (amd64). | For this install, I have setup an OpenBSD vmm instace with a fresh install of OpenBSD 6.6 (amd64). | ||
- | ====Prep OpenBSD | + | ====OpenBSD |
===Increase some limits=== | ===Increase some limits=== | ||
Line 37: | Line 37: | ||
Install utilities needed to configure and install Zabbix | Install utilities needed to configure and install Zabbix | ||
- | doas pkg_add | + | doas pkg_add |
===Install PostgreSQL=== | ===Install PostgreSQL=== | ||
Line 87: | Line 87: | ||
Enable and start the PostgreSQL server | Enable and start the PostgreSQL server | ||
- | | + | doas rcctl enable postgresql |
+ | |||
+ | Populate the Zabbix DB within PostgreSQL | ||
+ | |||
+ | Create Zabbix PostgreSQL user | ||
+ | |||
+ | doas -u _postgresql createuser -U postgres --pwprompt zabbix | ||
+ | Enter password for new role: | ||
+ | Enter it again: | ||
+ | Password: | ||
+ | |||
+ | Setup the database for Zabbix with the just create Zabbix user | ||
+ | |||
+ | doas -u _postgresql createdb -U postgres -O zabbix -E Unicode -T template0 zabbix | ||
+ | |||
+ | Configure the database for Zabbix server. | ||
+ | |||
+ | DBPassword=password | ||
====Zabbix Server from packages==== | ====Zabbix Server from packages==== | ||
Line 93: | Line 110: | ||
Install Zabbix server and agent from the package tree | Install Zabbix server and agent from the package tree | ||
- | doas pkg_add zabbix_server | + | doas pkg_add |
+ | |||
+ | Import the initial schema and data | ||
+ | |||
+ | cat / | ||
+ | # stop here if you are creating database for Zabbix proxy | ||
+ | cat / | ||
+ | cat / | ||
+ | |||
+ | Enable and start daemons | ||
+ | |||
+ | doas rcctl enable | ||
+ | doas rcctl start zabbix_server | ||
+ | doas rcctl enable zabbix_agentd | ||
+ | doas rcctl start zabbix_agentd | ||
+ | |||
+ | Tail log file to make sure zabbix is running and working as expected | ||
+ | |||
+ | tail -f / | ||
====Zabbix Server from source==== | ====Zabbix Server from source==== | ||
Line 111: | Line 146: | ||
doas useradd -g zabbix -d / | doas useradd -g zabbix -d / | ||
doas chown zabbix: | doas chown zabbix: | ||
- | |||
- | Populate the Zabbix DB within PostgreSQL | ||
- | |||
- | Create Zabbix PostgreSQL user | ||
- | |||
- | doas -u _postgresql createuser -U postgres --pwprompt zabbix | ||
- | Enter password for new role: | ||
- | Enter it again: | ||
- | Password: | ||
- | |||
- | Setup the database for Zabbix with the just create Zabbix user | ||
- | |||
- | doas -u _postgresql createdb -U postgres -O zabbix -E Unicode -T template0 zabbix | ||
Import the initial schema and data | Import the initial schema and data | ||
cd zabbix-4.4.0/ | cd zabbix-4.4.0/ | ||
- | cat schema.sql | doas -u zabbix | + | cat schema.sql | doas psql -U zabbix zabbix |
# stop here if you are creating database for Zabbix proxy | # stop here if you are creating database for Zabbix proxy | ||
- | cat images.sql | doas -u zabbix | + | cat images.sql | doas psql -U zabbix zabbix |
- | cat data.sql | doas -u zabbix | + | cat data.sql | doas psql -U zabbix zabbix |
Configure Zabbix source | Configure Zabbix source | ||
Line 144: | Line 166: | ||
doas make install | doas make install | ||
- | ====Install | + | ====Zabbix frontend |
- | We will use the bundled | + | Install package(s) |
+ | |||
+ | doas pkg_add zabbix-web-4.0.11p0 | ||
+ | |||
+ | Update | ||
+ | |||
+ | $DB[' | ||
+ | $DB[' | ||
+ | |||
+ | ====Install | ||
- | ===Install | + | ===Install PHP=== |
doas pkg_add php-7.3.10 php-pgsql-7.3.10 php-gd-7.3.10 php-ldap-7.3.10 | doas pkg_add php-7.3.10 php-pgsql-7.3.10 php-gd-7.3.10 php-ldap-7.3.10 | ||
- | Enable | + | Enable PHP extension |
doas ln -sf / | doas ln -sf / | ||
Line 165: | Line 196: | ||
max_execution_time = 300 | max_execution_time = 300 | ||
max_input_time = 300 | max_input_time = 300 | ||
+ | date.timezone = America/ | ||
===Configure / | ===Configure / | ||
Line 173: | Line 205: | ||
| | ||
types { | types { | ||
- | include "/ | + | |
} | } | ||
- | | + | server "HOSTNAME" { |
- | | + | listen on * tls port 443 |
- | listen on * port 80 | + | tls { |
- | + | | |
- | root "/htdocs" | + | key "/ |
- | directory index index.php | + | } |
- | + | | |
- | location " | + | directory |
- | fastcgi socket "/ | + | # Increase connection limits to extend the lifetime |
- | } | + | |
+ | connection { max request body 8388608 } | ||
+ | location "/ | ||
+ | block return 401 | ||
+ | } | ||
+ | | ||
+ | fastcgi socket "/ | ||
+ | } | ||
+ | location "/ | ||
+ | root "/ | ||
+ | request strip 2 | ||
+ | | ||
} | } | ||
- | Enable and start the bundled | + | Enable and start both the httpd and php73_fpm daemons: |
+ | doas rcctl enable php73_fpm | ||
+ | doas rcctl start php73_fpm | ||
doas rcctl enable httpd | doas rcctl enable httpd | ||
doas rcctl start httpd | doas rcctl start httpd | ||
+ | |||
+ | If you want to have a TLS secured connection, follow these instructions [[https:// | ||
+ | |||
+ | ====Zabbix frontend from source==== | ||
+ | |||
+ | We will use the bundled **// | ||
Copy Zabbix front-end web files to the correct location for httpd to serve them up. | Copy Zabbix front-end web files to the correct location for httpd to serve them up. | ||
doas cp -rp / | doas cp -rp / | ||
+ | |||
=====Debian 9===== | =====Debian 9===== | ||