注册

分布式监控系统 Watchy

Watchy 是一个分布式的系统,用于监控应用程序和服务器。该系统非常简单和易于**。Watchy 提供一个分布式的架构和每个服务器之间守护进程的通讯,通过 UDP 获取不同服务器上的数据并在同一个面板上显示。




**工作原理**Watchy 使用应用/事件驱动模型,如下图所示:

1.png




而且整个系统是脚本化的,可通过 Python 或者 C/C++ 来进行**作。但首先要启动服务器:
$ /usr/local/bin/watchy.py --help
Usage: watchy.py Options:
-h, --help show this help message and exit
-v, --version Print version
-c CONFIG, --config=CONFIG
Config file location
-F, --fork Fork as daemon然后通过下列命令运行服务器
$ /usr/local/bin/watchy.py -c /etc/watchy/example-watchy.cfg
WATCHY INFO - Starting StatsAggregator on 0.0.0.0:7878
WATCHY INFO - Starting Async Backend handler
WATCHY INFO - WSGI**: starting **://0.0.0.0:8787/
...现在可以启动监控成员
>>> import pywatchy
# hostname and port of watchy **
>>> daemon = pywatchy.WatchyDaemon ('localhost', 7878)
# Creates or attaches to existing daemon on the **
>>> daemon.watchHost ('hostname')
# tell the daemon to watch the host ** for statistics and post under specified key ('hostname')
启动和停止进程:
>>> daemon.watchPid ('watchy**', 14293) # watch the python web app
>>> daemon.postMessage ('**', 'Hello World')
>>> daemon.stopWatchPid (14293) # stop watching in这些**作都是实时而动态的.
已邀请:
谢谢哦,辛苦辛苦!











static/image/common/sigline.gif
90%打工小伙一生都不可能知道的秘密 http://11575.360kuyi.com/

要回复问题请先登录注册