|
Installation du serveur zabbix |
1. Create the ZABBIX superuser account
This is the user the server will run as. For production use you should create a dedicated unprivileged account ('zabbix' is commonly used). Running ZABBIX as 'root','bin', or any other account with special rights is a security risk. Do not do it!
Note: ZABBIX server process (zabbix_server) is protected from being run under root account. 2. Untar ZABBIX sources
shell> gunzip zabbix.tar.gz && tar -xvf zabbix.tar
3. Create the ZABBIX database.
ZABBIX comes with SQL scripts used to create the required database schema and also to insert a default configuration. There are separate scripts for MySQL and PostgreSQL.
For MySQL:
shell> mysql -u<username> -p<password> mysql> create database zabbix; mysql> quit; shell> cd create/mysql shell> cat schema.sql |mysql -u<username> -p<password> zabbix shell> cd ../data shell> cat data.sql |mysql -u<username> -p<password> zabbix
For PostgreSQL:
shell> psql -U <username> psql> create database zabbix; psql> \q shell> cd create/postgresql shell> cat schema.sql|psql -U <username> zabbix shell> cd ../data shell> cat data.sql|psql -U <username> zabbix
4. Configure and compile the source code for your system
The sources must be compiled for both the server (monitoring machine)
as well as the clients (monitored machines). To configure the source
for the server, you must specify which database will be used.
shell> ./configure --enable-server --with-mysql --with-net-snmp # for MySQL
or
shell> ./configure --enable-server --with-pgsql --with-net-snmp # for PostgreSQL make
Note: Use flag --enable-static to statically link libraries. If you
plan to distribute compiled binaries among different servers, you must
use this flag to make these binaries work without required libraries.
--enable-static does not work under Solaris. Flag --with-ucd-snmp can
be used instead of --with-net-snmp. If no SNMP support required, both
--with-net-snmp and --with-ucd-snmp may be skipped.
However, if you want to compile client binaries along with server binaries, run:
shell> ./configure --enable-server --enable-agent --with-mysql --with-net-snmp
Parameter —enable-static may be used to force static linkage.
5. Make and install everything:
shell> make install
By default,
make install
will install all the files in /usr/local/bin, /usr/local/lib etc. You
can specify an installation prefix other than /usr/local using --prefix
6. Configure /etc/services
The step is not real requirement. However, it is recommended. On the
client (monitored) machines, add the following lines to /etc/services:
zabbix_agent 10050/tcp
zabbix_trap 10051/tcp
7. Configure /etc/inetd.conf
If you plan to use zabbix_agent instead of the recommended zabbix_agentd, the following line must be added:
zabbix_agent stream tcp nowait.3600 zabbix /opt/zabbix/bin/zabbix_agent
Restart inetd
shell> killall -HUP inetd
Modify default settings in configuration files
8. Configure /etc/zabbix/zabbix_agent.conf
You need to configure this file for every host having zabbix_agent
installed. The file should contain IP address of ZABBIX server.
Connections from other hosts will be denied. You may take
misc/conf/zabbix_agent.conf as example.
9. Configure /etc/zabbix/zabbix_agentd.conf
You need to configure this file for every host with zabbix_agentd
installed. The file should contain the IP address of the ZABBIX server.
Connectionsfrom other hosts will be denied. You may take
misc/conf/zabbix_agentd.conf as example.
10. Configure /etc/zabbix/zabbix_server.conf
For small installations (up to ten monitored hosts), default parameters
are sufficient. However, you should change default parameters to
maximize performance from ZABBIX. See section [Performance tuning] for
more details.
You may take misc/conf/zabbix_server.conf as example.
11. Run server processe
Run zabbix_server on server side.
shell> cd bin
shell> ./zabbix_server
12. Run agents
Run zabbix_agentd where necessary.
shell> cd bin
shell> ./zabbix_agentd
|