zabbix server安裝詳解


簡介

zabbix(音同 zæbix)是一個基於WEB界面的提供分布式系統監視以及網絡監視功能的企業級的開源解決方案。
zabbix能監視各種網絡參數,保證服務器系統的安全運營;並提供靈活的通知機制以讓系統管理員快速定位/解決存在的各種問題。

zabbix由2部分構成,zabbix server與可選組件zabbix agent。
zabbix server可以通過SNMP,zabbix agent,ping,端口監視等方法提供對遠程服務器/網絡狀態的監視,數據收集等功能,它可以運行在Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X等平台上。


安裝

Installing repository configuration package

Zabbix 2.2 for RHEL5, Oracle Linux 5, CentOS 5:

rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/5/x86_64/zabbix-release-2.2-1.el5.noarch.rpm

Zabbix 2.2 for RHEL6, Oracle Linux 6, CentOS 6:

rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm

Zabbix 2.2 for RHEL7, Oracle Linux 7, CentOS 7:

rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/7/x86_64/zabbix-release-2.2-1.el7.noarch.rpm

Installing Zabbix packages

Install Zabbix packages. Example for Zabbix server and web frontend with mysql database.

yum install zabbix-server-mysql zabbix-web-mysql

Example for installing Zabbix agent only.

yum install zabbix-agent

zabbix-agent需要安裝在被監控的機器上,詳見另一篇文檔《zabbix agent安裝詳解》

Creating initial database

Create zabbix database and user on MySQL.

# mysql -uroot
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> exit

Import initial schema and data.

cd /usr/share/doc/zabbix-server-mysql-2.2.0/create
mysql -uroot zabbix < schema.sql
mysql -uroot zabbix < images.sql
mysql -uroot zabbix < data.sql

Starting Zabbix server process

Edit database configuration in zabbix_server.conf

# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

Start Zabbix server process.

service zabbix-server start

Editing PHP configuration for Zabbix frontend

Apache configuration file for Zabbix frontend is located in /etc/httpd/conf.d/zabbix.conf. Some PHP settings are already configured.

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 Europe/Riga

It's necessary to uncomment the “date.timezone” setting and set the right timezone for you. After changing the configuration file restart the apache web server.

如上所述,此處時區配置項需要修改,可改為 php_value date.timezone Asia/Shanghai

service httpd restart

Zabbix frontend is available at http://zabbix-frontend-hostname/zabbix in the browser.
Default username/password is Admin/zabbix.

# 設置自啟動
chkconfig httpd on
chkconfig --list|grep httpd


中文設置及中文亂碼

中文設置

【登陸】->【profile】->【User】,language改為chinese[zh_CN].

中文亂碼

由於zabbix的web前端默認沒有中文字庫,因此zabbix圖形化顯示時下面的中文都是方框。
解決方法就是拷貝中文字體到zabbix前端。

1.進入c:\Windows\Fonts,選擇其中任意一種中文字庫例如楷體文件simkai.ttf,將其拷貝至zabbix的web 前端頁面字體/usr/share/zabbix/fonts 下

[root@iZ94ekimlddZ fonts]# ls
graphfont.ttf  simkai.ttf

2.修改zabbix的web前端 defines.inc.php

# vim /usr/share/zabbix/include/defines.inc.php

找到
define('ZBX_FONT_NAME',                       'DejaVuSans');
define('ZBX_GRAPH_FONT_NAME',                 'DejaVuSans'); 

這2行修改為
define('ZBX_FONT_NAME',                       'SIMKAI');
define('ZBX_GRAPH_FONT_NAME',                 'SIMKAI'); 

保存退出

其他

Zabbix官網安裝教程(翻牆):
https://www.zabbix.com/documentation/2.2/manual/installation/install_from_packages#red_hat_enterprise_linux_centos

zabbix中文操作手冊:
http://pan.baidu.com/s/1i46GoQh 密碼:xw5n (手冊中有相關shell腳本下載地址)

zabbix中文操作手冊

zabbix_agentd.conf配置文件詳解
http://www.ttlsa.com/zabbix/zabbix_agentd-conf-description/

zabbix_server.conf配置文件詳解
http://www.ttlsa.com/zabbix/zabbix_server-conf-detail/

grafana-zabbix插件安裝:
在grafana插件中心安裝grafana-zabbix插件后,需要配置相關數據源:
http://blog.csdn.net/zk673820543/article/details/50617412

grafana-zabbix使用教程【內含gif圖】:
https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage


原文地址:
http://wangxin123.com/2016/09/23/zabbix server安裝詳解/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM