Zabbix 分布式监控平台
Zabbix 需要 lamp 环境:
shell> yum install -y httpd php php-mysql mysql-server:
1. 安装 zabbix 所需软件包
zabbix-2.4.5-1.el6.x86_64.rpm
zabbix-server-2.4.5-1.el6.x86_64.rpm
zabbix-server-mysql-2.4.5-1.el6.x86_64.rpm
zabbix-web-2.4.5-1.el6.noarch.rpm
zabbix-web-mysql-2.4.5-1.el6.noarch.rpm
zabbix-agent-2.4.5-1.el6.x86_64.rpm
fping-2.4b2-16.el6.x86_64.rpm
iksemel-1.4-2.el6.x86_64.rpm
iksemel-utils-1.4-2.el6.x86_64.rpm
php-mbstring-5.3.3-26.el6.x86_64.rpm
php-bcmath-5.3.3-26.el6.x86_64.rpm
2 配置 mysql 数据库
shell> /etc/init.d/mysqld status
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> gi
shell> cd /usr/share/doc/zabbix-server-mysql-2.4.5/create
mysql -uzabbix -predhat zabbix < schema.sql
#################################################Stop here if you are creating database for Zabbix proxy
#################################################
mysql -uzabbix -predhat zabbix < images.sql
mysql -uzabbix -predhat zabbix < data.sql
3. 配置 zabbix server
shell> vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=redhat
4. 配置 php
shell> vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
shell> yum install -y zabbix-agent-2.4.5-1.el6.x86_64.rpm
shell> vim /etc/zabbix/zabbix_agentd.conf
Hostname=server8.example.com
If you saw zabbix server is busy,
shell>vim /etc/zabbix/zabbix_server.conf
StartPollers=10
5. 启动 zabbix server、zabbix agent、httpd
/etc/init.d/httpd start
/etc/init.d/zabbix-server start
/etc/init.d/zabbix-agent start
6. 登陆 zabbix web
http://172.25.193.8/zabbix 按照提示完成安装并登陆:
Username: Admin
Password: zabbix
7. 添加 agent 主机
7.1在被监控端安装软件包:
zabbix-2.4.5-1.el6.x86_64.rpm
zabbix-agent-2.4.5-1.el6.x86_64.rpm
7.2配置 zabbix agent
shell> vim /etc/zabbix/zabbix_agentd.conf
Server=172.25.193.8
ServerActive=172.25.193.8
Hostname=server9.example.com #主机名需要有解析
Shell> /etc/init.d/zabbix-agent start
8. 在 zabbix server 上激活 zabbix agent 自动注册功能
点击 Configuration -> Actions -> Create action 按下图所示设置:
自定义 Action 的名字。
Conditions 选项卡保持默认即可。
Operations 选项卡添加如下:
Add host:自动注册主机添加到 hosts 列表
Add to host groups:自动注册主机加入 linux servers 组(组名可以自定义)
Link to templates:自动注册主机应用模板 Template OS linux
by Yedda