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

How to use Zabbix to monitor PHP-FPM, Tomcat and Redis

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

What this article shares with you is to use Zabbix to monitor PHP-FPM, Tomcat and Redis. I believe most people have not yet learned this skill. In order to let you learn, I have summarized the following content. Without saying much, let's read on.

First, Zabbix monitoring PHP-FPM applications

Nginx+PHP-FPM is the most popular LNMP architecture at present. Under the system based on PHP development, the monitoring of the performance of these systems is mainly concerned about the running status of PHP-FPM, so what is PHP-FPM? PHP-FPM is a PHP FastCGI manager, it provides a better way of PHP process management, can effectively control memory and processes, can smoothly reload PHP configuration, for PHP before ZPHP5.3.3, it is a patch package, and since the PHP5.3.3 version, PHP has been integrated with the php-fpm module, which means it has been officially included by PHP. When compiling PHP, you need to specify the parameter "--enable-fpm" to turn on PHP-FPM.

1) enable the php-fpm status feature

Do the following:

1) install nginx [root @ agent ~] # yum-y install zlib pcre pcre-devel openssl openssl-devel [root@agent ~] # wget http://nginx.org/download/nginx-1.14.1.tar.gz[root@agent ~] # tar zxf nginx-1.14.1.tar.gz-C / usr/src [root@agent ~] # cd / usr/src/nginx-1.14.1/ [root@agent nginx-1.14.1] #. / configure-- Prefix=/usr/local/nginx-- user=www-- group=www\ >-- with-http_stub_status_module-- with-http_ssl_module-- with-pcre\ >-- with-http_gzip_static_module & & make & & make install [root@agent nginx-1.14.1] # ln-s / usr/local/nginx/sbin/nginx / usr/local/sbin2) install php [root @ agent ~] # yum-y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype -devel libxml2 libxml2-devel zlib zlib-devel curl curl-devel openssl openssl-devel openldap openldap-devel [root@agent ~] # wget https://www.php.net/distributions/php-7.2.3.tar.gz[root@agent ~] # useradd-s / sbin/nologin www [root@agent ~] # tar zxf php-7.2.3.tar.gz-C / usr/src [root@agent ~] # cd / usr/src/php-7.2.3/ [root @ agent php-7.2.3] #. / configure-- prefix=/usr/local/php7-- with-fpm-user=www-- with-fpm-group=www & & make & & make install [root@agent php-7.2.3] # ln-s / usr/local/nginx/sbin/nginx / usr/local/sbin [root@agent php-7.2.3] # cp php.ini-production / usr/local/php7/lib/php.ini [root@agent php -7.2.3] # cp sapi/fpm/php-fpm.service / usr/lib/systemd/system/ [root@agent php-7.2.3] # vim / usr/local/php7/lib/php.ini post_max_size = 16Mmax_execution_time = 300memory_limit = 128Mmax_input_time = 300date.timezone = Asia/Shanghai [root@agent php-7.2.3] # vim / usr/local/nginx/conf/nginx.conf location ~\ .php$ { Root html Fastcgi_pass 127.0.0.1 fastcgi_pass 9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME / usr/local/nginx/html$fastcgi_script_name; include fastcgi_params } [root@agent php-7.2.3] # nginx-t [root@agent php-7.2.3] # cd / usr/local/php7/etc/ [root@agent etc] # cp php-fpm.conf.default php-fpm.conf [root@agent etc] # cp php-fpm.d/www.conf.default php-fpm.d/www.conf [root@agent etc] # vim php-fpm.d/ www.confu [www] user = wwwgroup = wwwlisten = 127, .0.0.1: 9000pm = dynamicpm.max_children = 300pm.start_servers = 20pm.min_spare_servers = 5pm.max_spare_servers = 35pm.status_path = / status [root@agent etc] # nginx [root@agent etc] # systemctl daemon-reload [root@agent etc] # systemctl start php-fpm [root@agent etc] # ss-lnt | grep 9000LISTEN 0 128 127.0.1 Phantom 9000 *: * [root@agent etc] # ss-lnt | modified parameters in grep 80LISTEN 0128 *: 80 *: * / usr/local/php7/etc/php-fpm.d/www.conf file: 1) user and group: used to set users and user groups running the phpf-pm process 2) listen: the IP address and port on which the php-fpm process is configured to listen. The default is 127.0.0.1 IP 9000. 3) pm: specify how to start processes in the php-fpm process pool. Two values are available: static (static) and dynamic (dynamic) dynamic (dynamic): indicates that the number of php-fpm processes is dynamic. At the beginning, it is the number specified by php.start_servers. If there are more requests, it will automatically increase to ensure that the number of idle processes is not less than pm.min_spare_servers. If there are more processes, it will be cleaned up accordingly. Ensure that there are only a small number of idle processes and pm.max_spare_servers Static (static): indicates that the number of php-fpm processes is static, and the number of processes is the number specified by pm.max_children from beginning to end, not increasing or decreasing; 4) pm.max_children = 300: indicates the number of fixed open php-fpm processes in static mode, and the maximum number of processes turned on php-fpm in dynamic mode; 5) pm.start_servers = 20: indicates the number of php-fpm processes initially opened in dynamic mode 6) pm.min_spare_servers = 5: indicates the minimum number of php-fpm processes opened in idle state in dynamic mode; 7) pm.max_spare_servers = 35: indicates the maximum number of php-fpm processes opened in idle state in dynamic mode, it should be noted that the value of pm.max_spare_servers can only be less than or equal to the value of pm.max_children; 8) pm.status_path = / status: indicates the path to configure the php-fpm running status page

