Posted on 2012-05-12 22:38
dennis 阅读(9285)
评论(5) 编辑 收藏 所属分类:
my open-source 、
Clojure
My weekend project clj.monitor is beta release,it's a clojure DSL for monitoring system and applications based on SSH.
Home:
https://github.com/killme2008/clj.monitor
An example:
(ns clj.monitor.example
(:use [clj.monitor.core]
[control.core]
[clj.monitor.tasks]))
;;define a mysql cluster
(defcluster mysql
:clients [{:user "deploy" :host "mysql.app.com"}])
;;define a monitor for mysql cluster
(defmonitor mysql-monitor
:tasks [(ping-mysql "root" "password")
(system-load :5 3)]
:clusters [:mysql])
;;start monitors
(start-monitors
:cron "* 0/5 * * * ?"
:alerts [(mail :from "alert@app.com" :to "yourname@app.com")]
:monitors [mysql-monitor])
API document:
http://fnil.net/clj.monitor
It is just a beta release,if you have any questions or find issues ,please let me know,thanks.