zabbix搭建
1、添加zabbix用户
创新互联公司是一家集网站建设,青阳企业网站建设,青阳品牌网站建设,网站定制,青阳网站建设报价,网络营销,网络优化,青阳网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。
groupadd zabbix -g 201
useradd -g zabbix -u 201 -m zabbix
yum install net-snmp-devel curl curl-devel MySQL-develphp-bcmath
3、解压
tar zxvf zabbix-3.0.7.tar.gz
4、拷贝到/usr/local/zabbix
mv /usr/local/src/zabbix-3.0.7 /usr/local/zabbix
5、编译
cd /usr/local/zabbix/
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-net-snmp --with-libcurl --enable-proxy --with-mysql=/usr/local/mysql/bin/mysql_config
期间会报很多错,yum相关的包就可以了
6、make;make install
7、zabbix 数据库
进入mysql
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;
导入数据库
cd /usr/local/zabbix/database/mysql/
mysql -uzabbix -pzabbix zabbix < schema.sql
mysql -uzabbix -pzabbix zabbix < p_w_picpaths.sql
mysql -uzabbix -pzabbix zabbix < data.sql
8、拷贝脚本
cd /usr/local/zabbix/misc/init.d/fedora/core
cp zabbix_server /etc/init.d/
cp zabbix_agentd /etc/init.d
chmod 755 /etc/init.d/zabbix_*
9、vi /etc/init.d/zabbix_server
修改zabbix的安装目录 BASEDIR=/usr/local/zabbix
vi /etc/init.d/zabbix_agentd
修改zabbix的安装目录 BASEDIR=/usr/local/zabbix
10、修改zabbix_server.conf
vi /usr/local/zabbix/etc/zabbix_server.conf
DBUser=zabbix
DBPassword=zabbix
AllowRoot=1
DBSocket=/tmp/mysql.sock (ps aux|grep mysqld 可知)
11、把zabbix文件拷贝到ngixn目录下
cd /usr/local/zabbix
mkdir -p /data/web/zabbixServer/
cp -r frontends/php/* /data/web/zabbixServer/
mkdir -p /usr/local/nginx/conf/vhosts
修改 vi /usr/local/nginx/conf/vhosts/zabbix.conf
1.server_name 2.root 3 添加index.php 4.root 5. fastcgi
server {
listen 80;
server_name 121.201.24.236;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /data/web/zabbixServer;
index index.php index.html index.htm;
}
location ~ \.php$ {
root /data/web/zabbixServer;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/web/zabbixServer$fastcgi_script_name;
include fastcgi_params;
}
12、修改php.ini文件
vi /usr/local/php/etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
post_max_size = 32M
max_input_time = 300
mbstring.func_overload = 1
service php-fpm reload
接下来就可以在浏览器web配置http://121.201.24.236/setup.php
本文题目:zabbix搭建
当前路径:http://myzitong.com/article/gechjo.html