When setting parameters, note: if pm is static, only the parameter pm.max_children will take effect, and the system will open a set number of php-fpm processes. If pm is dynamic, the system will start pm.start_servers php-fpm processes when php-fpm starts, and then dynamically adjust the number of php-fpm processes between pm.min_spare_servers and pm.max_spare_servers according to the needs of the system, up to a maximum of no more than the number set by pm.max_children.

Personal suggestion: servers with sufficient memory (more than 16G) are recommended to use static, and servers with less memory (less than 16G) are recommended to use dynamic.

2) nginx configuration php-fpm status page

After opening the status monitoring page of php-fpm, you need to add location rules to the nginx configuration file to achieve this. As follows:

[root@agent ~] # vim / usr/local/nginx/conf/nginx.conf// add the following location rule location ~ ^ / (status) ${fastcgi_pass 127.0.0.1 usr/local/nginx/conf/nginx.conf// 9000; fastcgi_param SCRIPT_FILENAME / usr/local/nginx/html$fastcgi_script_name; include fastcgi_params } [root@agent ~] # nginx-t [root@agent ~] # nginx-s reload3) php-fpm status page status

One of the more personalized aspects of the php-fpm status page is that it can have its own parameters, such as json, xml, htm. Using zabbix or nagios monitoring, you can consider using xml or the default method.

[root@agent ~] # curl http://127.0.0.1/status// View php-fpm status page information (default output) pool: wwwprocess manager: dynamicstart time: 01/Feb/2020:11:19:34 + 0800start since: 3235accepted conn: 1listen queue: 0max listen queue: 0listen queue len: 128idle processes: 19active processes: 1total processes: 20max active processes: 1max children reached: 0slow requests: 0 [root@agent ~] # curl http://127.0.0.1/status?xml / / display [root@agent ~] # curl http://127.0.0.1/status?json / / in json format in xml format

The meaning of the output parameters:

1) the name of the pool:php-fpm pool (resource pool), which in most cases is www

2) process manager: process management. Nowadays, most of them are dynamic. Do not use static.

3) start time: time when it was last started

4) start since: how many seconds have been running

5) accepted conn pool: number of requests received

6) listen queue: the number of connections waiting. If it is not 0, the number of php-fpm processes needs to be increased.

7) max listen queue: the maximum number of waiting connections since php-fpm was started

8) listen queue len: the size of the socket in the waiting queue for connection

9) idle processes: the number of processes that are idle

10) active processes: number of processes active

11) total processess: total number of processes

12) max active process: a maximum of several processes have been active since php-fpm was started

13) max children reached: when php-fpm tries to start more children processes, it reaches the limit of the number of processes, recording once at a time. If not 0, the maximum number of php-fpm pool processes needs to be increased.

14) slow requests: when php-fpm slow-log is enabled, this counter will increase if php-fpm slow requests occur, and this value will be triggered by improper Mysql queries.

4) add custom monitoring on the zabbix agent side

Monitoring php-fpm status is very simple and can be done with a single command without writing a script, as shown below:

