zabbix 監控

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章