In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Zabbix monitoring deployment scenario
Objective:
Build a monitoring environment for the data center
Initialize the system auto-talk script init.sh
Deployment of LAMP environment
To install the compilation environment, install lamp or lnmp using an one-click installation script
# Note: when using the script, you should pay attention to whether the software link is invalid or not, so as to avoid installation failure.
Lamp Security and Optimization:
1. Configure disable_function to disable some functions
Disable_functions = eval,assert,popen,passthru,escapeshellarg,escapeshellcmd,passthru,exec,system,chroot,scandir,chgrp,chown,escapeshellcmd,escapeshellarg,shell_exec,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,leak,popepassthru,stream_socket_server,popen,proc_open,proc_close
2.Mysql configuration
Turn on each tablespace
Login:
# / usr/local/mysql/bin/mysql-S / data/mysql/mysql.sock
Mysql > use mysql
Mysql > update user set password=password ('123456') where user = 'root'
Mysql > flush privileges
/ usr/local/mysql/bin/mysql-uroot-p123456-S / data/mysql/mysql.sock
Download address of Zabbix:
Wget http://ncu.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.4/zabbix-3.0.4.tar.gz
Create and import zabbix database
Mysql > create database zabbix character set utf8
Grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; # create zabbix user
Flush privileges; # refresh the system authorization table again
Use zabbix # enter the database
Select database (); # View the current database
Source / usr/local/src/zabbix-3.0.4/database/mysql/schema.sql # Import script file to zabbix database
Source / usr/local/src/zabbix-3.0.4/database/mysql/p_w_picpaths.sql # Import script file to zabbix database
Source / usr/local/src/zabbix-3.0.4/database/mysql/data.sql # Import script file to zabbix database
Note: please import in the above order, otherwise you will make an error.
Install zabbix
1. Add users:
Because secure zabbix can only be run by ordinary users
Groupadd zabbix # create user group zabbix
Useradd-M zabbix-s / sbin/nologin
Useradd zabbix-g zabbix-s / bin/false # create the user zabbix and add the user zabbix to the user group zabbix
Cd / usr/local/src/zabbix-3.0.4/ # enter the installation directory
/ configure-- prefix=/usr/local/zabbix-- enable-server-- enable-agent-- with-net-snmp-- with-libcurl-- enable-proxy-- with-mysql=/usr/bin/mysql_config
-- enable-java # supports jmx to monitor java processes
Make # compilation
Make install # installation
Description: find /-name mysql_config search location. If there is no mysql_config, you need to install yum install mysql-devel.
Modify zabbix configuration file
Cd / usr/local/zabbix/etc
Vi etc/zabbix_server.conf
DBName=zabbix # Database name
DBUser=zabbix # Database user name
DBPassword=123456 # database password
ListenIP=127.0.0.1 # Database ip address
AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts # zabbix run script storage directory
: wq! # Save exit
Vi / home/sxit/zabbix/etc/zabbix_agentd.conf
Include=/home/sxit/zabbix/etc/zabbix_agentd.conf.d/
UnsafeUserParameters=1 # enable custom key
: wq! # Save exit
6. Add boot script
Cp / usr/local/src/zabbix-3.0.4/misc/init.d/fedora/core/zabbix_server / etc/init.d/zabbix_server # server
Cp / usr/local/src/zabbix-3.0.4/misc/init.d/fedora/core/zabbix_agentd / etc/init.d/zabbix_agentd # client
Chmod + x / etc/init.d/zabbix_server # add script execution permissions
Chmod + x / etc/init.d/zabbix_agentd # add script execution permissions
Chkconfig zabbix_server on # add Boot Boot
Chkconfig zabbix_agentd on # add Boot Boot
Modify the zabbix installation directory in the zabbix boot script
Vi / etc/rc.d/init.d/zabbix_server # Editing server configuration file
BASEDIR=/home/sxit/zabbix/ # zabbix installation directory
: wq! # Save exit
Vi / etc/init.d/zabbix_agentd # Editing client profile
BASEDIR=/home/sxit/zabbix/ # zabbix installation directory
: wq! # Save exit
3. Configure web site
Cd / home/sxit/zabbix-3.0.3
Cp-r / usr/local/src/zabbix-3.0.4/frontends/php / usr/local/apache/htdoc/zabbix
Chown daemon.daemon-R / usr/local/apache/htdoc/zabbix
Note: / home/sxit/apache/htdoc/ is apache default site directory daemon is apache running account
Service zabbix_server start # start the zabbix server
Service zabbix_agentd start # start the zabbix client
4. Modify php configuration file parameters
1. Vi / etc/php.ini # Editing and modifying
Post_max_size = 16m
Max_execution_time = 300
Max_input_time = 300
: wq! # Save exit
PHP databases supportoffFail
Php databases support off fail is missing mysqli after query.
Install mysqli
The module needs to be compiled in the php source code and then loaded
/ usr/local/php/bin/phpize
. / configure-- prefix=/usr/local/php/mysqli\
-- with-php-config=/usr/local/php/bin/php-config\
-- with-mysqli=/usr/bin/mysql_config
Make & & make install
Installing shared extensions: / usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Installing header files: / usr/local/php/include/php/
Edit php.ini
# vi etc/php.ini
Add a line at the end:
Extension= / usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/mysqli.so
Restart the http service
Note: this may return: / usr/local/src/php-5.6.6/ext/mysqli/mysqli_api.c:36:47: error: ext/mysqlnd/mysql_float_to_double.h: No such file or directory
Direct modification: the path of line 36 of mysqli/mysqli_api.c file is absolute
Include "/ usr/local/src/php-5.6.6/ext/mysqlnd/mysql_float_to_double.h"
PHP gettextoffWarning
Manually compile and install the gettext module
Cd / usr/local/src/php-5.6.6/ext/gettext
# / usr/local/php/bin/phpize
#. / configure-with-php-config=/usr/local/php/bin/php-config
# make & & make install
After installation, an informational prompt similar to this is generated:
Installing shared extensions: / usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Edit php.ini
# vi etc/php.ini
Add a line at the end:
Extension= / usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/gettext.so
Restart the http service
Question:
Zabbix server is runningNo10.0.8.153:10051
Zabbix server is not running:the information displayed may not be current
1. Look for allow_url_fopen = On in the php.ini file
Let your php support opensll extensions
/ usr/local/php/bin/phpize
. / configure-with-openssl-with-php-config=/usr/local/php/bin/php-config
Installing shared extensions: / usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Add a line at the end:
Extension= / usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/openssl.so
2. Just turn on the fsockopen function
Disable_function, remove pfsockopen.
5. Install web
Open in the browser:
Http://10.0.8.153/zabbix/setup.php
Login:
Default user name: Admin
Password: zabbix
Zabbix agent installation:
. / configure-prefix=/usr/local/zabbix_agent-enable-agent
Make & & make install
Cp / usr/local/src/zabbix-3.0.4/misc/init.d/fedora/core/zabbix_agentd / etc/init.d/zabbix_agentd # client
Chmod + x / etc/init.d/zabbix_agentd
Chkconfig zabbix_agentd on
Modify the installation directory: vim / etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix_agent/
Zabbix client configuration
Configure the zabbix_server configuration file under the zabbix source directory
# vim / usr/local/zabbix_agent/etc/zabbix_agentd.conf
Server=127.0.0.1 (note that the above client needs to be modified to the IP address of the monitor)
ServerActive=127.0.0.1 (note that the above client needs to be modified to the IP address of the monitor)
Hostname=Zabbix server (the name here needs to be the same as that configured on the monitor)
Both Server and ServerActive specify the IP address of zabbixserver, but the difference is that the former is passive and the latter is active. In other words, the configuration of Server is used to allow 127.0.0.1 this ip to come to me to get data. ServerActive 127.0.0.1 means that the client actively submits data to him. Do you get it? Why should there be a distinction between active and passive? We will discuss this issue later!
Zabbix agent detection can be divided into two forms: active (agent active) and passive (agent). Both active and passive are discussed relative to agent. Briefly explain the difference between active and passive as follows:
Initiative: agent requests server to obtain a list of active monitoring items, and actively submits the data to be detected in the monitoring items to server/proxy
Passive: server requests agent to obtain data of monitoring items, and agent returns data.
Active configuration: monitoring clients actively send data
Server 192.168.18.223 ip (server side)
ServerActive 192.168.18.223 10051 monitor side ip: Port
Hostname=Zabbix server (the name here needs to be the same as that configured on the monitor)
Passive configuration: monitoring server actively collects data
Server 192.168.18.223 ip (server side)
ServerActive 192.168.18.22x:10050 monitored end ip: Port
Hostname=192.168.18.22x (the name here needs to be the same as that configured on the monitor)
Test, the following command needs to be executed on the server side, where 10.0.8.152 is the ip of agent
# / usr/local/zabbix/bin/zabbix_get-s 10.0.8.152-p10050-k "system.host"
11163875
# / usr/local/zabbix/bin/zabbix_get-s 10.0.8.152-p10050-k "system.hostname"
HOSTNAME
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.