mirror of git://bitreich.org/reed-alert
[FIX] Load average wasn't working in some conditions
This commit is contained in:
parent
8a7e81410b
commit
84cc333bfe
10
probes.lisp
10
probes.lisp
|
@ -40,28 +40,28 @@
|
|||
(defun system-load(time)
|
||||
(read-from-string
|
||||
(let ((command (concatenate 'string
|
||||
"uptime | awk '{ print $"
|
||||
"uptime | awk '{ print $(NF-"
|
||||
(princ-to-string time)
|
||||
" }'")))
|
||||
") }'")))
|
||||
(uiop:run-program command :output :string))))
|
||||
|
||||
(create-probe
|
||||
load-average-1
|
||||
(let ((load (system-load 10)))
|
||||
(let ((load (system-load 2)))
|
||||
(if (< load (getf params :limit))
|
||||
t
|
||||
(list nil load))))
|
||||
|
||||
(create-probe
|
||||
load-average-5
|
||||
(let ((load (system-load 11)))
|
||||
(let ((load (system-load 1)))
|
||||
(if (< load (getf params :limit))
|
||||
t
|
||||
(list nil load))))
|
||||
|
||||
(create-probe
|
||||
load-average-15
|
||||
(let ((load (system-load 12)))
|
||||
(let ((load (system-load 0)))
|
||||
(if (< load (getf params :limit))
|
||||
t
|
||||
(list nil load))))
|
||||
|
|
Loading…
Reference in New Issue