Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zabbix- finishing

2025-02-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Premise: LAMP or LNMP environment

Attachment 1: personal blog, which can be accessed by intranet

1. Basic component installation / / maridb,php,curl,net-snmp,perl-DBI

Yum install php php-gd php-mysql php-bcmath php-mbstring php-xml curl curl-devel net-snmp net-snmp-devel perl-DBI

Yum install httpd mariadb*

Use 163net easy source: http://mirrors.163.com/.help/CentOS7-Base-163.repo

/ / otherwise, the installation prompt will be prompted, and the check will not pass when installing zabbix.

two。 Database configuration:

Systemctl start mariadb.service

Chkconfig mariadb on

MariaDB [(none)] > create database zabbix character set utf8

# # create a database zabbix and use utf8 for database coding

MariaDB [(none)] > insert into mysql.user (Host,User,Password) values ('localhost','zabbix',password (' zabbix'))

# # create an account zabbix. It is recommended to insert 127.0.0.1 host with password zabbix / /.

MariaDB [(none)] > flush privileges; # # refresh system authorization

MariaDB [(none)] > grant all on zabbix.* to 'zabbix'@'127.0.0.1' identified by' zabbix' with grant option

# # allow the account to connect to the database zabbix locally

MariaDB [(none)] > flush privileges

3.zabbix installation

Wget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.5/zabbix-2.4.5.tar.gz

Tar-zxvf zabbix-2.4.5.tar.gz

Cd zabbix-2.4.5

/ configure-- with-mysql=/usr/bin/mysql_config-- with-net-snmp-- with-libcurl-- enable-server-- enable-agent-- enable-proxy-- prefix=/usr/local/zabbix

/ / parameters

-- enable-agent / / as an agent

-- with-mysql / / use mysql

-- with-ssh3 / / based on ssh

-- prefix---- > specify the zabbix installation directory

-- enable-server---- > supports zabbix server

-- enable-agent---- > supports zabbix proxy

-- enable-proxy---- > supports zabbix proxy server

-- with-libcurl---- > use the curl package

-- with-net-snmp---- > use the net-snmp package to selectively specify the path NET-SNMP configuration

-- with-mysql=/usr/bin/mysql_config can choose to specify a path mysql_config using the MySQL client library

Make & & make install

4.zabbix configuration:

1. Import the database:

# mysql-u root-p

MariaDB [(none)] > use zabbix

MariaDB [zabbix] > source / root/zabbix-2.4.5/database/mysql/schema.sql

MariaDB [zabbix] > source / root/zabbix-2.4.5/database/mysql/data.sql

MariaDB [zabbix] > source / root/zabbix-2.4.5/database/mysql/p_w_picpaths.sql

MariaDB [zabbix] > quit

/ / Import in order, otherwise errors may occur

two。 Add server-side port / / No change is required

Zabbix-agent 10050/tcp # Zabbix Agent / / client

Zabbix-agent 10050/udp # Zabbix Agent

Zabbix-trapper 10051/tcp # Zabbix Trapper / / server

Zabbix-trapper 10051/udp # Zabbix Trapper

3. Copy the Xanguan configuration file to / etc and make relevant configuration modifications

[root@localhost] # mkdir-p / etc/zabbix

[root@localhost] # cp-r zabbix-2.4.5/conf/* / etc/zabbix/

[root@localhost ~] # useradd zabbix

[root@localhost] # chown-R zabbix:zabbix / etc/zabbix

[root@localhost] # ln-s / usr/local/zabbix/etc / etc/zabbix/

[root@localhost] # ln-s / usr/local/zabbix/bin/* / usr/bin/

[root@localhost] # ln-s / usr/local/zabbix/sbin/* / usr/sbin/

A) modify zabbix_server.conf

Vi / etc/zabbix/zabbix_server.conf / / is modified as follows

[root@localhost ~] # cat / etc/zabbix/zabbix_server.conf | grep-n ^ [^ #]

30:LogFile=/tmp/zabbix_server.log # # Log file address

68:DBHost=localhost # # Database host

78:DBName=zabbix # # Database name

94:DBUser=zabbix # # Database user name

102:DBPassword=zabbix # # Database password

282:ListenIP=127.0.0.1 # # Database IP address

425:AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts # # directory where zabbix running scripts are stored

B) modify zabbix_agentd.conf

Vi / etc/zabbix/zabbix_agentd.conf

[root@localhost ~] # cat / etc/zabbix/zabbix_agentd.conf | grep-n ^ [^ #]

11:PidFile=/tmp/zabbix_agentd.pid # # process PID

21:LogFile=/tmp/zabbix_agentd.log # # Log location

59:EnableRemoteCommands=1 # # allow remote command execution

81:Server=127.0.0.1 # # ip on the agent side

122:ServerActive=127.0.0.1

133:Hostname=Zabbix server # # must be the same as the hostname created by zabbix

252:Include=/usr/local/etc/zabbix_agentd.conf.d/

265:UnsafeUserParameters=1 # # launch a custom key

5. Modify the parameters related to php:

# vi / etc/php.ini

384 max_execution_time = 300

394 max_input_time = 300

405 memory_limit = 128m

800 upload_max_filesize = 2m

878 date.timezone = Asia/Shanghai

672 post_max_size = 28m

6. Configure the web site

Cp-r.. / zabbix-2.4.5/frontends/php / var/www/html/zabbix

Modify the httpd.conf parameters:

Vim / etc/httpd/conf/httpd.conf

DirectoryIndex index.html index.php

Temporarily shut down selinux

Setenforce 0

Vim / etc/selinux/config

SELINUX=disabled

/ / restart takes effect

7.systemctl start httpd.service

Enter http://127.0.0.1/zabbix in the browser to enter the web configuration page of zabbix = "

Error:

PHP bcmatch error

PHP mbstring gross error / / failed detection / / use NetEase source, installation can be realized

Configure DB configuretion / / configure DB database

User zabbix

Host 127.0.0.1

Password zabbix

Zabbix server details

"Download configuration file

Save the downloaded zabbix.conf.php to

/ var/www/html/zabbix/conf/, click the "Retry" button to try again

Click finished:

The default account for Zabbix is admin, and the password is zabbix.

Zabbix is English by default, change language = "Profile"

8. Add a boot script:

# cd zabbix-2.4.5/

# cp misc/init.d/fedora/core5/zabbix_server / etc/rc.d/init.d/zabbix_server

# cp misc/init.d/fedora/core5/zabbix_agentd / etc/rc.d/init.d/zabbix_agentd

# chmod uplix / etc/rc.d/init.d/ {zabbix_server,zabbix_agentd}

# chkconfig zabbix_server on

# chkconfig zabbix_agentd on

# / usr/local/zabbix/sbin/zabbix_server start

Attach 1://zabbix monitoring personal blog

1. Authorize zabbix, log in

Create database wordpress; / / create a library

INSERT INTO user (User, Host, Password) VALUES ('zabbix','%', Password ('zabbix'))

Grant all on wordpress.* to 'zabbix'@'127.0.0.1' identified by' zabbix' with grant option

/ / mariadb uses% instead of *

Flush privileges

/ / set password

Mysqladmin-u root-p password root

Insert into mysql.user (Host,User,Password) values ("localhost", "admin", password ("admin"))

two。 Install wordpress

Wget https://cn.wordpress.org/wordpress-4.5.3-zh_CN.zip

Unzip wordpress-4.5.3-zh_CN.zip

Mkdir / var/www/wordpress

Cp-r wordpress/* / var/www/html/

Cd / var/www/html/wordpress/

Cp wp-config-sample.php wp-config.php / / copy configuration file

Vim wp-config.php / / Edit the configuration file for wordpress

/ * * name of WordPress database * /

Define ('DB_NAME',' wordpress')

/ * * MySQL database user name * /

Define ('DB_USER',' zabbix')

/ * * MySQL database password * /

Define ('DB_PASSWORD',' zabbix')

/ * * MySQL host * /

Define ('DB_HOST',' localhost')

3. Database configuration

Service httpd restart

There is a problem with zabbix accessing the database.

/ / when accessing the database, you must have a record in the user table.

Other:

Station name: only black and white in the dream

Admin wordpress@ ^ _ ^

Vim wp-config.php

Define ('WP_ALLOW_REPAIR', true); / / add a line

/ / Snapshot immediately after word press installation is completed

4. If joining is not the same host

On agentd, vim / etc/

Summary:

1.yum install php,maridb,httpd and other packages / / configure 163feeds

two。 Database configuration, user, authorization

3.zabbix installation

4. Import zabbiix library files

5. Create configuration files to zabbix_server.conf and zabbix_agentd.conf

6. Modify php related parameters

7. Install zabbix and provide startup scripts

8. Install wordpress

Create libraries, modify configuration files

Annex 1: monitoring mysql / /

1. Set up mysql host groups group

Enter the zabbix web backend

Configuration-- > Hosts groups-- > Click "Create host group"-- > Select the template tab

Select the template "Template App MySQL,Templdate OS Linux", {move to the left} and then click update

two。 Establish hosts

Zabbix web backend, configuration-- > hosts-- > Click your host name-- > Select template Select

Tab, select the template "Template App MySQL", finally click the "Add" button on the left, and finally click the "update" button.

Configuration-- > templates-- > link templates / / add {template App MySQL and OS Linux}

3Perminrpm deploy agent client / / operate on agent

Groupadd zabbix

Useradd zabbix-g zabbix-s / sbin/nologin

Wget http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-agent-3.0.0-2.el6.x86_64.rpm

Rpm-ivh zabbix-agent-3.0.0-2.el6.x86_64.rpm

# error reporting solution:

Yum-y install unixODBC

/ usr/sbin/zabbix_agentd-c / etc/zabbix/zabbix_agentd.conf

Chkconfig-add zabbix_agentd

Summary of monitoring mysql: specific implementation, which is different from attachment

1minute configuration, host editing on a stand-alone machine

2.templates, associated template, mysql template

3. Create screen,configuration-- > screen add

Graph name:select is selected to create

Lab 1: monitoring httpd

Http://www.cnblogs.com/zzzhfo/p/5884795.html

201:word press: zabbix server

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report