Skip to content
Snippets Groups Projects
Commit 3ce72b60 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

add checks "open_databases" + "open_os_files"

parent 2770f91c
No related branches found
No related tags found
1 merge request!1516588 add couchdb check - add checks "open_databases" + "open_os_files"
......@@ -17,11 +17,12 @@
# 2023-08-28 v0.2 <axel.hahn@unibe.ch> first check "up"
# 2023-08-28 v0.3 <axel.hahn@unibe.ch> add check "replication"
# 2023-08-28 v0.4 <axel.hahn@unibe.ch> add check "pending"
# 2023-08-28 v0.5 <axel.hahn@unibe.ch> add checks "open_databases" + "open_os_files"
# ======================================================================
. $(dirname $0)/inc_pluginfunctions
export self_APPVERSION=0.4
export self_APPVERSION=0.5
cfgfile=/etc/icingaclient/.couchdb
export RESPONSE
......@@ -44,7 +45,7 @@ $_self [-h] [-t FILE] -m MODE
OPTIONS:
-h or --help show this help.
-c CFGFILE set a custom config file
default: ${cfgfile}
default: /etc/icingaclient/.couchdb
-m MODE test a value; for debugging purposes the full json
response will be shown
......@@ -52,6 +53,8 @@ OPTIONS:
up show general couchdb status
replication show last replication status
pending show count of pending updates for nodes, dbs and users
open_databases show number of open databases
open_os_files show number of file descriptors CouchDB has open
EXAMPLE:
$_self -m up
......@@ -122,7 +125,8 @@ case "${sMode}" in
ph.setStatus critical
fi
ph.status "Couchdb :: health status (value 'status' in ${REQ} is '$_status')"
echo "Reponse of ${REQ}: "; echo "${RESPONSE}" | jq
echo "Reponse of ${REQ}: ";
echo "${RESPONSE}" | jq
;;
# ............................................................
"replication")
......@@ -139,7 +143,8 @@ case "${sMode}" in
fi
ph.status "Couchdb :: replication (values 'last_replication_status' in ${REQ} are '$_status')"
echo "Reponse: of ${REQ}"; echo "${RESPONSE}" | jq
echo "Reponse: of ${REQ}";
echo "${RESPONSE}" | jq
;;
# ............................................................
"pending")
......@@ -165,7 +170,20 @@ case "${sMode}" in
done
ph.status "Couchdb :: pending updates: $_iTotal (values below 'pending_updates' in ${REQ})"
echo "Reponse: of ${REQ}"; echo "${RESPONSE}" | jq
echo "Reponse: of ${REQ}";
echo "${RESPONSE}" | jq
;;
"open_databases"|"open_os_files")
REQ=/_node/_local/_stats/couchdb/${sMode}
abortOnWrongResponse "${REQ}" '"value":'
# descr=$( jq '.desc' <<< "${RESPONSE}" | tr -d '"')
value=$( jq '.value' <<< "${RESPONSE}" )
ph.perfadd "${sMode}" "$value" "" ""
ph.status "Couchdb :: ${sMode} = $value"
# echo "$descr"
echo "Reponse: of ${REQ}";
echo "${RESPONSE}" | jq
;;
# ............................................................
*)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment