libs separées - reed-alert - Lightweight agentless alerting system for server
HTML git clone git://bitreich.org/reed-alert/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/reed-alert/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit 71df6de766a87c6455bf293247d4dac72ff556e4
DIR parent 6a0f459f93cd6c2725f8c1df5699ac4cb7e1d1e3
HTML Author: solene rapenne <solene@dataswamp.org>
Date: Thu, 26 Jan 2017 14:56:04 +0100
libs separées
Diffstat:
M example.lisp | 9 ++++-----
M probes-extended.lisp | 12 ++++--------
2 files changed, 8 insertions(+), 13 deletions(-)
---
DIR diff --git a/example.lisp b/example.lisp
@@ -35,14 +35,13 @@
;; check if load average on (1/5/15) minutes is more than :limit
(=> mail load-average-1 (:limit 4))
-(=> mail load-average-5 (:limit 2))
-(=> mail load-average-15 (:limit 1))
+;;(=> mail load-average-5 (:limit 2))
+;;(=> mail load-average-15 (:limit 1))
(=> mail load-average-1 (:limit 0.2)) ;; should trigger error
;; check if :host host is reachable
-(=> mail ping (:host "8.8.8.8" :desc "Google DNS"))
-(=> void ping (:host "2.3.4.256" :desc "Not valid ipv4 address")) ;; fail error
-(=> void ping (:host "127.40.30.21" :desc "Certainly not used address")) ;; fail time out
+;;(=> mail ping (:host "8.8.8.8" :desc "Google DNS"))
+;;(=> void ping (:host "127.40.30.21" :desc "Certainly not used address")) ;; fail time out
;; check if :command command return 0 (success) or something else (error)
(=> void command (:command "echo hello")) ;; success
DIR diff --git a/probes-extended.lisp b/probes-extended.lisp
@@ -1,15 +1,11 @@
-(unless (member :quicklisp cl:*features*)
- (format t "quicklisp isn't loaded, you can't use extended probes without quicklisp~%")
- (quit))
-
-(ql:quickload :drakma)
-(ql:quickload :cl-ppcre)
+(load "libraries/bundle.lisp")
+(mapcar 'asdf:load-system '("drakma" "cl-ppcre"))
(create-probe
http-response-time
(let ((begin (get-universal-time)))
(let ((result (ignore-errors
- (drakma:http-request (getf params :url) :connection-timeout (getf params :timeout 3)))))
+ (drakma:http-request (getf params :url)))))
(if result
(let ((elapsed-time (- (get-universal-time) begin)))
(if (< elapsed-time (getf params :limit))
@@ -20,7 +16,7 @@
(create-probe
http-text-present
(ignore-errors
- (let ((result (drakma:http-request (getf params :url) :connection-timeout (getf params :timeout 3))))
+ (let ((result (drakma:http-request (getf params :url))))
(if (cl-ppcre:scan (getf params :pattern) result)
t
(list nil "pattern not found")))))