centos6.6安装zabbix2.4.5实战

# yum -y install mariadb mariadb-server
# systemctl start mariadb
# systemctl enable mariadb
# mysql_secure_installation

centos6.6安装zabbix2.4.5实战

  1. 安装前环境准备

系统环境:

[[email protected]~]#uname-r2.6.32-504.el6.x86_64[[email protected]~]#uname-mx86_64[[email protected]~]#cat/etc/redhat-releaseCentOSrelease6.6(Final)

IP地址及主机名规划:

主机名

IP地址

角色

zbserver

192.168.0.131

zabbix服务端

zbclient

192.168.0.132

zabbix客户端

1.1 server端安装基础软件包

在server安装基础软件包,这里的环境使用yum安装,如果使用源码安装也是可以的。

[[email protected]~]``#yum-yinstallwgetvimtreegccgcc-c++autoconfhttpdphpmysqlmysql-serverphp-mysqlhttpd-manualmod_sslmod_perlmod_auth_mysqlphp-gdphp-xmlphp-mbstringphp-ldapphp-pearphp-xmlrpcphp-bcmathmysql-connector-odbcmysql-devellibdbi-dbd-mysqlnet-snmpnet-snmp-develcurl-devel

1.2 启动httpd及mysql服务

[[email protected]~]``#/etc/init.d/httpdstart``[[email protected]~]``#/etc/init.d/mysqldstart``[[email protected]~]``#chkconfighttpdon``[[email protected]~]``#chkconfigmysqldon

1.3 配置防火墙

#允许80端口及zabbix的10050,10051端口

iptables-IINPUT-ptcp-mmultiport--destination-port80,10050:10051

1.4 配置PHP参数

[[email protected]~]``#cp/etc/php.ini/etc/php.ini.bak_20160226``[[email protected]~]``#sed-i"[email protected];[email protected]=Asia/[email protected]"/etc/php.ini``[[email protected]~]``#sed-i"[email protected][email protected][email protected]"/etc/php.ini``[[email protected]~]``#sed-i"[email protected][email protected][email protected]"/etc/php.ini``[[email protected]~]``#sed-i"[email protected][email protected][email protected]"/etc/php.ini``[[email protected]~]``#sed-i"[email protected][email protected][email protected]"/etc/php.ini``[[email protected]~]``#sed-i"[email protected];[email protected][email protected]"/etc/php.ini

1.5 修改httpd服务FQDN错误

[[email protected]~]``#echo"ServerNamelocalhost:80">>/etc/httpd/conf/httpd.conf``[[email protected]~]``#/etc/init.d/httpdrestart

1.6 下载zabbix2.4.5.tar.gz

wgethttp:``//jaist``.dl.sourceforge.net``/project/zabbix/ZABBIX``%20Latest%20Stable``/2``.4.5``/zabbix-2``.4.5.``tar``.gz

1.7 创建zabbix用户及zabbix用户组

[[email protected]~]``#groupadd-g201zabbix``[[email protected]~]``#useradd-gzabbix-u201-s/sbin/nologinzabbix

1.8 安装zabbix server端

[[email protected]~]``#tarxfzabbix-2.4.5.tar.gz``[[email protected]~]``#cdzabbix-2.4.5``[[email protected]]``#./configure--prefix=/usr/local/zabbix--enable-server--enable-proxy--enable-agent--with-mysql=/usr/bin/mysql_config--with-net-snmp--with-libcurl``[[email protected]]``#make&&makeinstall

1.9 创建zabbix数据库及相关表

[[email protected]]``#mysql-e"createdatabasezabbixdefaultcharsetutf8;"``[[email protected]]``#mysql-e"grantallonzabbix.*[email protected]'zabbix';"``[[email protected]]``#mysql-uzabbix-pzabbixzabbix<./database/mysql/schema.sql``[[email protected]]``#mysql-uzabbix-pzabbixzabbix<./database/mysql/images.sql``[[email protected]]``#mysql-uzabbix-pzabbixzabbix<./database/mysql/data.sql

  1. 配置软链接及启动文件信息

