最近一直忙云计算方面工作,也涉及我不太熟悉的领域,数据中心监控软件zabbix。下面我就把我最近涉及到的zabbix技术方面做一个记录
Zabbix-server服务器端的部署:
- 系统centos 6.4_64安装,安装desktop、开发包,硬盘容量用lvm 防火墙关闭
- 安装zabbix官方源与epel源
rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-2.2.2-1.e16.x86_64.rpm
rpm –ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
- 安装zabbix-server
Yum install –y zabbix zabbix-get zabbix-server zabbix-web-mysql zabbix-web zabbixe-agent
- 安装mysql数据库服务
Yum –y install mysql-server
Vi /etc/my.cnf
Chkconfig mysqld on service mysqld start
- 创建数据库
[[email protected] ~]# mysqladmin -uroot password tianyun
[[email protected] ~]# mysql -uroot -ptianyun
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;
mysql> flush privileges;
mysql> \q
导入zabbix表结构:
[[email protected] ~]# mysql -uzabbix -pzabbix zabbix < /usr/share/doc/zabbix-server-mysql-2.2.1/create/schema.sql
[[email protected] ~]# mysql -uzabbix -pzabbix zabbix < /usr/share/doc/zabbix-server-mysql-2.2.1/create/images.sql
[[email protected] ~]# mysql -uzabbix -pzabbix zabbix < /usr/share/doc/zabbix-server-mysql-2.2.1/create/data.sql
[[email protected] ~]# mysql -uzabbix -pzabbix zabbix -e ‘show tables‘
- .配置zabbix连接数据库:
[[email protected] ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.sock
[[email protected] ~]# service zabbix-server start
Starting Zabbix server: [ OK ]
[[email protected] ~]# chkconfig zabbix-server on
[[email protected] ~]# 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
[[email protected] ~]# service httpd restart
[[email protected] ~]# chkconfig httpd on
- 配置web界面
打开浏览器:http://IP地址/zabbix
点击下一步下一步,配置成功