zabbix 服务端

[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-devel

[root@localhost ~]# vi /etc/my.cnf

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

symbolic-links=0

[mysqld_safe]

log-error=/var/log/mysqld.log

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搭建完毕