From 5d3e958e18908e0258cb5ee80777cf7f821268e9 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Thu, 27 Jul 2023 16:01:34 +0200
Subject: [PATCH] add doc page for fs_writable

---
 docs/20_Checks/_index.md            |  2 +-
 docs/20_Checks/check_fs_writable.md | 68 +++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 docs/20_Checks/check_fs_writable.md

diff --git a/docs/20_Checks/_index.md b/docs/20_Checks/_index.md
index e6dfff4..b5f91e8 100644
--- a/docs/20_Checks/_index.md
+++ b/docs/20_Checks/_index.md
@@ -21,7 +21,7 @@ There is one include script used by all checks:
 * [check_dns_responsetime](check_dns_responsetime.md)
 * [check_eol](check_eol.md)
 * [check_fs_errors](check_fs_errors.md)
-* check_fs_writable
+* [check_fs_writable](check_fs_writable.md)
 * check_haproxy_health
 * check_haproxy_status
 * check_memory
diff --git a/docs/20_Checks/check_fs_writable.md b/docs/20_Checks/check_fs_writable.md
new file mode 100644
index 0000000..9646a75
--- /dev/null
+++ b/docs/20_Checks/check_fs_writable.md
@@ -0,0 +1,68 @@
+# Check writable filesystem
+
+## Introduction
+
+**check_fs_writebale** checks in the given directories a file can be touched.
+The response is critical of one of the directory is not writable for the icinga client user. 
+
+## Requirements
+
+(none)
+
+## Syntax
+
+```txt
+./check_fs_writable -h
+______________________________________________________________________
+
+CHECK_FS_WRITABLE 
+v1.2
+
+(c) Institute for Medical Education - University of Bern
+Licence: GNU GPL 3
+______________________________________________________________________
+
+Check if a filesystem is readonly in given directories.
+In each of the given directories a random file will be touched.
+
+The response is critical of one of the directory is not writable
+for the icinga client user.
+
+SYNTAX:
+check_fs_writable [directory [more directories]]
+
+OPTIONS:
+
+    -h or --help   show this help.
+
+PARAMETERS:
+
+    DIRECTORY where to touch a temporary file
+              default directories:
+              /tmp /var/tmp
+
+EXAMPLE:
+
+    check_fs_writable /tmp /root /var/www
+
+```
+
+### Parameters
+
+Add directories to check.
+Set a directory that is writable for world or prepared to be accessible for the icinga user.
+
+## Examples
+
+`$ check_fs_writable` returns
+
+```txt
+OK: check if filesystem is writable in /tmp /var/tmp 
+
+--- touching something into /tmp
+    -rw-r--r-- 1 axel axel 0 27. Jul 16:00 /tmp/icinga_touch_testfile__7749_15502
+
+--- touching something into /var/tmp
+    -rw-r--r-- 1 axel axel 0 27. Jul 16:00 /var/tmp/icinga_touch_testfile__30551_11189
+
+```
-- 
GitLab