标签:zabbix
1、安装开发软件包
yum -y groupinstall "Development Tools"
2、安装所需的依赖包
yum -y install httpd mysql mysql-server php php-mysql php-common php-mbstring php-gd php-odbc php-pear curl curl-devel net-snmp net-snmp-devel perl-DBI php-xml ntpdate php-bcmath
3、同步服务端的时间,保持所有服务器时间一致避免出现时间不同导致的不可用的监控数据
ntpdate asia.pool.ntp.rog
4、创建zabbix服务运行所需要的用户和组
groupadd -g 201 zabbix
useradd -g zabbix -u 201 -m zabbix
5、初始化mysql服务器
/etc/init.d/mysqld start
6、设置mysql root密码
mysqladmin -uroot password "123456"
mysql>create database zabbix character set utf8; 创建数据库zabbix
mysql>grant all privileges on zabbix.* to zabbixuser@‘%‘ identified by ‘zabbixpass‘;
flush privileges;
7、下载解压zabbix
wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.0/zabbix-2.4.0.tar.gz
tar zxvf zabbix-2.4.0.tar.gz
cd zabbix-2.4.0
将zabbix初始数据导入数据库
mysql -uzabbixuser -pzabbixpass zabbix <database/mysql/schema.sql
mysql -uzabbixuser -pzabbixpass zabbix <database/mysql/images.sql
mysql -uzabbixuser -pzabbixpass zabbix <database/mysql/data.sql
8、编译安装zabbix
./configure –sysconfdir=/usr/local/zabbix/ –enable-server –enable-agent –with-net-snmp –with-libcurl –with-mysql
make&make install
制定配置的路径,默认为/usr/local/etc
9、复制zabbix server、agent端的启动脚本,并设置执行权限
cp misc/init.d/tru64/zabbix_agentd /etc/init.d/
cp misc/init.d/tru64/zabbix_server /etc/init.d/
chmod +x /etc/init.d/zabbix_*
10、配置php文件
vi /etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
max_input_time = 300
post_max_size = 32M
memory_limit = 128M
mbstring.func_overload = 2
11、配置apache文件,定义安装访问zabbix的虚拟主机
vim /etc/httpd/conf/httpd.conf
ServerName 127.0.0.1
<VirtualHost *:80>
DocumentRoot "/var/www/html"
ServerName 本机IP
</VirtualHost>
启动 服务
12、打开http://ip/zabbix/setup.php
标签:zabbix
原文地址:http://2860664.blog.51cto.com/2850664/1557377