Detailed instructions on installing the Zabbix Monitoring Program in RedHat 7.1 (suitable for linux beginners) and redhatzabbix

Source: Internet
Author: User

Detailed instructions on installing the Zabbix Monitoring Program in RedHat 7.1 (suitable for linux beginners) and redhatzabbix

RedHat 7.1 install the Zabbix Monitoring Program (suitable for linux beginners)

Installation steps:

1. Install the LAMP architecture for zabbix

2. Install the zabbix Service

3. initialize the zabbix System

 

1. installation environment: VMware virtual

1234 [root@localhost ~]# cat /etc/redhat-releaseRed Hat Enterprise Linux Server release 7.1 (Maipo)[root@localhost ~]# uname -aLinux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Thu Jan 29 18:37:38 EST 2015 x86_64 x86_64 x86_64 GNU/Linux

==================================== Okay, install the LAMP Architecture

1. To facilitate application installation, first configure the YUM service. By default, the RedHat YUM has been installed. Now we can directly configure the YUM local source and the network source.

[Root @ localhost ~] # Mount/dev/cdrom/mnt/cdrom
Mount:/dev/sr0 is write-protected, mounting read-only

2. Check whether yum is installed. (The following indicates that yum is installed)

[Root @ localhost ~] # Rpm-qa | grep yum *
Yum-metadata-parser-1.1.4-10.el7.x86_64
Yum-3.4.3-125.el7.noarch
Yum-rhn-plugin-2.0.1-5.el7.noarch
Keyutils-libs-1.5.8-3.el7.x86_64
Python-pyudev-0.15-6.el7.noarch

3. Configure the local and Network Sources of yum;

[Root @ localhost yum. repos. d] # create a backup folder

[Root @ localhost yum. repos. d] # Back Up Files in the mv * repobak yum. repos. d folder to repobak

[Root @ localhost yum. repos. d] # vi zabbix. repo creates a zabbix. repo YUM source file and adds the following:

================= Zabbix. repo file ==================================

[Zabbix]
Name = Zabbix Official Repository-$ basearch
Baseurl = http://repo.zabbix.com/zabbix/3.2/rhel/7/?basearch/
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[Zabbix-non-supported]
Name = Zabbix Official Repository non-supported-$ basearch
Baseurl = http://repo.zabbix.com/non-supported/rhel/7/?basearch/
Enabled = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
Gpgcheck = 1
[Waiwang]
Name = waiwang
Base url = http://mirrors.163.com/centos/7/ OS /x86_64/
Enabled = 1
Gpgcheck = 0
[Extras]
Name = extras
Base url = http://mirrors.163.com/centos/7/extras/x86_64/
Enabled = 1
Gpgcheck = 0

========================== END ============================= =====

4. Clear the YUM cache file

[Root @ localhost ~] # Yum clean all
Loaded plugins: product-id, subcomponent-manager
This system is not registered to Red Hat sub‑management. You can use sub‑manager to register.
Cleaning repos: extras waiwang zabbix-non-supported
Cleaning up everything

5. Create a YUM cache file

[Root @ localhost ~] # Yum makecache
Loaded plugins: product-id, subcomponent-manager
This system is not registered to Red Hat sub‑management. You can use sub‑manager to register.
Extras | 3.4 kB: 00
Waiwang | 3.6 kB: 00
Zabbix | 951 B
Zabbix-non-supported | 951 B: 00
(1/8): extras/prestodelta | 99 kB
(2/8): extras/primary_db | 151 kB
(3/8): waiwang/group_gz | 155 kB
(4/8): extras/other_db | 640 kB
(5/8): extras/filelists_db | 770 kB
(6/8): waiwang/filelists_db | 6.6 MB
(7/8): waiwang/other_db | 2.4 MB
(8/8): waiwang/primary_db | 5.6 MB
(1/6): zabbix/x86_64/primary | 13 kB
(2/6): zabbix/x86_64/filelists | 43 kB: 00
(3/6): zabbix/x86_64/other | 7.7 kB
(4/6): zabbix-non-supported/x86_64/filelists | 660 B
(5/6): zabbix-non-supported/x86_64/primary | 1.6 kB
(6/6): zabbix-non-supported/x86_64/other | 1.5 kB
Zabbian 92/92
Zabbian 92/92
Zabbian 92/92
Zabbix-non-supported 4/4
Zabbix-non-supported 4/4
Zabbix-non-supported 4/4
Metadata Cache Created

6. [root @ localhost ~] # Yum list: You can view the list of files obtained by YUM.

7. Disable firewall :( vi/etc/selinux /)

[Root @ localhost ~] # Systemctl stop firewalld. service # stop firewall

[Root @ localhost ~] # Systemctl disable firewalld. service # disable firewall startup

[Root @ localhost ~] # Change selinux = enforcing to selinux = disabled in vi/etc/selinux/config.

[Root @ localhost ~] # Sestatus view selinux status

 

============================================================== Deadline the YUM environment has been prepared ========================

1. Start installing the LAMP Architecture

