Tag Archives: Zabbix

CentOS 5.5 Zabbix 1.8.3

Изучим альтернативу Nagios Zabbix

Архитектура Zabbix

Устанавливаем репозиторий

# rpm -ivh http://nixtime.ru/repository/centos/5/x86_64/centnixtime-release-5-5.el5.noarch.rpm
# yum check-update

Устанавливаем Zabbix

# yum -y install zabbix.i386 zabbix-agent.i386 zabbix-server-mysql.i386 zabbix-web.i386

Установка Apache MySQL PHP

# yum -y install httpd
# chkconfig httpd on
# service httpd start
# yum install mysql mysql-server
# chkconfig mysqld on
# service mysqld start

Воспользуемся скриптом для настройки безопасности MySQL сервера

# /usr/bin/mysql_secure_installation
Change the root password? [Y/n]
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n]
Reload privilege tables now? [Y/n]
All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
# yum install php php-mbstring php-mysql
# mcedit /etc/php.ini
    max_execution_time = 300 ; Maximum execution time of each script, in seconds
    post_max_size = 16M ; Maximum size of POST data that PHP will accept.
    max_input_tine = 300 ; Maximum amount of time each script may spend parsing request data
    date.timezone = Europe/Kiev ; Defines the default timezone used by the date functions
# service httpd restart

Создаем базу данных для zabbix-server

[root@test /]# mysql -u root -p
mysql> create database zabbix;
mysql> GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost' IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;
mysql> QUIT;

Импортируем первоначальные настройки и шаблоны.

mysql -u root -p zabbix < /usr/share/doc/zabbix-server-mysql-1.8.3/create/schema/mysql.sql
mysql -u root -p zabbix < /usr/share/doc/zabbix-server-mysql-1.8.3/create/data/data.sql
mysql -u root -p zabbix < /usr/share/doc/zabbix-server-mysql-1.8.3/create/data/images_mysql.sql

Настройка Zabbix
Файл /etc/zabbix/zabbix_server.conf

DBHost=localhost
DBUser=zabbix
DBName=zabbix
DBPassword=password

Файл /etc/zabbix/web/zabbix.conf.php

$DB["TYPE"]             = 'MYSQL';
$DB["SERVER"]           = 'localhost';
$DB["PORT"]             = '0';
$DB["DATABASE"]         = 'zabbix';
$DB["USER"]             = 'zabbix';
$DB["PASSWORD"]         = 'password';
$ZBX_SERVER             = 'localhost';
$ZBX_SERVER_PORT        = '10051';
$ZBX_SERVER_NAME        = '';

Запускаем Zabbix

# chkconfig zabbix-agent on
# chkconfig zabbix-server on
# service zabbix-agent start
Starting ZABBIX agent:                                     [  OK  ]
# service zabbix-server start
Starting ZABBIX server:                                    [  OK  ]

Настройка Web интерфейса
Заходим по адресу http://ip.ip.ip.ip/zabbix/setup.php

Вводим логин/пароль admin/zabbix

Licence Agreement

Check of pre-requisites

Configure DB connection

Zabbix server details

Pre-Installation Summary

Install

Finish

Установка завершена