zabbix2.4安裝筆記php
1、關閉防火牆和Selinuxmysql
臨時性的徹底關閉防火牆,能夠不重啓機器:linux
/etc/init.d/iptables status ## 查看防火牆狀態web
/etc/init.d/iptable stop ## 本次關閉防火牆sql
/etc/init.d/iptable restart ## 重啓防火牆數據庫
永久性關閉防火牆:windows
chkconfig --level 35 iptables off ## 注意中間的是兩個英式小短線;重啓centos
[查看狀態root@bogon selinux]# /etc/init.d/iptables statuside
iptables: Firewall is not running.字體
關閉selinux
vi /etc/selinux/conf
修改SELINUX=disabled
[查看狀態root@bogon selinux]# /usr/sbin/sestatus -v
SELinux status: disabled
2、配置zabbix的yum安裝源
centos6.X
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
centos5.X
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
[root@zabbix-server yum.repos.d]# pwd
/etc/yum.repos.d
[root@zabbix-server yum.repos.d]# ll
total 20
-rw-r--r--. 1 root root 1924 Jan 6 23:31 CentOS-Base.repo
-rw-r--r--. 1 root root 638 Nov 27 2013 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 630 Nov 27 2013 CentOS-Media.repo
-rw-r--r--. 1 root root 3664 Nov 27 2013 CentOS-Vault.repo
-rw-r--r--. 1 root root 401 Sep 11 16:10 zabbix.repo
3、yum安裝所需的安裝包
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent mysql-server mysql -y
4、配置數據庫並導入數據
配置數據庫
[root@bogon /]# /etc/init.d/mysqld start
Initializing MySQL database: Installing MySQL system tables...
OK
mysql -e "create database zabbix character set utf8 collate utf8_bin;"
mysql
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
flush privileges;
導入數據庫
[root@bogon /]# cd usr/share/doc/zabbix-server-mysql-2.4.3/
[root@bogon zabbix-server-mysql-2.4.3]# ls
create upgrades
[root@bogon zabbix-server-mysql-2.4.3]# cd create/
[root@bogon create]# ls
data.sql p_w_picpaths.sql schema.sql
[root@bogon create]# mysql zabbix < schema.sql
[root@bogon create]# mysql zabbix < p_w_picpaths.sql
[root@bogon create]# mysql zabbix < data.sql
5、修改配置文件zabbix_server.conf
[root@bogon /]# cd /etc/zabbix/
[root@bogon zabbix]# ls
web zabbix_agentd.conf zabbix_agentd.d zabbix_server.conf
配置控制文件,添加DBPassword=zabbix語句,而後保存退出。
# Mandatory: no
# Default:
# DBPassword=
DBPassword=zabbix
### Option: DBSocket
修改php.ini的timezone
[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
;date.timezone =
date.timezone =Asia/Chongqing
啓動服務:
/etc/init.d/zabbix-server start
/etc/init.d/zabbix-agent start
service httpd start
設置開機啓動
chkconfig mysqld on
chkconfig zabbix-server on
chkconfig zabbix-agent on
chkconfig httpd on
中文漢語支持
修改配置文件/usr/share/zabbix/include/locales.inc.php將zh_CN的falus修改成true)
function getLocales() {
return array(
'en_GB' => array('name' => _('English (en_GB)'), 'display' => true),
'en_US' => array('name' => _('English (en_US)'), 'display' => true),
'bg_BG' => array('name' => _('Bulgarian (bg_BG)'), 'display' => false),
'zh_CN' => array('name' => _('Chinese (zh_CN)'), 'display' => true),
'zh_TW' => array('name' => _('Chinese (zh_TW)'), 'display' => false),
圖形中漢字亂碼問題
這個問題是因爲zabbix的web端沒有中文字庫,從windows下控制面板->字體->選擇一種中文字庫複製(例如「楷體」),改名爲graphfont.ttf。而後覆蓋掉/usr/share/zabbix/fonts/下的graphfont.ttf(記得對原有graphfont.ttf文件備份),重啓服務,刷新頁面,
註釋:一、zabbix web登錄地址爲http://IP地址/zabbix,如http://192.168.1.100/zabbix
二、zabbix web默認的帳戶爲Admin 密碼爲zabbix
(3) 安裝zabbix客戶端並啓動進入到目標主機的c:\zabbix目錄下,執行以下命令完成客戶端的安裝:zabbix_agentd.exe -c c:\zabbix\zabbix_agentd.conf -i執行以下命令,啓動客戶端:zabbix_agentd.exe -c c:\zabbix\zabbix_agentd.conf -s參數含義:-c 制定配置文件所在位置-I 是安裝客戶端(註冊服務)-s 啓動客戶端-x 中止客戶端-d 卸載客戶端zabbix_agentd.conf文件內容LogFile=c:\zabbix_agentd.logServer=192.168.0.11 #zabbix server的IP地址ServerActive=192.168.0.11 Hostname=xyhx