[[email protected]]``#mkdir/var/log/zabbix``[[email protected]]``#chownzabbix.zabbix/var/log/zabbix``[[email protected]]``#ln-s/usr/local/zabbix/etc//etc/zabbix``[[email protected]]``#ln-s/usr/local/zabbix/bin/*/usr/bin/``[[email protected]]``#ln-s/usr/local/zabbix/sbin/*/usr/sbin/``[[email protected]]``#cp/root/zabbix-2.4.5/misc/init.d/fedora/core/zabbix_*/etc/init.d``[[email protected]]``#chmod755/etc/init.d/zabbix_*

2.1 修改/etc/init.d下zabbix_seraver及zabbix_agentd启动文件

[[email protected]]``#sed-i"[email protected]=/usr/[email protected]=/usr/local/[email protected]"/etc/init.d/zabbix_server``[[email protected]]``#sed-i"[email protected]=/usr/[email protected]=/usr/local/[email protected]"/etc/init.d/zabbix_agentd

2.2修改/etc/zabbix/zabbix_server.conf

#修改mysql数据库种zabbix库的账号及密码信息

sed``-i``"[email protected][email protected][email protected]"``/etc/zabbix/zabbix_server``.conf``sed``-i``"[email protected]#[email protected][email protected]"``/etc/zabbix/zabbix_server``.conf``sed``-i``"[email protected]#[email protected][email protected]"``/etc/zabbix/zabbix_server``.conf

2.3 修改/etc/zabbix/zabbix_agentd.conf

#这里的IP地址写的是zabbix_server的IP地址,即192.168.0.131

sed``-i``"[email protected][email protected]=127.0.0.1,[email protected]"``/etc/zabbix/zabbix_agentd``.conf``sed``-i``"[email protected][email protected]=192.168.0.131:[email protected]"``/etc/zabbix/zabbix_agentd``.conf``sed``-i``"[email protected]/[email protected]/log/zabbix/[email protected]"``/etc/zabbix/zabbix_agentd``.conf``sed``-i``"[email protected]^#Unsafe[email protected]=1\[email protected]"``/etc/zabbix/zabbix_agentd``.conf

2.4 复制zabbix站点文件到/var/www/html/

[[email protected]]``#cp-r/root/zabbix-2.4.5/frontends/php//var/www/html/zabbix/``[[email protected]]``#chown-Rapache.apache/var/www/html/zabbix/``[[email protected]]``#chkconfigzabbix_serveron``[[email protected]]``#chkconfigzabbix_agentdon``[[email protected]]``#/etc/init.d/zabbix_serverstart``Startingzabbix_server:[OK]``[[email protected]]``#/etc/init.d/zabbix_agentdstart``Startingzabbix_agentd:[OK]

2.5 通过web界面配置zabbix

1.安装界面:在浏览器输入:192.168.0.131/zabbix/setup.php

图片 1

2.
PHP配置检查界面,结果是OK表示正常,如果是fail状态,请修改相关的php配置参数,并重启httpd服务

图片 2

3.填写数据库相关信息端口及zabbix授权用户及密码

图片 3

4.填写zabbix的server地址,我这里填写的是本机的IP地址192.168.0.131

图片 4

5.最后配置结果预览

图片 5

6.安装完成

图片 6

2.6访问zabbix web管理界面

#安装完成后通过http://192.168.0.131/zabbix/index.php就能直接访问zabbix管理界面

默认用户名:admin密码:zabbix

图片 7

2.7 调整zabbix语言

图片 8

2.8 zabbix语言设置后乱码解决方法

zabbix语言设置成中文后,有乱码解决如下

1.从windows下控制面板->字体->选择一种中文字库例如“楷体”

2.将字体上传至/var/www/html/zabbix/fonts目录下

3.修改zabbix页面管理的中文字体设置

[[email protected]]``#vim/var/www/html/zabbix/include/defines.inc.php``#修改如下2行``define(``'ZBX_FONT_NAME'``,``'simkai'``);``define(``'ZBX_GRAPH_FONT_NAME'``,``'simkai'``);