[root@agent ~] # / usr/bin/curl-s "http://127.0.0.1/status?xml" | grep" | awk-F'> 'awk-F''{print $3}'17 [root@agent ~] # / usr/bin/curl-s "http://127.0.0.1/status?xml" | grep" | awk-F'> 'awk-F''{print $3} 'dynamic [root@agent ~] # / usr/bin/curl-s "http://127.0.0.1/status?xml" | grep" | awk-F'> 'awk-filtering''{print $3}'1 print / as long as the filtered value after the grep command is regarded as a variable In this way, you can get any value [root@agent ~] # vim / etc/zabbix/zabbix_agentd.d/userparameter_phpfpm.conf// template file for writing phpfpm, which is used to call phpfpm's monitoring script UserParameter=php-fpm.status [*], / usr/bin/curl-s "http://127.0.0.1/status?xml" | grep" | awk-F'> 'awk-fallow''{print $3}'/ / pay attention to this custom monitoring item. Define "php-fpm.status [*]". This "[*]" is the value provided by "$1". $1 is the input value, such as entering accepted-conn, then the key value of the monitoring item is php-fpm.status [accepted-conn]. In addition, the last "$$3" is because the commands are combined in variables, so use "$$", otherwise you can't get the data [root@agent ~] # systemctl restart php-fpm5) zabbix graphical interface import template

Zabbix does not have its own php-fpm monitoring template by default, so you need to write it yourself. Here we download the php-fpm template directly!

[root@agent ~] # wget https://www.ixdba.net/zabbix/zbx_php-fpm_templates.zip[root@agent ~] # unzip zbx_php-fpm_templates.zip [root@agent ~] # ll zbx_php-fpm_templates.xml-rw-r--r-- 1 root root 29138 November 8 2018 zbx_php-fpm_templates.xml// this is the template you need

As shown in the figure:

6) View php-fpm status data

As shown in the figure:

You can see from the picture that the data has been obtained!

Configuration php-fpm monitoring completed!

II. Practical practice of zabbix monitoring tomcat application

For some java applications using tomcat, when the application system is abnormal, we need to know the running status of tomcat and JVM to judge whether there is a problem with the program or system resources. At this time, the monitoring of tomcat is particularly important. The following is a detailed description of how to monitor the running status of tomcat instances through zabbix.

For zabbix to monitor tomcat, you first need to enable java poller on zabbix server, and you also need to start the zabbix_java process. After enabling zabbix_java, it is tantamount to opening a JavaGateway with port 10052. Finally, you need to open port 8888 on the Tomcat server to provide data output.

Therefore, zabbix monitors the tomcat data acquisition process, as shown in the figure:

1) install and configure Tomcat JMX [root@agent ~] # java-versionopenjdk version "1.8.0mm 161" OpenJDK Runtime Environment (build 1.8.0_161-b14) OpenJDK 64-Bit Server VM (build 25.161-b14) Mixed mode) [root@agent ~] # wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.50/bin/apache-tomcat-8.5.50.tar.gz[root@agent ~] # tar zxf apache-tomcat-8.5.50.tar.gz [root@agent ~] # mv apache-tomcat-8.5.50 / usr/local/tomcatsed-I '308a CATALINA_OPTS= "$CATALINA_OPTS-Dcom.sun.management.jmxremote-Dcom .sun.management.jmxremote.port = 8888-Dcom.sun.management.jmxremote.ssl=false-Djava.rmi.server.hostname=192.168.1.8-Dcom.sun.management.jmxremote.authenticate=flase "'/ usr/local/tomcat/bin/catalina.sh / / must ensure that the content is inserted in the following location (two # symbols) #-Execute The Requested Command-- -CATALINA_OPTS= "$CATALINA_OPTS-Dcom.sun.management.jmxremote-Dcom.sun.management.jmxremote.port=8888-Dcom.sun.management.jmxremote.ssl=false-Djava.rmi.server.hostname=192.168.1.8-Dcom.sun.management.jmxremote.authenticate=flase" # Bugzilla 37848: added by only output this if we have a TTY//: IP is the native IP of Tomcat Port "8888" can be customized without conflict! [root@agent ~] # / usr/local/tomcat/bin/startup.sh / / start the tomcat service [root@agent ~] # ss-lnt | grep 8080LISTEN 0 100: 8080: * [root@agent ~] # ss-lnt | grep 8888LISTEN 0 50: 8888:: : * 2) configure zabbix server Join java support

