Zabbix编译安转
zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供柔软的通知机制以让系统管理员快速定位/解决存在的各种问题。
1.系统版本
2.安装LAMP环境
[root@localhost ~]# yum install -y httpdphp php-mysql mysql mysql-server
3.安装GCC编译环境
[root@localhost ~]# yum install -y gccgcc-c++ gcc-java make
4.安装依赖包
[root@localhost ~]# yum install -ynet-snmp-devel curl-devel perl-devel perl-DBI php-gdphp-bcmath php-mbstring php-xml mysql-devel
5.添加zabbix服务帐户
[root@localhost ~]# useradd -r zabbix
6.下载源码包zabbix-2.0.8.tar.gz,解压
[root@localhost ~]# tar -zxvfzabbix-2.0.8.tar.gz
7.编译安装zabbix
[root@localhost zabbix-2.0.8]# ./configure --prefix=/usr/local/zabbix--with-mysql --with-net-snmp --with-libcurl --enable-server --enable-agent--enable-proxy
[root@localhost zabbix-2.0.8]# make install
8.启动Apache和MySQL
[root@localhost ~]# service httpd start;chkconfig httpd on
[root@localhost ~]# service mysqld start;chkconfig mysqld on
9.修改MySQL的root帐号密码
[root@localhost ~]# mysqladmin -u rootpassword ******
10.创建zabbix数据库
mysql> create database zabbix;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database|
+--------------------+
| information_schema |
| mysql|
| test|
| zabbix|
+--------------------+
4 rows in set (0.00 sec)
11.创建zabbix连接数据库帐户
mysql> grant all privileges on zabbix.*to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
12.导入zabbix数据库表
[root@localhost ~]# mysql -u zabbix -pzabbix < zabbix-2.0.8/database/mysql/schema.sql
[root@localhost ~]# mysql -u zabbix -pzabbix <zabbix-2.0.8/database/mysql/images.sql
[root@localhost ~]# mysql -u zabbix -pzabbix <zabbix-2.0.8/database/mysql/images.sql
13.添加服务端口
[root@localhost ~]# grep zabbix/etc/services
zabbix-agent10050/tcp# Zabbix Agent
zabbix-agent10050/udp# Zabbix Agent
zabbix-trapper10051/tcp# Zabbix Trapper
zabbix-trapper10051/udp# Zabbix Trapper
14.给/usr/local/zabbix/etc目录及文件权限
[root@localhost ~]# chown -R zabbix.zabbix/usr/local/zabbix/etc/
15.修改zabbix_server配置文件
[root@localhost ~]# vim/usr/local/zabbix/etc/zabbix_server.conf
87 DBName=zabbix
88 DBPassword=zabbix
16.修改zabbix_agentd配置文件
[root@localhost ~]# vim/usr/local/zabbix/etc/zabbix_agentd.conf
135 Hostname=localhost
17.添加web前端php文件,设置权限
[root@localhost ~]# cpzabbix-2.0.8/frontends/php/ /var/www/html/zabbix �Cr
[root@localhost ~]# chown -R zabbix.zabbix/var/www/html/zabbix/
18.修改php.ini参数
max_execution_time = 300
max_input_time = 300
memory_limit = 128M
date.timezone = Asia/Shanghai
post_max_size = 32M
Mbstring.func_overload = 2
改完参数后,需重启Apache
19.使用浏览器访问
[root@localhost ~]# firefoxhttp://localhost/zabbix &
20.运行环境检查
21.数据库连接检查
22.服务主机信息
23.安装信息汇总
24.点击Download configuration file 下载该文件,拷贝到/var/www/html/zabbix/conf/下,点击Retry重试,点击Finish