zabbix 服务端php
[root@localhost ~]# yum install -y epel-release ; yum install -y httpd mysql mysql-libs php php-mysql mysql-server php-bcmath php-gd php-mbstring ; yum install -y zabbix20 zabbix20-agent zabbix20-server zabbix20-server-mysql zabbix20-web zabbix20-web-mysql net-snmp-develmysql
[root@localhost ~]# vi /etc/my.cnflinux
[mysqld]web
datadir=/var/lib/mysqlsql
socket=/var/lib/mysql/mysql.socksocket
user=mysqlide
symbolic-links=0post
[mysqld_safe]this
log-error=/var/log/mysqld.logrest
pid-file=/var/run/mysqld/mysqld.pid
[mysql]
default-character-set = utf8
[mysqld]
character_set_server = utf8
[root@localhost ~]# /etc/init.d/zabbix-server restart; /etc/init.d/zabbix-agent restart ; /etc/init.d/httpd restart ; /etc/init.d/mysqld restart
[root@localhost ~]# mysql -uroot -p -e "create database zabbix"
[root@localhost ~]# mysql -uroot -p --default-character-set=utf8 zabbix < /usr/share/zabbix-mysql/schema.sql
[root@localhost ~]# mysql -uroot -p --default-character-set=utf8 zabbix < /usr/share/zabbix-mysql/p_w_picpaths.sql
[root@localhost ~]# mysql -uroot -p --default-character-set=utf8 zabbix < /usr/share/zabbix-mysql/data.sql
[root@localhost ~]# vi /etc/php.ini
date.timezone = 'Asia/Shanghai'
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
[root@localhost ~]# mysql -uroot -e "grant all on *.* to 'zabbix'@'localhost' identified by 'zabbix';"
[root@localhost ~]# vi /etc/zabbix/zabbix_server.conf
DBPassword=zabbix
[root@localhost ~]# /etc/init.d/zabbix-server restart ; /etc/init.d/httpd restart
web 访问 http://192.168.10.29/zabbix/
web 操做
Continue despite this warning >> Next >> Next >> Test connection >> Next >> Next >> Next >> Finish >> admin >> zabbix
调中文
Profile >> Language >> Chinese (zh_CN) >> Save
zabbix 客户端
[root@localhost ~]# yum install -y epel-release ; yum install -y zabbix20-agent
[root@localhost ~]# vi /etc/zabbix_agentd.conf
Server=192.168.10.29
ServerActive=0.0.0.0:10050
Hostname=host39
[root@localhost ~]# /etc/init.d/zabbix-agent restart
服务端操做,检测客户端主机名,若是能够正常检测到,证实通信正常
[root@localhost ~]# zabbix_get -s 192.168.10.39 -p10050 -k"system.hostname"
web 操做
配置-主机-建立主机
主机名称(自定义)
可见的名称(自定义)
组(linux servers)
IP地址(客户端IP)
存档
至此,zabbix搭建完毕