By default, zabbix server generally does not have java support, so in order for zabbix to monitor tomcat, you need to enable zabbix-java, a dedicated service for zabbix monitoring java.

Note that before enabling java monitoring support, JDK needs to be installed on the zabbix server server and JAVA_HOME needs to be set up so that the system can recognize the path to the jdk.

On the zabbix server server, to compile and install zabbix server, you need to add "--enable-java" to support jmx monitoring. If the previous zabbix server did not add this option at compile time, then you need to recompile the installation with the following compilation parameters:

. / configure-- prefix=/usr/local/zabbix-- with-mysql-- with-net-snmp-- with-libcurl-- enable-server-- enable-agent-- enable-proxy-- enable-java-- with-libxml2

If you do not want to recompile, you can also download the corresponding rpm package. This blog post is installed by downloading rpm.

[root@zabbix ~] # wget https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-java-gateway-4.0.0-2.el7.x86_64.rpm[root@zabbix ~] # rpm-ivh zabbix-java-gateway-4.0.0-2.el7.x86_64.rpm [root@zabbix ~] # / usr/sbin/zabbix_java_gateway [root@zabbix ~] # ss-lnt | grep 10052LISTEN 0 50:: 10052: * [root@zabbix ~] # vim / usr/local/zabbix/etc/zabbix_server.conf// modify the following content: JavaGateway=127.0.0.1JavaGatewayPort=10052StartJavaPollers=5 [root@zabbix ~] # / etc/init.d/zabbix_server restart3) Zabbix web page configuration JMX monitoring

Zabbix comes with tomcat monitoring template by default, but there is something wrong with the built-in template by default. It is recommended to download the tomcat template file at the following address.

[root@zabbix ~] # wget https://www.ixdba.net/zabbix/zbx_tomcat_templates.zip[root@zabbix ~] # unzip zbx_tomcat_templates.zip [root@zabbix ~] # ll zbx_tomcat_templates.xml-rw-r--r-- 1 root root 40030 November 9 2018 zbx_tomcat_templates.xml// this is the monitoring template file for tomcat

Next, start importing the template, as shown in the figure:

4) View the monitoring status of tomcat

As shown in the figure:

You can see from the picture that the data has been obtained!

Configuration tomcat monitoring completed!

III. Practical application of zabbix monitoring Redis instances

Redis has its own redis-cli client, and the running status of redis can be queried through the info command of redis, so the monitoring of redis by zabbix is to log in to redis through the client redis-cli, and then get the status data according to the info command. According to this idea, we can write a script, and then call the script by zabbix, so as to achieve the monitoring of redis.

1) install Redis [root @ agent ~] # wget http://download.redis.io/releases/redis-5.0.7.tar.gz[root@agent ~] # tar zxf redis-5.0.7.tar.gz [root@agent ~] # cd redis-5.0.7/ [root@agent redis-5.0.7] # make & & make install [root@agent redis-5.0.7] # cd utils/ [root@agent utils] #. / install_server.sh 2) use of the info command in redis

To get the current status of redis, you can log in to the redis command line through the reids-cli tool and view it through the info command.

Redis-cli command format:

Redis-cli-h [hostname or ip]-p [port]-a [password] info [parameters]

The commonly used and optional parameters are:

1) General information related to server:redis server

2) clients: information about client connection

3) memory: information about memory consumption

4) related information about persistence:RDB and AOF

5) stats: general statistics

6) replication: information related to master-slave replication

7) Statistics of cpu:CPU consumption

8) Statistics of the commandstas:redis command

9) Information about cluster:redis cluster

10) keyspace: database-related statistics

11) all: returns all server information

12) default: only the default information collection is returned

Examples are as follows:

[root@agent ~] # redis-cli-h 127.0.0.1-p 6379 info server// query the information of redis server # Serverredis_version:5.0.7redis_git_sha1:00000000redis_git_dirty:0redis_build_id:97e1d29a41ca6e28redis_mode:standaloneos:Linux 3.10.0-862.el7.x86_64 x86 examples 64archetypes of redis server redis server Portal 6379uptimekeeper Seconds:682uptime_in_days:0hz:10configured_hz:10lru_clock:3488956executable:/usr/local/bin/redis-serverconfig_file:/etc/redis/6379.conf

The meaning of each option of the output information is as follows:

