zabbix安裝環境準備
zabbix安裝需要LAMP環境支持
採用yum源安裝LAMP快速構建。
yum -y install gcc httpd php php-devel php-gd php-bcmath php-mbstring mysql mysql-devel mysql-server php-xml php-mysql gd net-snmp net-snmp-devel net-snmp-utils curl-devel
安裝後,啓動mysql
[root@zabbix111 ~]# /etc/init.d/mysqld start
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h zabbix111 password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
[ OK ]
Starting mysqld: [ OK ]
設置mysql密碼
[root@zabbix111 ~]# /usr/bin/mysqladmin -u root password '123456'
創建zabbix數據庫
[root@zabbix111 ~]# mysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.95 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database zabbix;
Query OK, 1 row affected (0.06 sec)
創建zabbix用戶與組
[root@zabbix111 ~]# groupadd zabbix
[root@zabbix111 ~]# useradd -g zabbix -m zabbix
解壓zabbix包
[root@zabbix111 ~]# tar zxvf zabbix-2.0.3.tar.gz
導入數據庫到mysql
[root@zabbix111 ~]# cd zabbix-2.0.3/database/mysql/
[root@zabbix111 mysql]# mysql -uroot -p123456 zabbix <./schema.sql
[root@zabbix111 mysql]# mysql -uroot -p123456 zabbix <./images.sql
[root@zabbix111 mysql]# mysql -uroot -p123456 zabbix <./data.sql
2.編譯安裝zabbix
[root@zabbix111 mysql]# cd ../../
[root@zabbix111 zabbix-2.0.3]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl
[root@zabbix111 zabbix-2.0.3]# make install
3.修改配置文件
[root@zabbix111 zabbix-2.0.3]# vi /etc/services
在最後增加
zabbix-agent 10050/tcp
zabbix-agent 10050/udp
zabbix-trapper 10051/tcp
zabbix-trapper 10051/udp
4.修改配置文件
服務端修改
[root@zabbix111 misc]# vi /usr/local/zabbix/etc/zabbix_server.conf
DBPassword=123456
本機客戶端修改
[root@zabbix111 misc]# vi /usr/local/zabbix/etc/zabbix_agentd.conf
hostname=zabbix111 #主機名
[root@zabbix111 zabbix-2.0.3]# cd frontends/
[root@zabbix111 frontends]# cp -r php /var/www/html/zabbix
修改php配置文件
[root@zabbix111 frontends]# vi /etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
max_input_time = 300
post_max_size = 32M
mbstring.func_overload = 2
修改完成後重啓apache
[root@zabbix111 frontends]# service httpd restart
[root@zabbix111 frontends]# /etc/init.d/iptables stop #防火牆關閉
[root@zabbix111 frontends]# chkconfig iptables off
開機啓動
[root@zabbix111 frontends]# chkconfig mysqld on
[root@zabbix111 frontends]# chkconfig httpd on
打開瀏覽器
Next
Next
Next
Next
Download下來放在/var/www/html/zabbix/conf目錄下後面點擊Retry後,在點擊Finish
[root@zabbix111 frontends]# cd /var/www/html/zabbix/conf
用戶名: admin 密碼:zabbix 默認的
說明zabbix服務沒有啓動
啓動zabbix服務端
[root@zabbix111 conf]# cp /usr/local/zabbix/sbin/zabbix_server /etc/init.d
啓動zabbix客戶端
[root@zabbix111 conf]# cp /usr/local/zabbix/sbin/zabbix_agentd /etc/init.dsetenforce 0
centos 安裝zabbix
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.