support services running check

This commit is contained in:
solene rapenne 2017-01-26 17:38:06 +01:00
parent 71df6de766
commit 40f1c64c97
2 changed files with 14 additions and 1 deletions

View File

@ -33,6 +33,11 @@
(=> mail number-of-processes (:limit 200))
(=> mail number-of-processes (:limit 1)) ;; failure
;; check if service is running
(=> mail service (:name "httpd"))
(=> mail service (:name "ospfd")) ;; failure : not started
(=> mail service (:name "unknown")) ;; failure : not known
;; 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))
@ -52,7 +57,7 @@
;; check if web page :url answer under :limit
(=> void http-response-time (:url "http://google.fr/" :limit 10))
;; check if the web page :url contains the text :pattern
;; check if the web page :url contains the text regex :pattern
(=> void http-text-present (:url "http://google.fr/" :pattern "html"))
(=> void http-text-present (:url "http://google.fr/" :pattern "hello")) ;; error

View File

@ -17,6 +17,14 @@
(list nil result))))
(list nil "file not found")))
(create-probe
service
(command-return-code
#+openbsd
(list "rcctl" "check" (getf params :name))
#+(or freebsd linux)
(list "service" (getf params :name) "status")))
(create-probe
pid-running
(if (probe-file (getf params :path))