zabbix install

Environment Introduction
OS: Ubuntu 10.10 Server 64-bit
Servers:
zabbix-server:192.168.1.151
zabbix-client-1:192.168.1.151

1. Environment deployment
In the previous, we briefly introduced Zabbix, then in this chapter, we will deploy the environment of Zabbix, and then explain its usage in detail in the next page.
Since Zabbix adopts a distributed architecture, we use two servers, one for Server and the other for Agent, to build a minimal environment.

2. Installation steps
2.1 Install system dependencies and mysql-server and php
$ sudo apt-get install build-essential mysql-server libmysqlclient15-dev php5 php5-gd php5-mysql snmp libsnmp-dev snmpd libcurl4-openssl-dev fping apache2

Configure the MySQL Root password in the pop-up interface, such as zabbixadmin
MySQL password: zabbixadmin

2.2 Create a new user zabbix
$ sudo adduser zabbix

1 Enter new UNIX password: zabbix
2 Retype new UNIX password: zabbix

$ sudo adduser zabbix admin
$ sudo visudo
add the following to give the Zabbix user sudo privileges

1 zabbix ALL=(ALL)       NOPASSWD:ALL

2.3 下载源码包
$ sudo -i
# su - zabbix
$ wget "http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.0.4/zabbix-2.0.4.tar.gz"
$ tar xzvf zabbix-2.0.4.tar.gz

2.4 初始化数据库
$ mysql -uroot -pzabbixadmin -e "create database zabbix;"
$ mysql -uroot -pzabbixadmin -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';"
$ mysql -uzabbix -pzabbix -D zabbix < zabbix-2.0.4/database/mysql/schema.sql
$ mysql -uzabbix -pzabbix -D zabbix < zabbix-2.0.4/database/mysql/images.sql
$ mysql -uzabbix -pzabbix -D zabbix < zabbix-2.0.4/database/mysql/data.sql

2.5 编译安装
$ cd zabbix-2.0.4/
$ ./configure --prefix=/usr/local --with-mysql --with-net-snmp --with-libcurl --enable-server --enable-agent
$ make
$ sudo make install

2.6 Modify the database configuration file
$ cd /usr/local/etc
$ sudo vim zabbix_server.conf

1 DBUser=zabbix
2 DBPassword=zabbix

2.7 创 〒 Service Management Screenplay
$ cd
$ sudo cp zabbix-2.0.4 / misc / init.d/debian/zabbix-* /etc/init.d/
$ sudo chmod 755 /etc/init.d/zabbix-*
$ sudo update-rc.d zabbix-server defaults
$ sudo update-rc.d zabbix-agent defaults

2.8 Start the service
$ sudo /etc/init.d/zabbix-server start
$ sudo /etc/init.d/zabbix-agent start
$ ps aux | grep zabbix

2.9 Copy website code files
$ cd
$ mkdir /home/zabbix/public_html
$ cp -R zabbix-2.0.4/frontends/php/* /home/zabbix/public_html/

2.10 Configure virtual host
$ sudo vim /etc/apache2/sites-enabled/000-default

01 Alias /zabbix /home/zabbix/public_html/
02 <Directory /home/zabbix/public_html>
03     AllowOverride FileInfo AuthConfig Limit Indexes
04     Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
05     <Limit GET POST OPTIONS PROPFIND>
06     Order allow,deny
07     Allow from all
08     </Limit>
09     <LimitExcept GET POST OPTIONS PROPFIND>
10     Order deny,allow
11     Deny from all
12     </LimitExcept>
13 </Directory>

2.11 Placement PHP
$ sudo vi /etc/php5/apache2/php.ini

1 max_execution_time = 300
2 max_input_time= 600
3 post_max_size= 16M
4 date.timezone = Asia/Shanghai

2.12 Restart Apache
$ sudo /etc/init.d/apache2 restart

2.13 Add alert.d directory
$ sudo vim /usr/local/etc/zabbix_server.conf

1 AlertScriptsPath=/usr/local/etc/alert.d

$ sudo mkdir /usr/local/etc/alert.d

2.14 安装 mailutils
$ sudo apt-get install sendemail mailutils

2.15 Open the web page installation wizard
Address: http://10.6.1.181/zabbix
Account: Admin
Password: zabbix

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326985713&siteId=291194637