您好,登錄后才能下訂單哦!
本篇內容介紹了“zabbix服務器端安裝及配置”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
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
創建zabbix庫,并授權鏈接
[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相關組件并進行zabbix庫初始化
~]# yum install zabbix-server-mysql zabbix-web zabbix-agent zabbix-web-mysql zabbix-sender zabbix-get 查看zabbix-mysql相關內容 ~]# 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 #根據mysql具體配置設置 啟動zabbix服務 [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相關組件進行處理
升級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的時區指定
~]# 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
創建zabbix的web資源,并授予相關權限
~]# mkdir /var/www/html/zabbix ~]# cd /usr/share/zabbix/ ~]# cp -a . /var/www/html/zabbix/ ~]# chown -R apache:apache /var/www/html/zabbix
配置結束后將相關服務添加至開啟自啟動(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時有一個報錯,修改相應權限后正常
[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服務器端安裝及配置”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。