首页 > 后端开发 > php教程 > 用memcache.php监控memcache的使用情况

用memcache.php监控memcache的使用情况

WBOY
发布: 2016-06-23 13:35:25
原创
934 人浏览过

      一个非常好的memcached监控工具, 监控memcached的内存使用情况和命中率
     配置非常简单,只用配置监控的Memcached服务器的信息和访问的用户名密码就可以了!
     可以监控多个服务器
      图形界面


<?php /*  +----------------------------------------------------------------------+  | PHP Version 5                                                        |  +----------------------------------------------------------------------+  | Copyright (c) 1997-2004 The PHP Group                                |  +----------------------------------------------------------------------+  | This source file is subject to version 3.0 of the PHP license,       |  | that is bundled with this package in the file LICENSE, and is        |  | available through the world-wide-web at the following url:           |  | http://www.php.net/license/3_0.txt.                                  |  | If you did not receive a copy of the PHP license and are unable to   |  | obtain it through the world-wide-web, please send a note to          |  | license@php.net so we can mail you a copy immediately.               |  +----------------------------------------------------------------------+  | Author:  Harun Yayli <harunyayli at gmail.com>                       |  +----------------------------------------------------------------------+*/$VERSION='$Id: memcache.php,v 1.1.2.3 2008/08/28 18:07:54 mikl Exp $';define('ADMIN_USERNAME','memcache'); 	// Admin Usernamedefine('ADMIN_PASSWORD','password');  	// Admin Passworddefine('DATE_FORMAT','Y/m/d H:i:s');define('GRAPH_SIZE',200);define('MAX_ITEM_DUMP',50);$MEMCACHE_SERVERS[] = 'mymemcache-server1:11211'; // add more as an array$MEMCACHE_SERVERS[] = 'mymemcache-server2:11211'; // add more as an array////////// END OF DEFAULT CONFIG AREA ////////////////////////////////////////////////////////////////////////////// Password protect ////////////////////////////////////////////////////////////////if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) ||           $_SERVER['PHP_AUTH_USER'] != ADMIN_USERNAME ||$_SERVER['PHP_AUTH_PW'] != ADMIN_PASSWORD) {			Header("WWW-Authenticate: Basic realm=\"Memcache Login\"");			Header("HTTP/1.0 401 Unauthorized");			echo 				<h1>Rejected!</h1>				<big>Wrong Username or Password!</big>				
登录后复制
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板