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 build memcached by Zabbix

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

Share

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

This article mainly explains "how to build memcached with Zabbix". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "Zabbix how to build memcached"!

First, environmental preparation (here the test environment is)

Zabbix-server.3.2.11

Zabbix_agentd (centos7.0

II. Deploy memcached

1. What is memcached?

Memcached is a distributed caching system developed by LiveJournal's Brad Fitzpatrick and released under BSD license license.

It is a simple key-value storage system.

The purpose of general use is to reduce the number of database visits by caching database query results, so as to improve the speed and scalability of dynamic Web applications.

2. Set up and install memcached

# yum install-y memcached

3. Enable memcached

# / usr/bin/memcached-b-l 127.0.0.1-p

11211-m 150-u root

[remarks]

-b daemon mode (keeps the program running after exiting the terminal window)

-l specify IP address 127.0.0.1

-p specifies the port number 11211

-m how much memory is allocated for memcached (in M)

-u specify which user to use to start memcached

4. View memcached status

Ps-ef | grep memcached

[remarks] if you can see the existence of a memcached process, it means that the memcached server has been installed successfully

3. Zabbix monitors memcached

1. Add a memcached script to the agentd server

# cd / usr/local/zabbix/scripts

# vim memcached-status.sh

#! / bin/bash

Item=$1

Ip=127.0.0.1

Port=11211

(echo "stats"; sleep 0.5) | telnet $ip $port 2 > / dev/null | grep "STAT $item\ b" | awk'{print $3}'

[important note] telnet must be installed on the agent server, but yum install-y telnet must not be installed, otherwise the following zabbix monitoring will not get the data.

2. Add execution permissions to the memcached script

Chmod axix memcached-status.sh

3. Modify the zabbix_agentd.conf, add the following at the end, and save the exit

# vi / usr/local/zabbix/etc/zabbix_agentd.conf

Add the following

UserParameter=memcached.stat,/usr/local/zabbix/scripts/memcached-status.sh

4. Restart zabbix_agentd

Service zabbix_agentd restart

5. Zabbix-web background interface configuration

Select configure, select template, select Import, import memcache template

Finally, select the memcache template on the host of memcached

At this point, I believe you have a deeper understanding of "Zabbix how to build memcached". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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