rename file-exists into check-file-exists

This commit is contained in:
Solène Rapenne 2023-06-28 10:54:37 +02:00
parent 93bc94cbac
commit 46c03914d4
Signed by: solene
GPG Key ID: 8CD42DFD57F0A909
3 changed files with 8 additions and 8 deletions

10
README
View File

@ -195,7 +195,7 @@ As of this commit, reed-alert ships with the following probes:
(1) number-of-processes
(2) pid-running
(3) disk-usage
(4) file-exists
(4) check-file-exists
(5) file-updated
(6) load-average-1
(7) load-average-5
@ -239,14 +239,14 @@ Check if the disk-usage of a chosen partition does exceed a specific limit.
Example: `(=> alert disk-usage :path "/tmp" :limit 50)`
file-exists
check-file-exists
-----------
Check if a file exists.
> Set the path of the file to check.
:path "STRING"
Example: `(=> alert file-exists :path "/var/postgresql/standby")`
Example: `(=> alert check-file-exists :path "/var/postgresql/standby")`
file-updated
@ -521,10 +521,10 @@ but one may want to do it in LISP, allowing to use full features of
the language and even some libraries to check values in a database for
example. I recommend to read the "probes.lisp" file, it's the best way
to learn how to write a new probe. But as an example, we will learn
from the easiest probe included : file-exists
from the easiest probe included : check-file-exists
(create-probe
file-exists
check-file-exists
(let ((result (probe-file (getf params :path))))
(if result
t

View File

@ -13,8 +13,8 @@
(=> peroket disk-usage :path "/tmp" :limit 0) ;; failure
;; check if :path file exists
(=> mail file-exists :path "/bsd.rd" :desc "OpenBSD kernel /bsd.rd")
(=> empty file-exists :path "/non-existant-file" :try 3) ;; failure file not found
(=> mail check-file-exists :path "/bsd.rd" :desc "OpenBSD kernel /bsd.rd")
(=> empty check-file-exists :path "/non-existant-file" :try 3) ;; failure file not found
;; check if :path file exists and has been updated since :limit minutes
(=> empty file-updated :path "/var/log/messages" :limit 400)

View File

@ -1,5 +1,5 @@
(create-probe
file-exists
check-file-exists
(let ((result (probe-file (getf params :path))))
(if result
t