Zabbix server-side installation and configuration
This article introduces the relevant knowledge of "zabbix server-side installation and configuration". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Zabbix-server configuration
The version of zabbix chooses version 3.0 of LTS and the version of server OS is RHEL 6.5.
Configure zabbix repository for yum to install zabbix
~] # cd / etc/yum.repos.d/yum.repos.d] # vim Zabbix.repos [zabbix] name=zabbix repobaseurl= http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/enabled=1gpgcheck=0
Install mysql, make configuration changes, and start
~] # yum install mysql-server-y~] # vim / etc/my.cnf [mysqld] datadir=/home/mysqldatasocket=/var/lib/mysql/mysql.sockuser=mysql# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links= 0 [mysqld _ safe] log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pidskip_name_resolve=oninnodb_file_per_table=on~] # service mysqld start
Create a zabbix library and authorize links
[root@wuzabbix mysqldata] # mysqlWelcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 2Server version: 5.1.73 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.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)
Install zabbix related components and initialize the zabbix library
~] # yum install zabbix-server-mysql zabbix-web zabbix-agent zabbix-web-mysql zabbix-sender zabbix-get to view zabbix-mysql-related content ~] # 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 library initialization operation
[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] # lltotal 3752What Rukhashi-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 188Apr 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]# mysqlWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.1.73 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>Use zabbixReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with-ADatabase changedmysql > SHOW tables +-- + | Tables_in_zabbix | +-+ | acknowledges | | actions | | alerts | | application_discovery | | application_prototype | | application_template | | applications | | auditlog | | auditlog_details | | autoreg_host | | conditions | | config | | dchecks | | dhosts | | drules | dservices | escalations | | events | expressions | | functions | Globalmacro | | globalvars | | graph_discovery | | 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 | items_applications | _ groups | | maintenances_hosts | | maintenances_windows | | mappings | | media | | media_type | | opcommand | | opcommand_grp | | opconditions | | operations | | opgroup | | opinventory | | opmessage | | opmessage_grp | | 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 | slideshow_usrgrp | _ 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)
Start the zabbix-server process
Process / etc/init.d/zabbix-server configuration file description: there are four types of / etc/zabbix/zabbix_server.conf directives: # GENERAL PARAMETERS # # ADVANCED PARAMETERS # LOADABLE MODULES # TLS -RELATED PARAMETERS # configuration document is modified as follows: ListenPort=10051 SourceIP= LogType=file LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=1024 # log switch PidFile=/var/run/zabbix/zabbix_server.pid DBHost=127.0.0.1 DBName=zabbix DBUser=zbxuser DBPassword=* DBSocket=/var/lib/mysql/mysql.sock # start the zabbix service [root@wuzabbix ~] # service zabbix- according to the specific configuration settings of mysql Server startStarting Zabbix server: [OK] [root@wuzabbix ~] # service zabbix-server statuszabbix_server (pid 10995) is running...2, Configure zabbix-web
Since zabbix-web has a minimum configuration for the php version, first deal with the related components of php
Upgrade PHP configuration webaticsource ~] # rpm-ivh http://repo.webtatic.com/yum/el6/latest.rpm uninstall old version 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 install new version 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
Configure the time zone assignment for php
~] # vim / etc/php.inidate.timezone = Asia/Shanghaipost_max_size = 32Mmax_execution_time = 300max_input_time = 300always_populate_raw_post_data =-1
Start web server
Service httpd start
Create web resources for zabbix and grant relevant permissions
~] # mkdir / var/www/html/zabbix~] # cd / usr/share/zabbix/~] # cp-a. / var/www/html/zabbix/~] # chown-R apache:apache / var/www/html/zabbix
Add related services to httpd,mysqld,zabbix-server,zabbix-agent after configuration
Chkconfig httpd onchkconfig mysqld onchkconfig zabbix-server onchkconfig zabbix-agentd onservice zabbix-server restart
Note: there is an error when starting http, which is normal after modifying the corresponding permissions.
[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
After the configuration is completed, you can enter web to configure and access URL: http://server/zabbix.
Download manually and copy it over
Initial account number and password:
Admin
Zabbix
This is the end of the content of "zabbix server-side installation and configuration". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!