Zabbix监控平台
实验环境: server7:zabbix-server zabbix-agent
Server6:zabbix-agent
Zabbix所需环境:MySQL mysql-server php php-mysql httpd
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
1.配置数据库
/etc/init.d/mysqld start
进入Mysql数据库,授权zabbix:
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to [email protected] identified by ‘westos‘;
mysql> quit;
数据倒入数据库中(注意导入的先后顺序,顺序错乱可能导入失败):
cd /usr/share/doc/zabbix-server-mysql-2.4.5/create
mysql -uzabbix -pwestos zabbix < schema.sql
mysql -uzabbix -pwestos zabbix < images.sql
mysql -uzabbix -pwestos zabbix < data.sql
2.配置zabbix-server
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=westos
3.配置php
vim /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
Vim /etc/php.ini
date.timezone = Asia/Shanghai
4.启动服务并访问
/etc/init.d/zabbix-server start
/etc/init.d/zabbix-agent start
/etc/init.d/httpd start
访问http://172.25.60.7/zabbix
根据提示安装并登陆,首次登陆帐号密码为:Username: Admin Password: zabbix
(如需更改密码,点击右上角profile--->user---->change password)
5.添加本地监控
Configuration---->Discovery---->点击local network
6.添加agent自动注册功能
Create action
Add host:自动注册主机添加到 hosts 列表
Add to host groups:自动注册主机加入 linux servers 组(组名可以自定义)
Link to templates:自动注册主机应用模板 Template OS linux
7.添加agent主机
Server6:zabbix-2.4.5-1.el6.x86_64.rpm
zabbix-agent-2.4.5-1.el6.x86_64.rpm
vim /etc/zabbix/zabbix_agentd.conf
Server=172.25.60.7
Server Active=172.25.60.7
/etc/init.d/zabbix-agent start
点击 Configuration -> Hosts 可以看到新加的主机: