In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Building ZABBIX Monitoring system by CVM
Content of the experiment
ZABBIX is an enterprise-level open source solution based on WEB interface that provides distributed system monitoring and network monitoring capabilities. ZABBIX can monitor various network parameters to ensure the safe operation of the server system, and provides a flexible notification mechanism to enable system administrators to quickly locate / solve various problems. This tutorial is to build a ZABBIX monitoring system in CVM.
Basic environment configuration
Install the PHP environment
Remove the PHP components currently installed on the system
Basic environment configuration
Install the PHP environment
Remove the PHP components currently installed on the system
[root@VM_208_217_centos ~] # cat / etc/redhat-release
CentOS release 6.8 (Final)
[root@VM_208_217_centos ~] #
[root@VM_208_217_centos ~] # yum remove php-y
Loaded plugins: fastestmirror, security
Setting up Remove Process
No Match for argument: php
Epel | 5.3kB 00:00
Epel/primary_db | 6.1 MB 00:01
Extras | 3.4 kB 00:00
Extras/primary_db | 29 kB 00:00
Os | 3.7 kB 00:00
Os/primary_db | 4.7 MB 00:00
Updates | 3.4 kB 00:00
Updates/primary_db | 6.6 MB 00:00
Package (s) php* available, but not installed.
No Packages marked for removal
Install the YUM source for PHP
Root@VM_208_217_centos ~] # rpm-Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
Retrieving http://mirror.webtatic.com/yum/el6/latest.rpm
Warning: / var/tmp/rpm-tmp.HbepNu: Header V4 DSA/SHA1 Signature, key ID cf4c4ff9: NOKEY
Preparing... # [100%]
1:webtatic-release # # [100%]
Check whether the YUM source already exists
[root@VM_208_217_centos ~] # ll / etc/yum.repos.d/webtatic.repo
-rw-r--r-- 1 root root 865 Nov 13 2016 / etc/yum.repos.d/webtatic.repo
[root@VM_208_217_centos ~] #
Install the PHP environment
[root@VM_208_217_centos ~] # yum list | grep php71w | awk'{printf ("% s", $1)}'
Mod_php71w.x86_64 php71w-bcmath.x86_64 php71w-cli.x86_64 php71w-common.x86_64 php71w-dba.x86_64 php71w-devel.x86_64 php71w-embedded.x86_64 php71w-enchant.x86_64 php71w-fpm.x86_64 php71w-gd.x86_64 php71w-imap.x86_64 php71w-interbase.x86_64 php71w-intl.x86_64 php71w-ldap.x86_64 php71w-mbstring.x86_64 php71w-mcrypt.x86_64 php71w-mysqlnd.x86_64 php71w -odbc.x86_64 php71w-opcache.x86_64 php71w-pdo.x86_64 php71w-pdo_dblib.x86_64 php71w-pear.noarch php71w-pecl-apcu.x86_64 php71w-pecl-apcu-devel.x86_64 php71w-pecl-geoip.x86_64 php71w-pecl-igbinary.x86_64 php71w-pecl-igbinary-devel.x86_64 php71w-pecl-imagick.x86_64 php71w-pecl-imagick-devel.x86_64 php71w-pecl-memcached.x86_64 php71w-pecl-mongodb.x86_ 64 php71w-pecl-redis.x86_64 php71w-pecl-xdebug.x86_64 php71w-pgsql.x86_64 php71w-phpdbg.x86_64 php71w-process.x86_64 php71w-pspell.x86_64 php71w-recode.x86_64 php71w-snmp.x86_64 php71w-soap.x86_64 php71w-tidy.x86_64 php71w-xml.x86_64 php71w-xmlrpc.x86_64 php71w-mysql.x86_64 [root@VM_208_217_centos ~] #
[root@VM_208_217_centos ~] # yum-y install yum list | grep php71w | awk'{printf ("% s", $1)}'--skip-broken
Package php71w-xmlrpc-7.1.33-1.w6.x86_64 already installed and latest version
Resolving Dependencies
-> Running transaction check
-> Package php71w-mysql.x86_64 0 7.1.33-1.w6 will be installed
-- > Processing Conflict: php71w-mysql-7.1.33-1.w6.x86_64 conflicts php71w-mysqlnd
Packages skipped because of dependency problems:
Php71w-mysql-7.1.33-1.w6.x86_64 from webtatic
[root@VM_208_217_centos ~] #
Modify the PHP parameters to install the installation requirements of ZABBIX
[root@VM_208_217_centos ~] # sed-I "swarming date. Timezone = # date.timezone = Asia/Shanghai#g" / etc/php.ini
[root@VM_208_217_centos ~] # cat / etc/php.ini | grep-I timezone
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
Date.timezone = Asia/Shanghai
[root@VM_208_217_centos ~] # sed-I "s#grep max_execution_time / etc/php.ini#max_execution_time = 300g" / etc/php.ini
[root@VM_208_217_centos ~] # grep max_execution_time / etc/php.ini
Max_execution_time = 300
[root@VM_208_217_centos ~] #
Sed-I "sbank date. Timezone = / date.timezone = Asia/Shanghai/g" / etc/php.ini
Sed-I "s#grep max_execution_time / etc/php.ini#max_execution_time = 300 millig" / etc/php.ini
Sed-I "s#grep post_max_size / etc/php.ini#post_max_size = 32M#g" / etc/php.ini
Sed-I "s#grep max_input_time = / etc/php.ini#max_input_time = 300g" / etc/php.ini
Sed-I "s#grep memory_limit / etc/php.ini#memory_limit = 128M#g" / etc/php.ini
Start the PHP-FPM service
[root@VM_208_217_centos ~] # service php-fpm start
Check whether the program starts properly
[root@VM_208_217_centos ~] # service php-fpm start
Starting php-fpm: No log handling enabled-turning on stderr logging
Created directory: / var/lib/net-snmp/mib_indexes
[OK]
Add it to boot self-boot
[root@VM_208_217_centos ~] # netstat-lntup | grep php-fpm
Tcp 00 127.0.0.1 9000 0.0.0.0 * LISTEN 3152/php-fpm
[root@VM_208_217_centos ~] #
YUM installation related dependent components
Install WEB and database services
[root@VM_208_217_centos ~] # yum install-y ntpdate mailx dos2unix vim zcat wget net-snmp-utils gcc gcc-c++ autoconf httpd libxml* mysql mysql-server httpd-manual mod_ssl mod_perl mod_auth_mysql mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel OpenIPMI-devel java-devel fping
Updated:
Mailx.x86_64 0RO 12.4-10.el6_10 ntpdate.x86_64 0:4.2.6p5-15.el6.centos vim-enhanced.x86_64 2RV 7.4.629-5.el6_10.2 wget.x86_64 0RO 1.12-10.el6
Dependency Updated:
Curl.x86_64 0VR 7.19.7-53.el6_9 db4.x86_64 0V 4.7.25-22.el6 db4-utils.x86_64 0V 4.7.25-22.el6 e2fsprogs.x86_64 0V 1.41.12-24.el6
E2fsprogs-libs.x86_64 0VOR 1.41.12-24.el6 glib2.i686 0V 2.28.8-10.el6 glib2.x86_64 0V 2.28.8-10.el6 krb5-libs.x86_64 0V 1.10.3-65.el6
Libcom_err.x86_64 0VOR 1.41.12-24.el6 libcurl.x86_64 0V 7.19.7-53.el6_9 libgcc.i686 0V 4.4.7-23.el6 libgcc.x86_64 0V 4.4.7-23.el6
Libss.x86_64 0VOR 1.41.12-24.el6 libstdc++.i686 0V 4.4.7-23.el6 libstdc++.x86_64 0V 4.4.7-23.el6 mysql-libs.x86_64 0V 5.1.73-8.el6_8
Nspr.x86_64 0VOR 4.21.0-1.el6_10 nss.x86_64 0RU 3.44.0-7.el6_10 nss-softokn.x86_64 0RU 3.44.0-5.el6_10 nss-softokn-freebl.i686 0RU 3.44.0-5.el6_10
Nss-softokn-freebl.x86_64 0VOR 3.44.0-5.el6_10 nss-sysinit.x86_64 0RU 3.44.0-7.el6_10 nss-tools.x86_64 0RU 3.44.0-7.el6_10 nss-util.x86_64 0RU 3.44.0-1.el6_10
Ntp.x86_64 0:4.2.6p5-15.el6.centos openssl.x86_64 0:1.0.1e-58.el6_10 perl.x86_64 4vl 5.10.1-144.el6 perl-Module-Pluggable.x86_64 1purl 3.90-144.el6
Perl-Pod-Escapes.x86_64 1vl 1.04-144.el6 perl-Pod-Simple.x86_64 1RO 3.13-144.el6 perl-libs.x86_64 4RO 5.10.1-144.el6 perl-version.x86_64 3RO 0.77-144.el6
Rpm.x86_64 0VOR 4.8.0-59.el6 rpm-libs.x86_64 0VOR 4.8.0-59.el6 rpm-python.x86_64 0RU 4.8.0-59.el6 vim-common.x86_64 2RV 7.4.629-5.el6_10.2
Complete!
[root@VM_208_217_centos ~] #
Start the MYSQL service
[root@VM_208_217_centos ~] # service mysqld start
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
Support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER!
To do so, start the server, then issue the following commands:
/ usr/bin/mysqladmin-u root password' new-password'
/ usr/bin/mysqladmin-u root-h VM_208_217_centos password' new-password'
Alternatively you can run:
/ usr/bin/mysql_secure_installation
Which will also give you the option of removing the test
Databases and anonymous user created by default. This is
Strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
Cd / usr; / usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
Cd / usr/mysql-test; perl mysql-test-run.pl
Please report any problems with the / usr/bin/mysqlbug script!
[OK]
Starting mysqld: [OK]
[root@VM_208_217_centos ~] # chkconfig mysqld on
[root@VM_208_217_centos ~] # mysql-uroot-e "create database zabbix character set utf8;"
[root@VM_208_217_centos ~] # mysql-uroot-e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';"
[root@VM_208_217_centos ~] # mysql-uroot-e "flush privileges;"
[root@VM_208_217_centos ~] #
[root@VM_208_217_centos] # groupadd zabbix-g 201
[root@VM_208_217_centos] # useradd-g zabbix-u 201-m-s / sbin/nologin zabbix
[root@VM_208_217_centos ~] #
Installation and deployment of ZABBIX related components
Install the ZABBIX source
[root@VM_208_217_centos ~] # rpm-ivh http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm
Retrieving http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm
Warning: / var/tmp/rpm-tmp.O9iKTG: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Preparing... # [100%]
1:zabbix-release # # [100%]
[root@VM_208_217_centos ~] # ll / etc/yum.repos.d/zabbix.repo
-rw-r--r-- 1 root root 636 Sep 14 2016 / etc/yum.repos.d/zabbix.repo
[root@VM_208_217_centos ~] #
Create a download directory to download related software packages
[root@VM_208_217_centos] # mkdir / software & & cd / software
[root@VM_208_217_centos software] # wget-c-- timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-server-mysql-3.2.7-1.el6.x86_64.rpm
-- 2019-11-13 17 purl 33 Vol 51 Meri-http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-server-mysql-3.2.7-1.el6.x86_64.rpm
Resolving repo.zabbix.com... 162.243.159.138, 2604:a880:1:20::b82:1001
Connecting to repo.zabbix.com | 162.243.159.138 |: 80. Connected.
HTTP request sent, awaiting response... 200 OK
Length: 1848284 (1.8m) [application/x-redhat-package-manager]
Saving to: "zabbix-server-mysql-3.2.7-1.el6.x86_64.rpm"
1848284 100K/s in 25s
2019-11-13 17:34:17 (73.4 KB/s)-"zabbix-server-mysql-3.2.7-1.el6.x86_64.rpm" saved [1848284pm 1848284]
[root@VM_208_217_centos software] # wget-c-- timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-web-3.2.7-1.el6.noarch.rpm
-- 2019-11-13 17-14-14-14-14-14-11-13-17-14-11-13-17-14-14-11-13-17-14-14-11-13-17-14-14-14-11-13-2019-11-13 1714
Resolving repo.zabbix.com... 162.243.159.138, 2604:a880:1:20::b82:1001
Connecting to repo.zabbix.com | 162.243.159.138 |: 80. Connected.
HTTP request sent, awaiting response... 200 OK
Length: 5496112 (5.2m) [application/x-redhat-package-manager]
Saving to: "zabbix-web-3.2.7-1.el6.noarch.rpm"
0 [] 32211 10.8K/s in 2.9s
2019-11-13 17:34:23 (10.8 KB/s)-Connection closed at byte 32211. Retrying.
-- 2019-11-13 17 34 Murray-(try: 2) http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-web-3.2.7-1.el6.noarch.rpm
Connecting to repo.zabbix.com | 162.243.159.138 |: 80. Connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 5496112 (5.2m), 5463901 (5.2m) remaining [application/x-redhat-package-manager]
Saving to: "zabbix-web-3.2.7-1.el6.noarch.rpm"
5496112 1.18M/s in 9.1s
2019-11-13 17:34:33 (589 KB/s)-"zabbix-web-3.2.7-1.el6.noarch.rpm" saved [5496112According 5496112]
[root@VM_208_217_centos software] # wget-c-- timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-web-mysql-3.2.7-1.el6.noarch.rpm
-- 2019-11-13 17140 34RU 33muri-http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/deprecated/zabbix-web-mysql-3.2.7-1.el6.noarch.rpm
Resolving repo.zabbix.com... 162.243.159.138, 2604:a880:1:20::b82:1001
Connecting to repo.zabbix.com | 162.243.159.138 |: 80. Connected.
HTTP request sent, awaiting response... 200 OK
Length: 5900 (5.8K) [application/x-redhat-package-manager]
Saving to: "zabbix-web-mysql-3.2.7-1.el6.noarch.rpm"
5900 [= >] 100% [= >] 100% [= >] 5900 -.-Kmax s in 0s
2019-11-13 17:34:34 (386 MB/s)-"zabbix-web-mysql-3.2.7-1.el6.noarch.rpm" saved [5900 Univer 5900]
[root@VM_208_217_centos software] # wget-c-- timeout=10 http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-agent-3.2.7-1.el6.x86_64.rpm
-- 2019-11-13 17-14-34-42-http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-agent-3.2.7-1.el6.x86_64.rpm
Resolving repo.zabbix.com... 162.243.159.138, 2604:a880:1:20::b82:1001
Connecting to repo.zabbix.com | 162.243.159.138 |: 80. Connected.
HTTP request sent, awaiting response... 200 OK
Length: 348200 (340K) [application/x-redhat-package-manager]
Saving to: "zabbix-agent-3.2.7-1.el6.x86_64.rpm"
348200 29.5K/s in 13s
2019-11-13 17:34:55 (26.4 KB/s)-"zabbix-agent-3.2.7-1.el6.x86_64.rpm" saved [348200 apprentice 348200]
[root@VM_208_217_centos software] #
Install ZABBIX related components
[root@VM_208_217_centos software] # yum localinstall-y zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-web*
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing: fontpackages-filesystem-1.41-1.1.el6.noarch 1 Compact 7
Installing: dejavu-fonts-common-2.33-1.el6.noarch 2 Compact 7
Installing: dejavu-sans-fonts-2.33-1.el6.noarch 3 Universe 7
Installing: zabbix-web-mysql-3.2.7-1.el6.noarch 4 Compact 7
Installing: zabbix-web-3.2.7-1.el6.noarch 5 Universe 7
Installing: iksemel-1.4-2.el6.x86_64 6 and 7
Installing: zabbix-server-mysql-3.2.7-1.el6.x86_64 7 Compact 7
Verifying: zabbix-server-mysql-3.2.7-1.el6.x86_64 1 Compact 7
Verifying: iksemel-1.4-2.el6.x86_64 2 Compact 7
Verifying: dejavu-sans-fonts-2.33-1.el6.noarch 3 Universe 7
Verifying: fontpackages-filesystem-1.41-1.1.el6.noarch 4 Compact 7
Verifying: dejavu-fonts-common-2.33-1.el6.noarch 5 Universe 7
Verifying: zabbix-web-mysql-3.2.7-1.el6.noarch 6 and 7
Verifying: zabbix-web-3.2.7-1.el6.noarch 7 Compact 7
Installed:
Zabbix-server-mysql.x86_64 0VOR 3.2.7-1.el6 zabbix-web.noarch 0RU 3.2.7-1.el6 zabbix-web-mysql.noarch 0RU 3.2.7-1.el6
Dependency Installed:
Dejavu-fonts-common.noarch 0VOR 2.33-1.el6 dejavu-sans-fonts.noarch 0RU 2.33-1.el6 fontpackages-filesystem.noarch 0RU 1.41-1.1.el6 iksemel.x86_64 0RH 1.4-2.el6
Complete!
Import database
[root@VM_208_217_centos software] # cd / usr/share/doc/zabbix-server-mysql-3.2.7
[root@VM_208_217_centos zabbix-server-mysql-3.2.7] # zcat create.sql.gz | mysql- uroot zabbix
[root@VM_208_217_centos zabbix-server-mysql-3.2.7] #
[root@VM_208_217_centos zabbix-server-mysql-3.2.7] # mysqladmin-uroot password "mysqladmin"
[root@VM_208_217_centos zabbix-server-mysql-3.2.7] #
Copy web page files
[root@VM_208_217_centos zabbix-server-mysql-3.2.7] # cd / usr/share/
[root@VM_208_217_centos share] # cp-r. / zabbix/ / var/www/html/zabbix
[root@VM_208_217_centos share] #
Modify the configuration file
[root@VM_208_217_centos share] # echo "DBPassword=zabbix" > > / etc/zabbix/zabbix_server.conf
[root@VM_208_217_centos share] #
Start related services
[root@VM_208_217_centos share] # service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[OK]
[root@VM_208_217_centos share] # service zabbix-server start
Starting Zabbix server: [OK]
[root@VM_208_217_centos share] # service zabbix-agent start
Zabbix-agent: unrecognized service
[root@VM_208_217_centos share] # chkconfig httpd on
[root@VM_208_217_centos share] # chkconfig mysqld on
[root@VM_208_217_centos share] # chkconfig php-fpm on
[root@VM_208_217_centos share] # chkconfig zabbix-server on
[root@VM_208_217_centos share] # chkconfig zabbix-agent on
Error reading information on service zabbix-agent: No such file or directory
[root@VM_208_217_centos share] #
[root@VM_208_217_centos share] # cd / software/
[root@VM_208_217_centos software] # ll
Total 7548
-rw-r--r-- 1 root root 348200 Jul 20 2017 zabbix-agent-3.2.7-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 1848284 Jul 20 2017 zabbix-server-mysql-3.2.7-1.el6.x86_64.rpm
-rw-r--r-- 1 root root 5496112 Jul 20 2017 zabbix-web-3.2.7-1.el6.noarch.rpm
-rw-r--r-- 1 root root 5900 Jul 20 2017 zabbix-web-mysql-3.2.7-1.el6.noarch.rpm
[root@VM_208_217_centos software] # yum install zabbix-agent-3.2.7-1.el6.x86_64.rpm-y
Loaded plugins: fastestmirror, security
Setting up Install Process
Examining zabbix-agent-3.2.7-1.el6.x86_64.rpm: zabbix-agent-3.2.7-1.el6.x86_64
Marking zabbix-agent-3.2.7-1.el6.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
Webtatic: us-east.repo.webtatic.com
Resolving Dependencies
-> Running transaction check
-> Package zabbix-agent.x86_64 0RU 3.2.7-1.el6 will be installed
-> Finished Dependency Resolution
Dependencies Resolved
=
Package Arch Version Repository Size=
Installing:
Zabbix-agent x86 million 64 3.2.7-1.el6 / zabbix-agent-3.2.7-1.el6.x86_64 1.3m
Transaction Summary=
Install 1 Package (s)
Total size: 1.3 M
Installed size: 1.3 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: zabbix-agent-3.2.7-1.el6.x86_64 1 Compact 1
Verifying: zabbix-agent-3.2.7-1.el6.x86_64 1 Compact 1
Installed:
Zabbix-agent.x86_64 0RO 3.2.7-1.el6
Complete!
[root@VM_208_217_centos software] #
[root@VM_208_217_centos software] # service zabbix-agent start
Starting Zabbix agent: [OK]
[root@VM_208_217_centos software] # chkconfig zabbix-agent on
[root@VM_208_217_centos software] #
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.