Zabbix3.0.12部署
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Zabbix3.0.12部署相关的知识,希望对你有一定的参考价值。
一,关闭selinux和iptables[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# setenforce 0
setenforce: SELinux is disabled
二,安装Zabbix rpm包仓库
[[email protected] ~]# rpm -vhi http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
三,安装zabbix-server-mysql和zabbix-web-mysql
[[email protected] ~]# yum install -y zabbix-server-mysql zabbix-web-mysql
四,安装并且启动mysql5.6及初始化数据库信息
复制代码
[[email protected] ~]# rpm -ivh http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
[[email protected] ~]# yum install -y mysql-community-server
[[email protected] ~]# systemctl start mysqld
[[email protected] ~]# /sbin/chkconfig mysqld on #开机启动
[[email protected] ~]# mysql_secure_installation #初始化数据库信息
...
复制代码
五,创建zabbix数据库,创建zabbix账号
复制代码
[[email protected] ~]# mysql -uroot -p
...
mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
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.01 sec)
复制代码
六,导入默认的zabbix数据库信息
[[email protected] zabbix-server-mysql-3.0.12]# zcat /usr/share/doc/zabbix-server-mysql-3.0.12/create.sql.gz | mysql zabbix -uzabbix -pzabbix
七,修改zabbix_server.conf的配置文件
[[email protected] ~]# grep ^DB /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
八,修改配置文件/etc/httpd/conf.d/zabbix.conf,时区改成 Asia/Shanghai
复制代码
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone Asia/Shanghai
复制代码
九,启动apache/zabbix-server服务并设置为开机启动
复制代码
[[email protected] ~]# systemctl start httpd
[[email protected] ~]# systemctl enable httpd
[[email protected] ~]# netstat -an |grep 80
tcp 0 0 192.168.56.11:80 0.0.0.0:* LISTEN
[[email protected] ~]# systemctl start zabbix-server
[[email protected] ~]# systemctl enable zabbix-server
复制代码
查看zabbix-server日志
View Code
zabbix-server的web目录
View Code
十,访问网站,例如:http://本机IP/zabbix,如下图所示:
十一,选择下一步,Check of pre-requisites,如图所示:
十二,选择下一步,配置zabbix server detail,如下图所示:
十三,选择下一步,配置zabbix server detail,如下图所示:
十四:点击下一步,便完成安装,安装完成的界面如下图所示:
十五,安装完成,如下图所示:
根据提示可以看到上面图形界面的操作都写到一个配置文件中
复制代码
[[email protected] zabbix]# more /etc/zabbix/web/zabbix.conf.php
<?php
// Zabbix GUI configuration file.
global $DB;
$DB[‘TYPE‘] = ‘MYSQL‘;
$DB[‘SERVER‘] = ‘localhost‘;
$DB[‘PORT‘] = ‘0‘;
$DB[‘DATABASE‘] = ‘zabbix‘;
$DB[‘USER‘] = ‘zabbix‘;
$DB[‘PASSWORD‘] = ‘123456‘;
// Schema name. Used for IBM DB2 and PostgreSQL.
$DB[‘SCHEMA‘] = ‘‘;
$ZBX_SERVER = ‘localhost‘;
$ZBX_SERVER_PORT = ‘10051‘;
$ZBX_SERVER_NAME = ‘zabbix 3.0.12‘;
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
复制代码
十六:Zabbix·server的默认账号Admin 密码zabbix,如图所示:
十七,默认登陆首页,如下图所示:
十八,移除或改名web目录下面的setup.php文件
[[email protected] zabbix]# pwd
/usr/share/zabbix
[[email protected] zabbix]# mv setup.php setup.php.bak
十九,更改web登陆的Admin默认密码
二十,设置新的密码,这里也可以设置界面的主题、语言和登陆后显示的默认界面等
以上是关于Zabbix3.0.12部署的主要内容,如果未能解决你的问题,请参考以下文章