接入说明

zabbix是由zabbix web、zabbix server、zabbix agent三部分组成,要接入bigops的sso只需要修改zabbix web即可,zabbix server和zabbix agent不需要做任何修改。

现在已支持的zabbix web版本包括:

确认当前Zabbix域名没有第二层目录

http://zabbix.bigops.com ,正确

http://zabbix.bigops.com/zabbix ,错误

修改/etc/hosts

如果没有注册域名,需要给服务器和笔记本系统都配置hosts。

Linux位置/etc/hosts,Windows位置C:\Windows\System32\drivers\etc\hosts

配置内容,例如:

192.168.100.2 zabbix.bigops.com (替换为你服务器IP和域名)

安装zabbix

wget -O /etc/yum.repos.d/zabbix.repo http://www.bigops.com/yum.repos.d/zabbix.repo

yum install -y php php-mysql php-gd php-fpm php-mbstring mcrypt php-mcrypt php-bcmath php-xml php-xmlrpc php-ldap php-pecl-mysql net-snmp net-snmp-devel net-snmp-libs net-snmp-utils fping mysql-devel gcc iksemel libiksemel libevent-devel libcurl-devel libxml2-devel libssh2-devel OpenIPMI-devel unixODBC unixODBC-devel glibc-static libcurl-devel git openssl-devel pcre-devel zlib zlib-devel zabbix-server-mysql zabbix-web-mysql zabbix-agent nginx systemd-devel java-1.8.0-openjdk java-1.8.0-openjdk-devel

设置PHP

ln -s /usr/lib64/mysql/libmysqlclient.so /usr/lib/libmysqlclient.so

sed -i 's/user = apache/user = nginx/g' /etc/php-fpm.d/www.conf

sed -i 's/group = apache/group = nginx/g' /etc/php-fpm.d/www.conf

sed -i 's/;listen.owner = nobody/listen.owner = nginx/g' /etc/php-fpm.d/www.conf

sed -i 's/;listen.group = nobody/listen.group = nginx/g' /etc/php-fpm.d/www.conf

sed -i 's/;rlimit_files = 1024/rlimit_files = 51200/g' /etc/php-fpm.d/www.conf

sed -i 's#^listen =.*#listen = /var/run/php-fpm.socket#g' /etc/php-fpm.d/www.conf

sed -i 's@^pm.start_servers.*@pm.start_servers = 10@' /etc/php-fpm.d/www.conf

sed -i 's@^pm.min_spare_servers.*@pm.min_spare_servers = 10@' /etc/php-fpm.d/www.conf

sed -i 's@^pm.max_spare_servers.*@pm.max_spare_servers = 30@' /etc/php-fpm.d/www.conf

sed -i 's@^pm.max_children.*@pm.max_children = 30@' /etc/php-fpm.d/www.conf
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=1/g' /etc/php.ini

sed -i 's/^post_max_size.*/post_max_size = 16M/g' /etc/php.ini

sed -i 's/^max_execution_time.*/max_execution_time = 300/g' /etc/php.ini

sed -i 's/^max_input_time.*/max_input_time = 300/g' /etc/php.ini

sed -i 's/^;date.timezone.*/date.timezone = PRC/g' /etc/php.ini

sed -i 's/^memory_limit.*/memory_limit = 512M/g' /etc/php.ini

chmod -R 777 /var/lib/php

重启PHP

centos 7

systemctl enable php-fpm.service

systemctl restart php-fpm.service

systemctl status php-fpm.service

设置Nginx

wget -O /etc/nginx/conf.d/zabbix.conf http://www.bigops.com/bigops-install/nginx/conf.d/zabbix.conf

vi /etc/nginx/conf.d/zabbix.conf

修改域名和zabbix目录为你自己的

重启Nginx

centos7

systemctl enable nginx.service

systemctl restart nginx.service

systemctl status nginx.service

安装定制版zabbix

tar zxvf bigops-zabbix-x.x.x.tar.gz

cd bigops-zabbix-x.x.x

groupadd -g 491 zabbix

