Article Title: Use cacti to monitor memcache. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source. 
After we deploy memcache, it does not mean that we should monitor the memcahce status, memory usage, and the value of hit/miss, with cacti, we can monitor the various memcache parameters. Next we will learn how to use cacti to monitor our memcache!
 
First, we can learn how to add cacti and memcache monitoring from the official website! The address is as follows:
 
Http://dealnews.com/developers/cacti/memcached.html
 
Let's talk about the procedure in detail!
 
1. Python Client API Installation
 
Download Python Client API (download on cacti server)
 
Wget ftp://ftp.tummy.com/pub/python-memcached/python-memcached-1.45.tar.gz
 
Tar xzvf python-memcached-1.45.tar.gz
 
Python setup. py install
 
The following error occurs when I run the preceding command:
 
Traceback (most recent call last ):
 
File "setup. py", line 3, in?
 
From setuptools import setup
 
ImportError: No module named setuptools
 
Solution: yum-y install python-setuptools
 
After successful installation, you can install python setup. py install again.
 
2. Template Installation
 
Wget http://content.dealnews.com/dealnews/developers/cacti-memcached-1.0.tar.gz
 
Tar zxvf cacti-memcached-1.0.tar.gz
 
Cd cacti-memcached
 
Copy memcached. py to the Cacti scripts directory!
 
3. Set cacti
 
Go to the Cacti control page and click
 
Import Templates --> Import Template from Local File
 
In the browser, select the cacti_memcached_host_template.xml file and click save!
 
The rest is about adding new images.
 
4. The above settings are only for the default port 11211, but when your port is not 11211, but other ports, for example, my port is 12000, in this case, you need to make a small change to your cacti data source. The operation is as follows:
 
Console --- Data Input Methods -- Memcached? Statistics
 
Find the Input String value python  /Scripts/memcached. py  
 
Change to: python  /Scripts/memcached. py? P 12000  
 
If you use another port, you only need to change it to another value!