正在加载中……
最新消息:欢迎大家访问,导航分类不完善,如果找不到自己想要的文章,可以通过【关键词】来进行搜索,^_^!

CentOS下用Cacti监控memcached状态

Linux专题 REKFAN.COM 4483浏览 0评论

更多


首先Cacti需要一个memcached的模板,我们可以从这里下载
  http://dealnews.com/developers/cacti/memcached.html
  不过他需要Python运行环境,让我们看一下
[blog@rekfan.com src]# rpm -qa |grep python
python-2.4.3-24.el5
python-devel-2.4.3-24.el5
...
python-iniparse-0.2.3-4.el5
gnome-python2-gnomeprint-2.16.0-2.el5
还真装了不少,不过上面的网页上说需要一个 Python memcached Client API
让我们把他下载下来装上他。
 
[blog@rekfan.com src]# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fpypi.python.org" "https://pypi.python.org/packages/source/p/python-memcached/python-memcached-1.53.tar.gz"
[blog@rekfan.com src]#
[blog@rekfan.com src]# tar zxvf python-memcached-1.53.tar.gz 
[blog@rekfan.com src]# cd python-memcached-1.53
[blog@rekfan.com python-memcached-1.53]# python setup.py install
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
    from setuptools import setup
ImportError: No module named setuptools
 
出错了...原来我之前没有装setuptools模块。不过没关系,装他很快
[blog@rekfan.com python-memcached-1.53]# yum install python-setuptools
[blog@rekfan.com python-memcached-1.53]# python setup.py install      
running install
running bdist_egg
running egg_info
writing python_memcached.egg-info/PKG-INFO
writing top-level names to python_memcached.egg-info/top_level.txt
writing dependency_links to python_memcached.egg-info/dependency_links.txt
reading manifest file 'python_memcached.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.rst'
warning: no files found matching '*.txt'
warning: no files found matching 'MakeFile'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.gitignore' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
writing manifest file 'python_memcached.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
copying memcache.py -> build/lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
copying build/lib/memcache.py -> build/bdist.linux-x86_64/egg
byte-compiling build/bdist.linux-x86_64/egg/memcache.py to memcache.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying python_memcached.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying python_memcached.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying python_memcached.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying python_memcached.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/python_memcached-1.53-py2.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing python_memcached-1.53-py2.6.egg
creating /usr/lib/python2.6/site-packages/python_memcached-1.53-py2.6.egg
Extracting python_memcached-1.53-py2.6.egg to /usr/lib/python2.6/site-packages
Adding python-memcached 1.53 to easy-install.pth file
 
Installed /usr/lib/python2.6/site-packages/python_memcached-1.53-py2.6.egg
Processing dependencies for python-memcached==1.53
Finished processing dependencies for python-memcached==1.53
 
 
[blog@rekfan.com src]# wget http://content.dealnews.com/dealnews/developers/cacti-memcached-1.0.tar.gz
 
[blog@rekfan.com src]#tar zxvf cacti-memcached-1.0.tar.gz
[blog@rekfan.com src]#cd cacti-memcached
[blog@rekfan.com cacti-memcached]#ls -l
cacti_memcached_host_template.xml  INSTALL  memcached.py  README
 
把memcached.py 拷贝到Cacti 的scripts目录下,然后进入Cacti控制界面点击
Import Templates --> Import Template from Local File
在浏览里面选择 cacti_memcached_host_template.xml 这个文件,然后点击save
之后的操作就是增加设备。

转载请注明:|REKFAN|系统运维| » CentOS下用Cacti监控memcached状态

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址