标签:zabbix 启动进程 zabbix-2.2.5 zabbix_server
Zabbix是完全开源的监控系统,同时整合了Cacti和Nagios,还提供了更多额外的功能如分布式监控、可以监控WEB页面的响应、代码、内容;适合大规模环境监控,支持10W以上设备;可布置分支机构代理服务器,减轻并发压力;
一、安装Zabbix
1、安装依赖软件包
[root@zabbix ~]# yum -y install curl curl-devel net-snmp net-snmp-devel perl-DBI gcc
2、下载zabbix
http://www.zabbix.com/download.php
[root@zabbix ~]# mkdir /home/zabbix [root@zabbix ~]# cd /home/zabbix [root@zabbix zabbix]# wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.5/zabbix-2.2.5.tar.gz
3、安装zabbix
[root@zabbix zabbix]# useradd zabbix -s /sbin/nologin [root@zabbix zabbix]# tar zvxf zabbix-2.2.5.tar.gz [root@zabbix zabbix]# cd zabbix-2.2.5 [root@zabbix zabbix-2.2.5]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --enable-proxy --with-mysql --with-net-snmp --with-libcurl [root@zabbix zabbix-2.2.5]# make install
4、创建数据库
[root@zabbix zabbix-2.2.5]# mysql -uroot -p123456 >create database zabbix character set utf8; >grant all on zabbix.* to zabbix@localhost identified by ‘zabbix‘; >flush privileges; >quit
5、导入数据
[root@zabbix zabbix-2.2.5]# vi database/mysql/schema.sql :%s/ENGINE=InnoDB/ENGINE=InnoDB CHARACTER SET utf8/g #用于解决中文显示问号问题 [root@zabbix zabbix-2.2.5]# mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/schema.sql [root@zabbix zabbix-2.2.5]# mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/images.sql [root@zabbix zabbix-2.2.5]# mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/data.sql
6、添加服务
[root@zabbix zabbix-2.2.5]# cat >>/etc/services <<EOF > zabbix-agent 10050/tcp Zabbix Agent > zabbix-agent 10050/udp Zabbix Agent > zabbix-trapper 10051/tcp Zabbix Trapper > zabbix-trapper 10051/udp Zabbix Trapper > EOF
二、配置文件
1、配置Zabbix
[root@zabbix zabbix-2.2.5]# vi /usr/local/zabbix/etc/zabbix_server.conf DBName=zabbix DBUser=zabbix DBPassword=zabbix
2、配置PHP
[root@zabbix zabbix-2.2.5]# vi /etc/php.ini max_input_time = 600 max_execution_time = 300 date.timezone = Asia/Shanghai post_max_size = 32M memory_limit = 128M mbstring.func_overload = 2 [root@zabbix zabbix-2.2.5]# service httpd restart
三、自动启动
1、修改参数
修改启动脚本中的路径/usr/local改成/usr/local/zabbix
[root@zabbix zabbix-2.2.5]# cp misc/init.d/fedora/core/* /etc/init.d/ [root@zabbix zabbix-2.2.5]# sed -i ‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g‘ /etc/init.d/zabbix_server [root@zabbix zabbix-2.2.5]# sed -i ‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g‘ /etc/init.d/zabbix_agentd
2、启动进程
[root@zabbix zabbix-2.2.5]# echo "/etc/init.d/zabbix_server start" >> /etc/rc.local [root@zabbix zabbix-2.2.5]# echo "/etc/init.d/zabbix_agentd start" >> /etc/rc.local [root@zabbix zabbix-2.2.5]# /etc/init.d/zabbix_server start [root@zabbix zabbix-2.2.5]# /etc/init.d/zabbix_agentd start
3、查看端口
[root@zabbix zabbix-2.2.5]# netstat -npl|grep 10050 tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 2404/zabbix_agentd [root@zabbix zabbix-2.2.5]# netstat -npl|grep 10051 tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 2380/zabbix_server
4、开放端口
[root@zabbix zabbix-2.2.5]# iptables -I INPUT -p tcp --dport 10050:10051 -j ACCEPT [root@zabbix zabbix-2.2.5]# iptables -I INPUT -p udp --dport 10050:10051 -j ACCEPT [root@zabbix zabbix-2.2.5]# service iptables save
本文出自 “月晴星飞” 博客,请务必保留此出处http://ywzhou.blog.51cto.com/2785388/1578555
标签:zabbix 启动进程 zabbix-2.2.5 zabbix_server
原文地址:http://ywzhou.blog.51cto.com/2785388/1578555