CentOS6.6安裝Zabbix2.4監控系統

一、安裝前的準備:

  1. 防火牆關閉:service iptables stop

                chkconfigiptables off

  2. Selinux關閉:vi/etc/selinux/config enforing改成disabled,然後reboot

  3. 網絡設置:vi /etc/sysconfig/network-script on boot改成yes

    然後service network restart

    chkconfig network on

 

二、 zabbix-server服務器端的安裝

安裝 zabbix官方源和epel

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

#rpm –ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

 

   三、安裝zabbix-server

   #yum install –y zabbix zabbix-get zabbix-server zabbix-web-mysql zabbix-webzabbix-agent

   安裝完成後可以看到,yum方式安裝並沒有自動安裝mysql-server

 

   四、安裝MySQL數據庫服務

  #yum –y install mysql-server

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

[mysqld]

datadir=/var/lib/mysql

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

user=mysql

# Disabling symbolic-links is recommendedto prevent assorted security risks

symbolic-links=0

character-set-server=utf8    #設置字符集爲utf8

innodb_file_per_table=1    #innodb的每個表文件單獨存儲

 

[mysqld_safe]

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

pid-file=/var/run/mysqld/mysqld.pid

 

   #servicemysqld start

  #chkconfig mysqld on

 

  1. 創建zabbix的數據庫

# mysqladmin-uroot password admin

# mysql -uroot-padmin

mysql> createdatabase zabbix character set utf8;

mysql> grantall privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

mysql> flushprivileges;

 

  1. 導入zabbix-server的數據庫

# mysql -uzabbix–pzabbix

mysql> usezabbix

mysql> source/usr/share/doc/zabbix-server-pgsql-2.4.6/create/schema.sql;

mysql> source/usr/share/doc/zabbix-server-pgsql-2.4.6/create/images.sql

mysql> source/usr/share/doc/zabbix-server-pgsql-2.4.6/create/data.sql

mysql> showtables;

 

   五、配置zabbix_server.conf

 

   1. 配置zabbix_server.conf

   vi/etc/zabbix/zabbix_server.conf

### Option: DBHost

#      Database host name.

#      If set to localhost, socket is used for MySQL.

#      If set to empty string, socket is used for PostgreSQL.

#

# Mandatory: no

# Default:

 

DBHost=localhost   #可修改

 

### Option: DBName

#      Database name.

#      For SQLite3 path to database file must be provided. DBUser andDBPassword are ignored.

#

# Mandatory: yes

# Default:

# DBName=

 

DBName=zabbix   #默認

 

### Option: DBSchema

#      Schema name. Used for IBM DB2 and PostgreSQL.

#

# Mandatory: no

# Default:

# DBSchema=

 

### Option: DBUser

#      Database user. Ignored for SQLite.

#

# Mandatory: no

# Default:

# DBUser=

 

DBUser=zabbix    #默認

 

### Option: DBPassword

#      Database password. Ignored for SQLite.

#      Comment this line if no password is used.

#

# Mandatory: no

# Default:

 

DBPassword=zabbix    #需修改

### Option: DBSocket

#      Path to MySQL socket.

#

# Mandatory: no

# Default:

# DBSocket=/tmp/mysql.sock

 

DBSocket=/var/lib/mysql/mysql.sock

 

### Option: DBPort

#      Database port when not using local socket. Ignored for SQLite.

    以上參數只需關注黑體字部分,這部分爲性能參數,需根據實際情況進行調整。默認只需修改DBPassword=zabbix即可。

# mkdir/etc/zabbix/alertscripts /etc/zabbix/externalscripts

 

  1. 啓動zabbix-server服務

   # service zabbix-server start

   #service httpd start

# chkconfig zabbix-server on

# chkconfig httpd on

 

  1. 配置時區參數

   vi /etc/httpd/conf.d/zabbix.conf

<Directory"/usr/share/zabbix">

   Options FollowSymLinks

   AllowOverride None

   Order allow,deny

   Allow from all

 

   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 Asia/Shanghai   #把時區改成中國上海

</Directory>

 

<Directory"/usr/share/zabbix/conf">

   Order deny,allow

   Deny from all

   <files *.php>

       Order deny,allow

       Deny from all

    #service httpd restart

 

至此,默認配置完成,打開瀏覽器,輸入http://ip地址/zabbix,會出現如下圖所示的畫面:

下一步:

 wKioL1XZcKOx4SX8AAQMJBpmYzc790.jpg

 

下一步:

wKioL1XZcMzBYhhuAAVMuIncZkE942.jpg

 

下一步:

wKioL1XZcNnhnB9JAATimSaGCWU613.jpg

 

下一步:

wKioL1XZcOXA0pqOAAQ5F-7EZqY151.jpg

 

下一步:

wKioL1XZcPHi8BDIAATq3H8ldU4921.jpg

 

下一步:

wKioL1XZcPyTEjMqAAPzm405PfQ027.jpg

 

默認用戶名:Admin

默認密碼:zabbix


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