useradd -u 491-g zabbix -c 'Zabbix monitoring' zabbix

chown root:zabbix /usr/sbin/fping

chmod 4710 /usr/sbin/fping

编译zabbix server

./configure --prefix=/usr --sysconfdir=/etc/zabbix --enable-server --with-net-snmp --with-libcurl --with-mysql --with-libxml2 --with-unixodbc --with-openipmi --enable-agent --with-ssh2 --enable-proxy --enable-java

make && make install

编译zabbix agent

./configure --prefix=/usr --sysconfdir=/etc/zabbix --enable-agent

make && make install

安装zabbix web

mkdir /opt/bigops/zabbix

cp -rf frontends/php/* /opt/bigops/zabbix/

chmod -R 755 /opt/bigops/zabbix

chmod -R 777 /opt/bigops/zabbix/conf

设置目录权限

mkdir -p /etc/zabbix/alertscripts /etc/zabbix/externalscripts

chmod -R 777 /etc/zabbix/alertscripts /etc/zabbix/externalscripts

mkdir /var/run/zabbix/ /var/log/zabbix/

chmod 777 /var/run/zabbix/ /var/log/zabbix/

创建zabbix数据库

mysql> create database zabbix character set utf8 collate utf8_bin;

Query OK, 1 row affected (0.01 sec)

导入zabbix表

cd database/mysql/

mysql -uroot -p -h127.0.0.1 zabbix <schema.sql

mysql -uroot -p -h127.0.0.1 zabbix <images.sql

mysql -uroot -p -h127.0.0.1 zabbix <data.sql

配置zabbix server和zabbix agent

vi /etc/zabbix/zabbix_server.conf

略,参考zabbix官方文档

vi /etc/zabbix/zabbix_agent.conf

略,参考zabbix官方文档

启动zabbix server

centos 7

wget -O /usr/lib/systemd/system/zabbix-server.service http://www.bigops.com/bigops-install/zabbix-server.service

systemctl daemon-reload

systemctl enable zabbix-server.service

systemctl restart zabbix-server.service

systemctl status zabbix-server.service

启动zabbix agent

centos 7

wget -O /usr/lib/systemd/system/zabbix-agent.service http://www.bigops.com/bigops-install/zabbix-agent.service

systemctl daemon-reload

systemctl enable zabbix-agent.service

systemctl restart zabbix-agent.service

systemctl status zabbix-agent.service

浏览器访问域名,开始安装

zabbix默认账号和密码

用户:admin

密码:zabbix

修改Zabbix的Admin用户的alias为全小写admin

use zabbix;

update users set alias='admin1' where userid='1';

update users set alias='admin' where userid='1';

说明:直接由Admin改为admin会报错,所以先修改为admin1,再修改为admin

设置域名和密码salt

点击:zabbix--设置--Zabbix API,然后根据图片提示设置

编辑zabbix文件

vi /opt/web/zabbix/conf/sso.conf.php

总后台接入系统

点击添加接入系统,注意域名替换为你自己的

系统名填写:zabbix

ServiceId填写:^http://zabbix.bigops.com.*

注销URL填写:http://zabbix.bigops.com/sso.php?logout=1

重启BigOps系统

/opt/bigops/bin/restart

BigOps主机和Zabbix主机进行绑定

自动绑定

如果bigops主机和zabbix主机IP一样,bigserver每隔一段时间会自动绑定。

手动绑定

自动同步数据

bigserver还会同步一些数据给zabbix,对应关系如下表:

bigops系统 zabbix系统
主机可见名 主机可见名
服务树 主机组(服务树其实也是一种分组)

测试效果

1、用户同时登录和登出zabbix和sso系统

2、通过bigops的视图功能可以看到zabbix监控图,点击zabbix/视图/服务树视图。

常见问题:

因为没有修改Admin用户为admin,修改Zabbix的Admin用户的alias为全小写admin

use zabbix;

update users set alias='admin1' where userid='1';

update users set alias='admin' where userid='1';

说明:直接由Admin改为admin会报错,所以先修改为admin1,再修改为admin

results matching ""

    No results matching ""