1) version information of redis_version:redis server

2) redis_git_sha1:Git SHA1

3) redis_git_dirty:Git dirty flag

4) Host operating system of os:redis server

5) arch_bits: architecture (32 bit or 64 bit)

6) event handling mechanism used by multiplexing_api:redis

7) gcc_version: the version of GCC used when compiling reids

8) process_id: PID of the server process

9) Random identifier of the run_id:redis server (for Sentinel and clustering)

10) tcp_port:TCP/IP listening port

11) uptime_in_seconds: the number of seconds that have passed since the redis server was started

12) uptime_in_day: the number of days since the redis server started the dependency

13) lru_clock: a clock that increments itself in minutes for LRU management

[root@agent ~] # redis-cli-h 127.0.0.1-p 6379 info memory// query memory usage # Memoryused_memory:853304used_memory_human:833.30Kused_memory_rss:2699264used_memory_rss_human:2.57Mused_memory_peak:854320used_memory_peak_human:834.30Kused_memory_peak_perc:99.88%used_memory_overhead:841078used_memory_startup:791384used_memory_dataset:12226used_memory_dataset_perc:19.74 % allocator_allocated:1075920allocator_active:1413120allocator_resident:3993600total_system_memory:1910050816total_system_memory_human:1.78Gused_memory_lua:37888used_memory_lua_human:37.00Kused_memory_scripts:0used_memory_scripts_human:0Bnumber_of_cached_scripts:0maxmemory:0maxmemory_human:0Bmaxmemory_policy:noevictionallocator_frag_ratio:1.31allocator_frag_bytes:337200allocator_rss_ratio:2.83allocator_rss_bytes:2580480rss_overhead_ratio:0.68rss_overhead_bytes:- 1294336mem_fragmentation_ratio:3.41mem_fragmentation_bytes:1907864mem_not_counted_for_evict:0mem_replication_backlog:0mem_clients_slaves:0mem_clients_normal:49694mem_aof_buffer:0mem_allocator:jemalloc-5.1.0active_defrag_running:0lazyfree_pending_objects:0

The meaning of each option of the output:

1) used_memory: the total amount of memory allocated by the redis allocator in bytes

2) used_memory_human: returns the total amount of memory allocated by redis in a human-readable format

3) used_memory_rss: from the operating system's point of view, returns the total amount of memory allocated by redis (commonly known as resident set size). This value is consistent with the output of top, ps, etc.

4) Peak memory consumption of used_memory_peak:redis (in bytes)

5) used_memory_peak_human: returns the peak memory consumption of redis in a way that is easy for humans to understand

6) amount of memory used by the used_memory_lua:Lua engine (in bytes)

7) ratio between mem_fragmentation_ratio:used_memory_rss and used_memory

8) mem_allocator: the memory allocator used by redis specified at compile time. Libc, jemalloc, tcmalloc when available

[root@agent ~] # redis-cli-h 127.0.0.1-p 6379 info clients// query client connection # Clientsconnected_clients:1client_recent_max_input_buffer:0client_recent_max_output_buffer:0blocked_clients:0

The meaning of each option of the output:

1) connected_clients: number of connected clients (excluding clients connected through secondary servers)

2) client_recent_max_input_buffer: the maximum input cache among the currently connected clients

3) client_recent_max_output_buffer: the maximum output cache among the currently connected clients

4) client_recent_output_list: the largest output list among the currently connected clients

5) blocked_clients: the number of clients waiting for blocking commands (BLPOP, BRPOP, BRPOPLPUSH)

[root@agent ~] # redis-cli-h 127.0.0.1-p 6379 info cpu// View CPU usage # CPUused_cpu_sys:1.916430used_cpu_user:2.779592used_cpu_sys_children:0.000000used_cpu_user_children:0.000000

The meaning of each option of the output:

1) system CPU consumed by used_cpu_sys:redis server

2) user CPU consumed by used_cpu_use:redis server

3) used_cpu_sys_children: the system CPU consumed by the background process

4) used_cpu_user_children: the user CPU consumed by the background process

