1、安装zabbix 官方的软件配置仓库包
rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-release-2.0-1.el6.noarch.rpm
2、安装zabbix server mysql php 等
yum install zabbix-server-mysql zabbix-web-mysql
结果如下(根据机型系统不同显示或有不同):
Installed:
libjpeg-turbo.x86_64 0:1.2.1-1.el6 zabbix-server-mysql.x86_64 0:2.0.9-1.el6 zabbix-web-mysql.noarch 0:2.0.9-1.el6
Dependency Installed:
OpenIPMI-libs.x86_64 0:2.0.16-14.el6 fping.x86_64 0:2.4b2-16.el6iksemel.x86_64 0:1.4-2.el6
libXpm.x86_64 0:3.5.10-2.el6 lm_sensors-libs.x86_64 0:3.1.1-17.el6 net-snmp.x86_64 1:5.5-44.el6_4.4
net-snmp-libs.x86_64 1:5.5-44.el6_4.4 php.x86_64 0:5.3.3-23.el6_4php-bcmath.x86_64 0:5.3.3-23.el6_4
php-cli.x86_64 0:5.3.3-23.el6_4php-common.x86_64 0:5.3.3-23.el6_4 php-gd.x86_64 0:5.3.3-23.el6_4
php-mbstring.x86_64 0:5.3.3-23.el6_4 php-mysql.x86_64 0:5.3.3-23.el6_4 php-pdo.x86_64 0:5.3.3-23.el6_4
php-xml.x86_64 0:5.3.3-23.el6_4unixODBC.x86_64 0:2.2.14-12.el6_3 zabbix.x86_64 0:2.0.9-1.el6
zabbix-server.x86_64 0:2.0.9-1.el6 zabbix-web.noarch 0:2.0.9-1.el6
Replaced:
libjpeg.x86_64 0:6b-46.el6
3、安装agent
yum install zabbix-agent -y
结果如下:
Installed:
zabbix-agent.x86_64 0:2.0.9-1.el6
Complete!
4、创建zabbix 数据库(mysql)
4、1 安装mysql等(如果已安装请略过)
yum -y install mysql-server mysql mysql-dev
结果:
Installed:
mysql-server.x86_64 0:5.1.69-1.el6_4
Dependency Installed:
perl-DBD-MySQL.x86_64 0:4.013-3.el6
Updated:
mysql.x86_64 0:5.1.69-1.el6_4
Dependency Updated:
mysql-devel.x86_64 0:5.1.69-1.el6_4 mysql-libs.x86_64 0:5.1.69-1.el6_4
Complete!
4、2 启动mysql
service mysqld start
首次启动显示:
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h h210 password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
Starting mysqld: [ OK ]
4、3 创建库和导入
创建
mysql -uroot
mysql>create database zabbix character set utf8
mysql>grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'
mysql>exit
导入模式和数据
cd /usr/share/doc/zabbix-server-mysql-2.0.9/create
mysql -uroot zabbix <schema.sql
mysql -uroot zabbix <images.sql
mysql -uroot zabbix <data.sql
5、启动zabbix-server 进程
编辑配置文件zabbix_server.conf
vi /etc/zabbix/zabbix_server.conf
保证下列配置,保存退出
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
启动
service zabbix-server start
6、配置zabbix web前端
6、1 配置php
vi /etc/httpd/conf.d/zabbix.conf
保证如下设置
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
6、2 启动apache
service httpd start
6、3 登录zabbix web前端
浏览器输入 http://serverip/zabbix进入最后的检查和配置
配置完成登录系统默认admin/zabbix
7、启动zabbix server上的zabbix_agentd
zabbix_agentd
默认Zabbix配置文件会自动生成到/etc下面的,如果没有,就有可能默认安装到其他目录了,如/opt下面。具体参考配置教程
1、zabbix server端的配置在进行源码安装zabbix时已经配置好了,具体要配置的参数如下:
ListenPort=10051
server服务的监听端口,默认是10051
DBHost=localhost 数据库IP地址
DBName=zabbix 数据库名称
DBUser=zabbix 数据库用户名
DBPassword=zabbix 数据库密码
DBPort=3306 数据库端口,默认是3306
ListenIP=127.0.0.1,192.168.10.10
zabbix server ip地址复制代码
vim /etc/zabbix/zabbix_server.conf
ListenPort=10051DBHost=localhost 数据库ip地址
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBPort=3306
ListenIP=127.0.0.1,192.168.10.10
zabbix server ip地址复制代码刚刚开始需要关注的是这些,后面再补充。
还有个:zabbix运行脚本存放路径,这个也在/etc/zabbix/zabbix_server.conf
配置文件里配置,默认地址是:AlertScriptsPath=${datadir}/zabbix/alertscripts
zabbix_agent 客户端配置,服务端在源码安装时已经进行了,批量部署的话不建议客户端使用源码安装,推荐使用rpm包安装,可以使用zabbix官方提供的rpm路径:
repo.zabbix.com/zabbix/3.0/修改Agent配置文件 zabbix agent的配置很简单,只需要修改zabbix agent配置文件中的Server、ServerActive和Hostname这三项即可。
其中Server、ServerActive是zabbix server服务器的IP地址,Hostname是被监控端的IP地址,如下:复制代码#
sed -i "s/Server\=127.0.0.1/Server\=127.0.0.1,192.168.30.130/g" /etc/zabbix/zabbix_agentd.conf
# sed -i "s/ServerActive\=127.0.0.1/ServerActive\=192.168.30.130:10051/g" /etc/zabbix/zabbix_agentd.conf
# sed -i "s#tmp/zabbix_agentd.log#var/log/zabbix/zabbix_agentd.log#g" /etc/zabbix/zabbix_agentd.conf
# sed -i "#UnsafeUserParameters=0#aUnsafeUserParameters=1\n" /etc/zabbix/zabbix_agentd.conf
复制代码拷贝 Agent 启动脚本复制代码
# mkdir /var/log/zabbix
# chown zabbix.zabbix /var/log/zabbix # cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
# chmod 755/etc/init.d/zabbix_agentd # sed -i "s#BASEDIR=/usr/local
#BASEDIR=/usr/#g" /etc/init.d/zabbix_agentd
复制代码设置Agent开机启动
# chkconfig zabbix_agentd on
# servicezabbix_agentdstart在Server端使用以下命令测试是否能连接到Agent端:[root@localhost ~]# /usr/local/zabbix/bin/zabbix_get -s 192.168.217.139 -p 10050 -k "system.uptime"17340
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)