1. install Apache

[Root @ localhost ~] # Yum install httpd # Enter Y as prompted to install httpd.

[Root @ localhost ~] # Systemctl start httpd. service # start apache

[Root @ localhost ~] # Systemctl stop httpd. service # stop apache

[Root @ localhost ~] # Systemctl restart httpd. service # restart apache

[Root @ localhost ~] # Systemctl enable httpd. service # Set apache startup

2. Install MariaDB

In RHEL 7.0, MariaDB has been used to replace the MySQL database.

2.1 install MariaDB

[Root @ localhost ~] # Yum install mariadb-server # ask if you want to install mariadb. Enter Y to install mariadb automatically until the installation is complete.

[Root @ localhost ~] # Systemctl start mariadb. service # start MariaDB

[Root @ localhost ~] # Systemctl stop mariadb. service # stop MariaDB

[Root @ localhost ~] # Systemctl restart mariadb. service # restart MariaDB

[Root @ localhost ~] # Systemctl enable mariadb. service # Set startup

3. install PHP

[Root @ localhost ~] # Yum install php # Enter Y as prompted until installation is complete

4. Install the PHP component so that PHP supports MariaDB

[Root @ localhost ~] # Yum install php-mysql php-gd libjpeg * php-ldap php-odbc php-pear php-xml php-xmlrpc php-mhash

# Select the preceding installation package for installation. Enter Y and press enter as prompted.

[Root @ localhost ~] # Systemctl restart mariadb. service # restart MariaDB

[Root @ localhost ~] # Systemctl restart httpd. service # restart apache

5. Restart the service

[Root @ localhost ~] # Systemctl restart mariadb. service # restart MariaDB

[Root @ localhost ~] # Systemctl restart httpd. service # restart apache

6. log on to http: // localhost to test whether the httpd service is normal.

==================================== The LAMP architecture has been built ======================================

Ii. zabbix service installation and configuration

1. Install the repository configuration file [root @ localhost ~] # Rpm-ivh restart ~] # Yum install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-agent to install zabbix. Click "y" to complete the installation. [Root @ localhost ~] # Rpm-ql zabbix-server-mysql verify the Installation File

/Etc/logrotate. d/zabbix-server
/Etc/zabbix/zabbix_server.conf
/Usr/lib/systemd/system/zabbix-server.service
/Usr/lib/tmpfiles. d/zabbix-server.conf
/Usr/lib/zabbix/alertscripts
/Usr/lib/zabbix/externalscripts
/Usr/sbin/zabbix_server_mysql
/Usr/share/doc/zabbix-server-mysql-3.2.5
/Usr/share/doc/zabbix-server-mysql-3.2.5/AUTHORS
/Usr/share/doc/zabbix-server-mysql-3.2.5/COPYING
/Usr/share/doc/zabbix-server-mysql-3.2.5/ChangeLog
/Usr/share/doc/zabbix-server-mysql-3.2.5/NEWS
/Usr/share/doc/zabbix-server-mysql-3.2.5/README
/Usr/share/doc/zabbix-server-mysql-3.2.5/create. SQL .gz
/Usr/share/man/man8/zabbix_server.8.gz
/Var/log/zabbix
/Var/run/zabbix

3. initialize the mariadb database [root @ localhost ~] # Mysql-u root

 

4. Import zabbix initial mode and Data

[Root @ localhost ~] # Zcat/usr/share/doc/zabbix-server-mysql-3.2.1/create. SQL .gz | mysql-uroot zabbix [root @ localhost ~] # Mysql-u root verify whether the data has been imported successfully

MariaDB [zabbix]> use zabbix;

Database changed
MariaDB [zabbix]> show tables;
+ ---------------------------- +
| Tables_in_zabbix |
+ ---------------------------- +
| Acknowledges |
| Actions |
| Alerts |
| Application_discovery |
| Application_prototype |
| Application_template |
| Applications |
| Auditlog |

5. Configure the zabbix configuration file and change the Database Password to zabbix.

[Root @ localhost ~] # Vi/etc/zabbix/zabbix_server.confDBPassword = zabbix 6. configure the Http configuration file and change the time zone to Asia and Shanghai # vi/etc/httpd/conf. d/zabbix. confphp_value date. timezone Asia/Shanghai 7. start zabbix-server and set auto start # systemctl start zabbix-server # systemctl enable zabbix-server. Note: ① if zabbixserver cannot be started, install the trousers support package. # Yum install trousers ② If a pid error is reported, perform soft connection/var/run>/run # ln-s/var/run 8. start http and set auto start # systemctl start httpd # systemctl enable httpd 9. start zabbix-agent and set the auto-start # systemctl start zabbix-agent # systemctl enable zabbix-agent 10. Use IE to log on to the zabbix graphic interface and set it. Address: http: // 192.168.1. */zabbix/(zabbix Server IP) Account: admin Password: zabbix 11. zabbix graphical interface configuration. There are many graphical interfaces configured on the Internet. You can query them by yourself. This is omitted here ..........

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.