本篇內(nèi)容介紹了“zabbix服務(wù)器端安裝及配置”的有關(guān)知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細閱讀,能夠?qū)W有所成!
成都創(chuàng)新互聯(lián)公司專業(yè)成都網(wǎng)站設(shè)計、成都網(wǎng)站建設(shè),集網(wǎng)站策劃、網(wǎng)站設(shè)計、網(wǎng)站制作于一體,網(wǎng)站seo、網(wǎng)站優(yōu)化、網(wǎng)站營銷、軟文營銷等專業(yè)人才根據(jù)搜索規(guī)律編程設(shè)計,讓網(wǎng)站在運行后,在搜索中有好的表現(xiàn),專業(yè)設(shè)計制作為您帶來效益的網(wǎng)站!讓網(wǎng)站建設(shè)為您創(chuàng)造效益。zabbix版本選擇LTS的3.0版本、server端OS版本為RHEL 6.5
配置zabbix倉庫,進行yum安裝zabbix
~]# cd /etc/yum.repos.d/ yum.repos.d]# vim zabbix.repo [zabbix] name=zabbix repo baseurl=http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/ enabled=1 gpgcheck=0
安裝mysql,進行配置修改并啟動
~]# yum install mysql-server -y ~]# vim /etc/my.cnf [mysqld] datadir=/home/mysqldata socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid skip_name_resolve=on innodb_file_per_table=on ~]# service mysqld start
創(chuàng)建zabbix庫,并授權(quán)鏈接
[root@wuzabbix mysqldata]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE zabbix CHARSET 'utf8'; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL ON zabbix.* TO zbxuser@'127.0.0.1' IDENTIFIED BY '*'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL ON zabbix.* TO zbxuser@'10.%.%.%' IDENTIFIED BY '*'; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec)
安裝zabbix相關(guān)組件并進行zabbix庫初始化
~]# yum install zabbix-server-mysql zabbix-web zabbix-agent zabbix-web-mysql zabbix-sender zabbix-get 查看zabbix-mysql相關(guān)內(nèi)容 ~]# rpm -ql zabbix-server-mysql /etc/init.d/zabbix-server /etc/logrotate.d/zabbix-server /etc/zabbix/zabbix_server.conf /usr/lib/zabbix/alertscripts /usr/lib/zabbix/externalscripts /usr/sbin/zabbix_server_mysql /usr/share/doc/zabbix-server-mysql-3.0.9 /usr/share/doc/zabbix-server-mysql-3.0.9/AUTHORS /usr/share/doc/zabbix-server-mysql-3.0.9/COPYING /usr/share/doc/zabbix-server-mysql-3.0.9/ChangeLog /usr/share/doc/zabbix-server-mysql-3.0.9/NEWS /usr/share/doc/zabbix-server-mysql-3.0.9/README /usr/share/doc/zabbix-server-mysql-3.0.9/create.sql.gz /usr/share/man/man8/zabbix_server.8.gz /var/log/zabbix /var/run/zabbix
zabbix庫初始化操作
[root@wuzabbix zabbix]# cd /usr/share/doc/zabbix-server-mysql-3.0.9/ [root@wuzabbix zabbix-server-mysql-3.0.9]# gzip -d create.sql.gz [root@wuzabbix zabbix-server-mysql-3.0.9]# ll total 3752 -rw-r--r-- 1 root root 98 Apr 20 20:05 AUTHORS -rw-r--r-- 1 root root 718465 Apr 20 20:05 ChangeLog -rw-r--r-- 1 root root 17990 Apr 20 20:05 COPYING -rw-r--r-- 1 root root 3086105 Apr 24 01:57 create.sql -rw-r--r-- 1 root root 52 Apr 20 20:05 NEWS -rw-r--r-- 1 root root 188 Apr 20 20:05 README [root@wuzabbix zabbix-server-mysql-3.0.9]# mysql -h227.0.0.1 -uzbxuser -p *** < create.sql Enter password: [root@wuzabbix zabbix-server-mysql-3.0.9]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use zabbix Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> SHOW tables; +----------------------------+ | Tables_in_zabbix | +----------------------------+ | acknowledges | | actions| | alerts | | application_discovery | | application_prototype | | application_template | | applications | | auditlog | | auditlog_details | | autoreg_host | | conditions | | config | | dbversion | | dchecks| | dhosts | | drules | | dservices | | escalations| | events | | expressions| | functions | | globalmacro| | globalvars | | graph_discovery| | graph_theme| | graphs | | graphs_items | | group_discovery| | group_prototype| | groups | | history| | history_log| | history_str| | history_text | | history_uint | | host_discovery | | host_inventory | | hostmacro | | hosts | | hosts_groups | | hosts_templates| | housekeeper| | httpstep | | httpstepitem | | httptest | | httptestitem | | icon_map | | icon_mapping | | ids| | p_w_picpaths | | interface | | interface_discovery| | item_application_prototype | | item_condition | | item_discovery | | items | | items_applications | | maintenances | | maintenances_groups| | maintenances_hosts | | maintenances_windows | | mappings | | media | | media_type | | opcommand | | opcommand_grp | | opcommand_hst | | opconditions | | operations | | opgroup| | opinventory| | opmessage | | opmessage_grp | | opmessage_usr | | optemplate | | profiles | | proxy_autoreg_host | | proxy_dhistory | | proxy_history | | regexps| | rights | | screen_user| | screen_usrgrp | | screens| | screens_items | | scripts| | service_alarms | | services | | services_links | | services_times | | sessions | | slides | | slideshow_user | | slideshow_usrgrp | | slideshows | | sysmap_element_url | | sysmap_url | | sysmap_user| | sysmap_usrgrp | | sysmaps| | sysmaps_elements | | sysmaps_link_triggers | | sysmaps_links | | timeperiods| | trends | | trends_uint| | trigger_depends| | trigger_discovery | | triggers | | users | | users_groups | | usrgrp | | valuemaps | +----------------------------+ 113 rows in set (0.00 sec)
啟動zabbix-server進程
進程 /etc/init.d/zabbix-server 配置文件說明: /etc/zabbix/zabbix_server.conf 指令有四類: ############ GENERAL PARAMETERS ################# ############ ADVANCED PARAMETERS ################ ####### LOADABLE MODULES ####### ####### TLS-RELATED PARAMETERS ####### 配置文檔修改如下: ListenPort=10051 SourceIP= LogType=file LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=1024 #日志切換 PidFile=/var/run/zabbix/zabbix_server.pid DBHost=127.0.0.1 DBName=zabbix DBUser=zbxuser DBPassword=***** DBSocket=/var/lib/mysql/mysql.sock #根據(jù)mysql具體配置設(shè)置 啟動zabbix服務(wù) [root@wuzabbix ~]# service zabbix-server start Starting Zabbix server:[ OK ] [root@wuzabbix ~]# service zabbix-server status zabbix_server (pid 10995) is running...
由于zabbix-web對php版本有最低配置,首先對php相關(guān)組件進行處理
升級PHP 配置webtatic源 ~]# rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm 卸載舊版本php ~]# yum erase php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mcrypt php-mbstring php-devel php-pecl-memcached php-pecl-memcache php-common php-pdo php-cli php-fpm libmemcached 安裝新版本php ~]# yum install httpd php56w php56w-mysql php56w-gd php56w-imap php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mcrypt php56w-mbstring php56w-devel php56w-pecl-memcached php56w-common php56w-pdo php56w-cli php56w-pecl-memcache php56w-bcmath php56w-fpm
配置php的時區(qū)指定
~]# vim /etc/php.ini date.timezone = Asia/Shanghai post_max_size = 32M max_execution_time = 300 max_input_time = 300 always_populate_raw_post_data = -1
啟動web server
service httpd start
創(chuàng)建zabbix的web資源,并授予相關(guān)權(quán)限
~]# mkdir /var/www/html/zabbix ~]# cd /usr/share/zabbix/ ~]# cp -a . /var/www/html/zabbix/ ~]# chown -R apache:apache /var/www/html/zabbix
配置結(jié)束后將相關(guān)服務(wù)添加至開啟自啟動(httpd,mysqld,zabbix-server,zabbix-agent)
chkconfig httpd on chkconfig mysqld on chkconfig zabbix-server on chkconfig zabbix-agentd on service zabbix-server restart
備注,啟動http時有一個報錯,修改相應(yīng)權(quán)限后正常
[Mon May 22 15:39:53 2017] [error] [client 10.55.56.86] PHP Warning: require_once(/etc/zabbix/web/maintenance.inc.php): failed to open stream: Permission denied in /var/www/html/zabbix/include/classes/core/ZBase.php on line 269 ]# chmod -R 755 /etc/zabbix/web
配置完成后便可進入web進行配置,訪問URL:http://server/zabbix
手動download并拷貝過去
初始賬號及密碼:
admin
zabbix
“zabbix服務(wù)器端安裝及配置”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。