[root@agent ~] # redis-cli-h 127.0.0.1-p 6379 info Stats// query General Statistics # Statstotal_connections_received:8total_commands_processed:7instantaneous_ops_per_sec:0total_net_input_bytes:200total_net_output_bytes:8551instantaneous_input_kbps:0.00instantaneous_output_kbps:0.00rejected_connections:0sync_full:0sync_partial_ok:0sync_partial_err:0expired_keys:0expired_stale_perc:0.00expired _ time_cap_reached_count:0evicted_keys:0keyspace_hits:0keyspace_misses:0pubsub_channels:0pubsub_patterns:0latest_fork_usec:0migrate_cached_sockets:0slave_expires_tracked_keys:0active_defrag_hits:0active_defrag_misses:0active_defrag_key_hits:0active_defrag_key_misses:0

The meaning of each option of the output:

1) total_connections_received: the number of connection requests received by the server

2) total_commands_processed: the number of commands executed by the server

3) instantaneous_ops_per_sec: the number of commands executed by the server per second

4) rejected_connections: the number of connection requests rejected because of the maximum number of clients

5) expired_keys: the number of database keys that have been automatically deleted due to expiration

6) evicted_keys: the number of keys caught because of the maximum slave capacity limit

7) keyspace_hits: the number of times the database key was found successfully

8) keyspace_misses: the number of times it failed to find the database key

9) pubsub_channels: the number of channels currently subscribed

10) pubsub_patterns: the number of patterns currently subscribed

11) latest_fork_usec: the number of milliseconds spent on the last fork () operation

[root@agent ~] # redis-cli-h 127.0.0.1-p 6379 info Replication// query redis master / slave replication information # Replicationrole:masterconnected_slaves:0master_replid:b6c25ae1598c2460bb30e45139823e08ff5116a4master_replid2:0000000000000000000000000000000000000000master_repl_offset:0second_repl_offset:-1repl_backlog_active:0repl_backlog_size:1048576repl_backlog_first_byte_offset:0repl_backlog_histlen:0

The meaning of each option of the output:

1) role: if the current server is not replicating any server, the value of this domain is master;. Otherwise, the value of this domain is slave. Note that when creating a replication chain, one slave server may also be the master server of another server

2) connected_slaves: the number of Redis slaves connected

3) master_repl_offset: global replication offset

4) repl_backlog_active: a flag indicating whether the redis server enables replication backup log function for partial synchronization

5) repl_backlog_size: indicates the size of the backlog. Backlog is a buffer that stores the data to be synchronized to the slave when the slave is disconnected, so when a Slave wants to reconnect, it often does not need full synchronization, just perform local synchronization! The larger the backlog setting, the longer the slave can be lost.

6) repl_backlog_first_byte_offse: copy offset of the first byte of the backup log buffer

7) repl_backlog_histlen: the actual data length of the backup log

3) write scripts and templates to monitor the status of redis

There is a lot of script code, which can be downloaded in the following ways:

[root@agent ~] # wget https://www.ixdba.net/zabbix/zbx-redis-template.zip[root@agent ~] # unzip zbx-redis-template.zip [root@agent ~] # ll redis_status zbx-redis-template.xml-rw-r--r-- 1 root root 3968 November 11 2018 redis_status-rw-r--r-- 1 root root 46397 November 9 2018 zbx-redis-template.xml//redis_status: script to monitor redis status / / zbx-redis-template.xml: template file for monitoring redis status [root@agent ~] # mkdir / etc/zabbix/shell [root@agent ~] # mv redis_status / etc/zabbix/shell/ [root@agent ~] # chmod 755 / etc/zabbix/shell/redis_status [root@agent ~] # chown zabbix.zabbix / etc/zabbix/shell/redis_status / / delete / change the password fields used in the script by yourself reids-cli tool The storage path of [root@agent ~] # / etc/zabbix/shell/redis_status used_memory853304// test script is available. 4) modify the configuration on the zabbix agent side [root@agent ~] # vim / etc/zabbix/zabbix_agentd.d/userparameter_redis.confUserParameter=Redis.Info [*] / etc/zabbix/shell/redis_status $1 $2UserParameterial root@agent. Zabbix web zabbix web PONG import template via the zabbix web interface import template

As shown in the figure:

6) View the monitoring status of redis

As shown in the figure:

You can see from the picture that the data has been obtained!

Configuration reidst monitoring completed!

The above is the specific introduction of using Zabbix to monitor PHP-FPM, Tomcat and Redis, the content is more comprehensive, and I also believe that there are quite a few tools that we may see or use in our daily work. Through this article, I hope you can gain more.

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

Servers

Wechat

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

12
Report