Difference between revisions of "Zabbix"

From ArchWiki
Jump to: navigation, search
(Configuration)
(20 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[ru:Tmux]]
+
[[ru:Zabbix]]
 
[[Category:Status monitoring and notification]]
 
[[Category:Status monitoring and notification]]
 
{{Article summary start}}
 
{{Article summary start}}
Line 10: Line 10:
 
{{Article summary wiki|Monit}}
 
{{Article summary wiki|Monit}}
 
{{Article summary wiki|Icinga}}
 
{{Article summary wiki|Icinga}}
 +
{{Article summary wiki|Zenoss}}
 
{{Article summary end}}
 
{{Article summary end}}
[http://zabbix.com Zabbix] is a full-featured monitoring solution for larger networks. It
+
[http://zabbix.com Zabbix] is a full-featured monitoring solution for larger networks. It can discover all kind of networking devices using different methods, check machine states and applications, sending pre-defined alarm messages and visualize complex data correlations.
  
==Server Installation==
+
==Server setup ==
If you want to use the Zabbix server with [[MariaDB]], install {{aur|zabbix-server-mysql}} from the [[AUR]]. For [[PostgreSQL]] as database backend, you should use {{aur|zabbix-server}}.
+
=== Installation ===
You may edit the [[PKGBUILD]]s when you plan to use Nginx as web-server, since by default they have a {{Pkg|apache}} and {{Pkg|php-apache}} dependency.
+
If you want to use the Zabbix server with [[MariaDB]], install {{AUR|zabbix-server-mysql}} from the [[AUR]]. For [[PostgreSQL]] as database backend, you should use {{AUR|zabbix-server}}. You also have to choose a web server with PHP support, e.g.:
 +
*[[LAMP|Apache]]
 +
*[[Lighttpd]]
 +
*[[NginX]]
 +
Or one of the other servers found in the [[:Category:Web Server|web server]] category.
 +
You may edit the [[PKGBUILD]]s if you plan to use Nginx as web-server, since by default they have {{Pkg|apache}} and {{Pkg|php-apache}} as dependency.
  
 
===Configuration===
 
===Configuration===
Line 22: Line 28:
 
Make sure to adjust following variables to these minimal values in your <code>php.ini</code>:
 
Make sure to adjust following variables to these minimal values in your <code>php.ini</code>:
 
{{hc|/etc/php/php.ini|
 
{{hc|/etc/php/php.ini|
<nowiki>post_max_size = 16M
+
<nowiki>extension=bcmath.so
 +
extension=gd.so
 +
extension=sockets.so
 +
post_max_size = 16M
 
max_execution_time = 300
 
max_execution_time = 300
 
max_input_time = 300
 
max_input_time = 300
 
date.timezone = "UTC"
 
date.timezone = "UTC"
extension=sockets.so</nowiki>}}
+
</nowiki>}}
In this example, we create a MariaDB database called <code>zabbix</code> for the user <code>zabbix</code> identified by the password <code>test</code> and then import the database templates. This connection will be later used by the Zabbix server and web application:
+
In this example, we create on localhost a MariaDB database called <code>zabbix</code> for the user <code>zabbix</code> identified by the password <code>test</code> and then import the database templates. This connection will be later used by the Zabbix server and web application:
 
{{bc|mysql -u root -p -e "create database zabbix"
 
{{bc|mysql -u root -p -e "create database zabbix"
 
mysql -u root -p -e "grant all on zabbix.* to zabbix@localhost identified by 'test'"
 
mysql -u root -p -e "grant all on zabbix.* to zabbix@localhost identified by 'test'"
gunzip /usr/share/zabbix-server-mysql/*.sql.gz
+
mysql -u zabbix -p zabbix < /etc/zabbix/database/schema.sql
mysql -u zabbix -p zabbix < /usr/share/zabbix-server-mysql/schema.sql
+
mysql -u zabbix -p zabbix < /etc/zabbix/database/images.sql
mysql -u zabbix -p zabbix < /usr/share/zabbix-server-mysql/images.sql
+
mysql -u zabbix -p zabbix < /etc/zabbix/database/data.sql}}
mysql -u zabbix -p zabbix < /usr/share/zabbix-server-mysql/data.sql}}
+
Adjust database settings in <code>zabbix_server.conf</code>:
 +
{{hc|/etc/zabbix/zabbix_server.conf|
 +
<nowiki>DBHost=mysql.local
 +
DBName=zabbix
 +
DBUser=zabbix
 +
DBPassword=test
 +
</nowiki>}}
  
 
=== Starting ===
 
=== Starting ===
Line 39: Line 54:
 
{{bc|systemctl enable zabbix-server
 
{{bc|systemctl enable zabbix-server
 
systemctl start zabbix-server}}
 
systemctl start zabbix-server}}
Finally you can access Zabbix via your local web server, e.g.: http://127.0.0.1/zabbix The default username is '''Admin''' and password '''zabbix'''.
+
Finally you can access Zabbix via your local web server, e.g.: http://127.0.0.1/zabbix , finish the installation wizard and access the frontend the first time. The default username is '''Admin''' and password '''zabbix'''.
  
==Agent (Client) Installation==
+
See appendix for a link to the official documentation, which explains all further steps in using it.
Currently, the server package already includes {{aur|zabbix-agent}}, so you don't have to install this package on your monitoring server. However, for monitoring targets, the client part is more minimal, standalone and easy to deploy, just install {{aur|zabbix-agent}}.
+
 
 +
==Agent (Client) setup ==
 +
=== Installation ===
 +
Currently, the server package already includes {{AUR|zabbix-agent}}, so you don't have to install this package on your monitoring server. However, for monitoring targets, the client part is more minimal, standalone and easy to deploy, just install {{AUR|zabbix-agent}}.
 
===Configuration===
 
===Configuration===
 
Simply edit the zabbix_agentd.conf and replace the server variable with the IP of your monitoring server. Only servers from this/these IP will be allowed to access the agent.
 
Simply edit the zabbix_agentd.conf and replace the server variable with the IP of your monitoring server. Only servers from this/these IP will be allowed to access the agent.
Line 48: Line 66:
 
<nowiki>Server=127.0.0.1
 
<nowiki>Server=127.0.0.1
 
ServerActive=</nowiki>}}
 
ServerActive=</nowiki>}}
 +
Further make sure the port <code>10050</code> on your device being monitored isn't blocked and is properly forwarded.
 +
 
=== Starting ===
 
=== Starting ===
 
To enable and start the agent, run:
 
To enable and start the agent, run:

Revision as of 17:42, 20 March 2014

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end Zabbix is a full-featured monitoring solution for larger networks. It can discover all kind of networking devices using different methods, check machine states and applications, sending pre-defined alarm messages and visualize complex data correlations.

Server setup

Installation

If you want to use the Zabbix server with MariaDB, install zabbix-server-mysqlAUR from the AUR. For PostgreSQL as database backend, you should use zabbix-serverAUR. You also have to choose a web server with PHP support, e.g.:

Or one of the other servers found in the web server category. You may edit the PKGBUILDs if you plan to use Nginx as web-server, since by default they have apache and php-apache as dependency.

Configuration

Symlink the Zabbix web application directory to your http document root, e.g.:

ln -s /usr/share/webapps/zabbix /var/www

Make sure to adjust following variables to these minimal values in your php.ini:

/etc/php/php.ini
extension=bcmath.so
extension=gd.so
extension=sockets.so
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = "UTC"

In this example, we create on localhost a MariaDB database called zabbix for the user zabbix identified by the password test and then import the database templates. This connection will be later used by the Zabbix server and web application:

mysql -u root -p -e "create database zabbix"
mysql -u root -p -e "grant all on zabbix.* to zabbix@localhost identified by 'test'"
mysql -u zabbix -p zabbix < /etc/zabbix/database/schema.sql
mysql -u zabbix -p zabbix < /etc/zabbix/database/images.sql
mysql -u zabbix -p zabbix < /etc/zabbix/database/data.sql

Adjust database settings in zabbix_server.conf:

/etc/zabbix/zabbix_server.conf
DBHost=mysql.local
DBName=zabbix
DBUser=zabbix
DBPassword=test

Starting

To enable the and start server process, run:

systemctl enable zabbix-server
systemctl start zabbix-server

Finally you can access Zabbix via your local web server, e.g.: http://127.0.0.1/zabbix , finish the installation wizard and access the frontend the first time. The default username is Admin and password zabbix.

See appendix for a link to the official documentation, which explains all further steps in using it.

Agent (Client) setup

Installation

Currently, the server package already includes zabbix-agentAUR, so you don't have to install this package on your monitoring server. However, for monitoring targets, the client part is more minimal, standalone and easy to deploy, just install zabbix-agentAUR.

Configuration

Simply edit the zabbix_agentd.conf and replace the server variable with the IP of your monitoring server. Only servers from this/these IP will be allowed to access the agent.

/etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1
ServerActive=

Further make sure the port 10050 on your device being monitored isn't blocked and is properly forwarded.

Starting

To enable and start the agent, run:

systemctl enable zabbix-agentd
systemctl start zabbix-agentd

See also