安装环境的准备
4 系统环境 [iyunv@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.0.1406 (Core)
[iyunv@localhost ~]# uname -r
3.10.0-123.el7.x86_64
5 关闭防火墙与selinux [iyunv@localhost bin]# systemctl status iptables
iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled)
Active: inactive (dead) since Fri 2015-07-17 10:58:54 EDT; 16s ago
[iyunv@localhost bin]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled)
Active: inactive (dead)
[iyunv@localhost bin]# getenforce
Permissive
6 程序运行环境 源码包准备:
源码安装mysql:
[iyunv@localhost bin]# ./mysql --version
./mysql Ver 14.14 Distrib 5.6.16, for Linux (x86_64) using EditLine wrapper
yum安装http php:
[iyunv@localhost bin]# apachectl -v
Server version: Apache/2.4.6 (CentOS)
Server built: Mar 12 2015 15:07:19
[iyunv@localhost bin]# php -v
PHP 5.4.16 (cli) (built: Jun 23 2015 21:17:27)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
http php mysql相关组件安装方法(安装php之前需要安装epel,参考phpMyAdmin安装文档):
[iyunv@localhost bin]# yum install gcc gcc-c++ curl-devel autoconf httpd httpd-manual mod_ssl mod_perl mod_auth_mysql
[iyunv@localhost bin]# yum install php php-mysqlnd(php-mysql) php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath
[iyunv@localhost bin]# yum install mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel
7 相关环境的配置 php环境
[iyunv@localhost bin]# vi /etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
post_max_size = 32M
max_input_time = 300
memory_limit = 128M
mbstring.func_overload = 2
8 http mysql开启 [iyunv@localhost bin]# systemctl start httpd
[iyunv@localhost bin]# systemctl enable httpd
[iyunv@localhost bin]# /etc/init.d/mysql start
[iyunv@localhost bin]# chkconfig mysql on
Zabbix源码安装与配置 9 安装 [iyunv@localhost zabbix-2.0.3]# tar zxvf /root/7.17/zabbix-2.0.3.tar.gz
[iyunv@localhost zabbix-2.0.3]# cd zabbix-2.0.3/
[iyunv@localhost local]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl
[iyunv@localhost local]# make
[iyunv@localhost local]# make install
10 添加zabbix到系统服务文件 [iyunv@localhost local]# vi /etc/services
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-agent 10050/udp # Zabbix Agent
zabbix-trapper 10051/tcp # Zabbix Trapper
zabbix-trapper 10051/udp # Zabbix Trapper
11 导入zabbix数据库 [iyunv@localhost local]# /usr/local/mysql/bin/mysql -uroot -p
Enter password:
mysql> create database zabbix character set utf8;
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.02 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[iyunv@localhost zabbix]# cd /usr/local/zabbix-2.0.3/
[iyunv@localhost zabbix-2.0.3]# /usr/local/mysql/bin/mysql -uzabbix -pzabbix zabbix < ./database/mysql/schema.sql
Warning: Using a password on the command line interface can be insecure.
[iyunv@localhost zabbix-2.0.3]# /usr/local/mysql/bin/mysql -uzabbix -pzabbix zabbix < ./database/mysql/images.sql
Warning: Using a password on the command line interface can be insecure.
[iyunv@localhost zabbix-2.0.3]# /usr/local/mysql/bin/mysql -uzabbix -pzabbix zabbix < ./database/mysql/data.sql
Warning: Using a password on the command line interface can be insecure.
12 创建zabbix配置文件与执行文件软链接 [iyunv@localhost zabbix-2.0.3]# ln -s /usr/local/zabbix/etc /etc/zabbix
[iyunv@localhost zabbix-2.0.3]# mkdir /var/log/zabbix
[iyunv@localhost zabbix-2.0.3]# chown zabbix.zabbix /var/log/zabbix/
[iyunv@localhost zabbix-2.0.3]# ln -s /usr/local/zabbix/bin/* /usr/bin/
[iyunv@localhost zabbix-2.0.3]# ln -s /usr/local/zabbix/sbin/* /usr/sbin/
[iyunv@localhost zabbix-2.0.3]# vi /etc/init.d/zabbix_server
BASEDIR=/usr/local/zabbix
[iyunv@localhost zabbix-2.0.3]# vi /etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix
13 修改zabbix_server.conf文件 [iyunv@localhost zabbix-2.0.3]# vi /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
14 配置被监测主机文件(由于zabbix-server也属于被监控范围,故修改此文件) [iyunv@localhost zabbix-2.0.3]# vi /etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1 #被动模式连接的zabbix-server
ServerActive=127.0.0.1:20051 #主动模式连接的zabbix-server及端口号
LogFile=/tmp/zabbix_agentd.log
UnsafeUserParameters=1 #启用自定义脚本功能,自定义key时需开启,加上自定义配置文件时,在该变量后追加:
Include=/etc/zabbix/filename.conf
15 复制页面文件 [iyunv@localhost zabbix-2.0.3]# cp -r frontends/php/ /var/www/html/zabbix
[iyunv@localhost zabbix-2.0.3]# chown -R apache.apache /var/www/html/zabbix
16 开启服务 [iyunv@localhost zabbix-2.0.3]# chkconfig zabbix_server on
[iyunv@localhost zabbix-2.0.3]# chkconfig zabbix_agentd on
[iyunv@localhost zabbix-2.0.3]# /etc/init.d/zabbix_server start
Starting zabbix_server (via systemctl): [ OK ]
[iyunv@localhost zabbix-2.0.3]# /etc/init.d/zabbix_agentd start
Starting zabbix_agentd (via systemctl): [ OK ]
web界面下配置zabbix 17 登陆 在浏览器地址栏输入IP/zabbix
18 账号登陆 账号:admin 密码:zabbix
至此zabbix安装完成,详细配置与优化将于近期制作,敬请关注!谢谢!
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com