posted on 2012-05-12 22:38
dennis 阅读(9220)
评论(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:
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:
it is just a beta release,if you have any questions or find issues ,please let me know,thanks.