irename file-exists into check-file-exists - reed-alert - Lightweight agentless alerting system for server Err bitreich.org 70 hgit clone git://bitreich.org/reed-alert/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/reed-alert/ URL:git://bitreich.org/reed-alert/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/reed-alert/ bitreich.org 70 1Log /scm/reed-alert/log.gph bitreich.org 70 1Files /scm/reed-alert/files.gph bitreich.org 70 1Refs /scm/reed-alert/refs.gph bitreich.org 70 1Tags /scm/reed-alert/tag bitreich.org 70 1README /scm/reed-alert/file/README.gph bitreich.org 70 1LICENSE /scm/reed-alert/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit 46c03914d4314e24b09bbdb7bff153e54bb3e4b4 /scm/reed-alert/commit/46c03914d4314e24b09bbdb7bff153e54bb3e4b4.gph bitreich.org 70 1parent 93bc94cbac2d22e174cc7d19fcb6e1469fbb6107 /scm/reed-alert/commit/93bc94cbac2d22e174cc7d19fcb6e1469fbb6107.gph bitreich.org 70 hAuthor: Solène Rapenne URL:mailto:solene@perso.pw bitreich.org 70 iDate: Wed, 28 Jun 2023 10:54:37 +0200 Err bitreich.org 70 i Err bitreich.org 70 irename file-exists into check-file-exists Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M README | 10 +++++----- Err bitreich.org 70 i M example-full.lisp | 4 ++-- Err bitreich.org 70 i M probes.lisp | 2 +- Err bitreich.org 70 i Err bitreich.org 70 i3 files changed, 8 insertions(+), 8 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/README b/README /scm/reed-alert/file/README.gph bitreich.org 70 i@@ -195,7 +195,7 @@ As of this commit, reed-alert ships with the following probes: Err bitreich.org 70 i (1) number-of-processes Err bitreich.org 70 i (2) pid-running Err bitreich.org 70 i (3) disk-usage Err bitreich.org 70 i- (4) file-exists Err bitreich.org 70 i+ (4) check-file-exists Err bitreich.org 70 i (5) file-updated Err bitreich.org 70 i (6) load-average-1 Err bitreich.org 70 i (7) load-average-5 Err bitreich.org 70 i@@ -239,14 +239,14 @@ Check if the disk-usage of a chosen partition does exceed a specific limit. Err bitreich.org 70 i Example: `(=> alert disk-usage :path "/tmp" :limit 50)` Err bitreich.org 70 i Err bitreich.org 70 i Err bitreich.org 70 i-file-exists Err bitreich.org 70 i+check-file-exists Err bitreich.org 70 i ----------- Err bitreich.org 70 i Check if a file exists. Err bitreich.org 70 i Err bitreich.org 70 i > Set the path of the file to check. Err bitreich.org 70 i :path "STRING" Err bitreich.org 70 i Err bitreich.org 70 i-Example: `(=> alert file-exists :path "/var/postgresql/standby")` Err bitreich.org 70 i+Example: `(=> alert check-file-exists :path "/var/postgresql/standby")` Err bitreich.org 70 i Err bitreich.org 70 i Err bitreich.org 70 i file-updated Err bitreich.org 70 i@@ -521,10 +521,10 @@ but one may want to do it in LISP, allowing to use full features of Err bitreich.org 70 i the language and even some libraries to check values in a database for Err bitreich.org 70 i example. I recommend to read the "probes.lisp" file, it's the best way Err bitreich.org 70 i to learn how to write a new probe. But as an example, we will learn Err bitreich.org 70 i-from the easiest probe included : file-exists Err bitreich.org 70 i+from the easiest probe included : check-file-exists Err bitreich.org 70 i Err bitreich.org 70 i (create-probe Err bitreich.org 70 i- file-exists Err bitreich.org 70 i+ check-file-exists Err bitreich.org 70 i (let ((result (probe-file (getf params :path)))) Err bitreich.org 70 i (if result Err bitreich.org 70 i t Err bitreich.org 70 1diff --git a/example-full.lisp b/example-full.lisp /scm/reed-alert/file/example-full.lisp.gph bitreich.org 70 i@@ -13,8 +13,8 @@ Err bitreich.org 70 i (=> peroket disk-usage :path "/tmp" :limit 0) ;; failure Err bitreich.org 70 i Err bitreich.org 70 i ;; check if :path file exists Err bitreich.org 70 i-(=> mail file-exists :path "/bsd.rd" :desc "OpenBSD kernel /bsd.rd") Err bitreich.org 70 i-(=> empty file-exists :path "/non-existant-file" :try 3) ;; failure file not found Err bitreich.org 70 i+(=> mail check-file-exists :path "/bsd.rd" :desc "OpenBSD kernel /bsd.rd") Err bitreich.org 70 i+(=> empty check-file-exists :path "/non-existant-file" :try 3) ;; failure file not found Err bitreich.org 70 i Err bitreich.org 70 i ;; check if :path file exists and has been updated since :limit minutes Err bitreich.org 70 i (=> empty file-updated :path "/var/log/messages" :limit 400) Err bitreich.org 70 1diff --git a/probes.lisp b/probes.lisp /scm/reed-alert/file/probes.lisp.gph bitreich.org 70 i@@ -1,5 +1,5 @@ Err bitreich.org 70 i (create-probe Err bitreich.org 70 i- file-exists Err bitreich.org 70 i+ check-file-exists Err bitreich.org 70 i (let ((result (probe-file (getf params :path)))) Err bitreich.org 70 i (if result Err bitreich.org 70 i t Err bitreich.org 70 .