zabbix搭建
1、添加zabbix用户
groupadd zabbix -g 201
useradd -g zabbix -u 201 -m zabbix
yum install net-snmp-devel curl curl-devel mysql-devel php-bcmath
3、解压
tar zxvf zabbix-3.0.7.tar.gz
4、拷贝到/usr/local/zabbix
mv /usr/local/class="lazy" data-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
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341