2.9 安装zabbix client端

#安装基础软件包

[[email protected]~]``#yuminstallwgetvimtreegccgcc-c++-y

  1. 安装zabbix_agentd

[[email protected]~]``#groupadd-g201zabbix``[[email protected]~]``#useradd-gzabbix-u201-s/sbin/nologinzabbix``[[email protected]~]``#tarxfzabbix-2.4.5.tar.gz``[[email protected]~]``#cdzabbix-2.4.5``[[email protected]]``#./configure--prefix=/usr/local/zabbix--enable-agent``[[email protected]]``#make&&makeinstall

3.1 创建zabbix日志目录

[[email protected]]``#mkdir/var/log/zabbix``[[email protected]]``#chownzabbix.zabbix/var/log/zabbix

3.2复制zabbix_agentd启动文件到/etc/init.d目录下

[[email protected]]``#cpmisc/init.d/fedora/core/zabbix_agentd/etc/init.d/``[[email protected]]``#chmod755/etc/init.d/zabbix_agentd

3.3 修改启动配置文件和软链接

[[email protected]]``#sed-i"[email protected]=/usr/[email protected]=/usr/local/[email protected]"/etc/init.d/zabbix_agentd``[[email protected]]``#ln-s/usr/local/zabbix/etc//etc/zabbix``[[email protected]]``#ln-s/usr/local/zabbix/bin/*/usr/bin``[[email protected]]``#ln-s/usr/local/zabbix/sbin/*/usr/sbin/

3.4 修改/etc/zabbix/zabbix_agentd.conf

#这里的IP地址写的是zabbix_server端的IP地址

[[email protected]]``#sed-i"[email protected][email protected][email protected]"/etc/zabbix/zabbix_agentd.conf``[[email protected]]``#sed-i"[email protected][email protected]=192.168.0.131:[email protected]"/etc/zabbix/zabbix_agentd.conf``[[email protected]]``#sed-i"[email protected]/[email protected]/log/zabbix/[email protected]"/etc/zabbix/zabbix_agentd.conf``[[email protected]]``#sed-i"[email protected]^#[email protected]=1\[email protected]"/etc/zabbix/zabbix_agentd.conf

3.5设置zabbix_agentd开机自动启动,并启动zabbix_agentd服务

[[email protected]]``#chkconfigzabbix_agentdon``[[email protected]]``#/etc/init.d/zabbix_agentdstart``Startingzabbix_agentd:[OK]

3.6 安装小结

#安装前请配置好时间同步、关闭selinux、防火墙、配置好yum源等

http://www.bkjia.com/Linux/1112326.htmlwww.bkjia.comtruehttp://www.bkjia.com/Linux/1112326.htmlTechArticlecentos6.6安装zabbix2.4.5实战 1. 安装前环境准备
系统环境:
[[email protected]~]#uname-r2.6.32-504.el6.x86_64[[email protected]~]#uname-mx86_64[[email protected]~]#cat/etc/redhat…

# yum -y install php php-mysql

3、安装LAMP

# yum -y install httpd
# systemctl start httpd
# systemctl enable httpd
# cd /etc/yum.repos.d
# yum -y install wget
# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
# yum clean all 
# yum makecache

2、安装yum源

4、安装zabbix

 

3.1、安装MySQL

1、关闭iptables和selinux

http://IP/zabbix
http://IP/zabbix/setup.php
# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
# yum -y install zabbix-server-mysql zabbix-web-mysql
# yum -y install zabbix-agent
# mysql -uroot -p
mysql>create database zabbix character set utf8 collate utf8_bin;
mysql>grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
# cd /usr/share/doc/zabbix-server-mysql-3.2.1
# zcat create.sql.gz | mysql -uroot -p zabbix

6、登陆zabbix,账号Admin,密码zabbix

# vim /etc/php.ini
        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 date.timezone Asia/Shanghai    
# systemctl restart httpd

5、修改配置文件

3.3、安装PHP

3.2、安装apache

# systemctl stop firewalld
# systemctl disable firewalld
# setenforce 0