Select Git revision
check_couchdb.md 9.79 KiB
check_couchdb
Introduction
Check couchdb status.
Requirements
- curl
- jq
- a running couchdb service
- authentication (see section Installation below)
Syntax
> check_couchdb -h
______________________________________________________________________
CHECK_COUCHDB
v0.7
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_couchdb.html
______________________________________________________________________
Show couchdb status.
SYNTAX:
check_couchdb [-h] [-t FILE] -m MODE
OPTIONS:
-h or --help show this help.
-c CFGFILE set a custom config file
default: /etc/icingaclient/.couchdb
-m MODE test a value; for debugging purposes the full json
response will be shown
MODE is one of
httpd Show counters for http request types
httpd_methods Show counters for http request methods
open_databases show number of open databases
open_os_files show number of file descriptors CouchDB has open
replication show last replication status
pending show count of pending updates for nodes, dbs and users
replication show last replication status
up show general couchdb health status
EXAMPLE:
check_couchdb -m up
Check if couchdb is up and running
check_couchdb -m httpd_methods
Show counters and change rate per sec of GET, POST, and other methods
check_couchdb -c /opt/couchdb/myconfig.sh -m up
Source another config to define COUCH_URL
Installation
The check script by default sources a file /etc/icingaclient/.couchdb
.
It is a shell script with read permissions for the icinga user.
It contains a line with the url to couchdb
# ls -l /etc/icingaclient/.couchdb
-r--------. 1 icingaclient icingaclient 110 Aug 29 09:53 /etc/icingaclient/.couchdb
# cat /etc/icingaclient/.couchdb
export COUCH_URL=http://USERNAME:PASSWORD@localhost:5984
The variable COUCH_URL will be used to request status information.
With parameter -c CFGFILE
can define another location where to find the variable COUCH_URL.
Checks
With the parameter -m METHOD
you define what kind of check to perform.
httpd
Show counters for http request types.
All values are taken from /_node/_local/_stats/couchdb/httpd
check_couchdb -m httpd_methods
returns
OK: Couchdb :: Http request methods
______________________Property____Counter______Delta
aborted_requests 0 0 per sec
bulk_requests 0 0 per sec
requests 190116 1 per sec
view_timeouts 0 0 per sec
find_timeouts 0 0 per sec
explain_timeouts 0 0 per sec
all_docs_timeouts 0 0 per sec
partition_view_requests 0 0 per sec
partition_find_requests 0 0 per sec
partition_explain_requests 0 0 per sec
partition_all_docs_requests 0 0 per sec
partition_view_timeouts 0 0 per sec
partition_find_timeouts 0 0 per sec
partition_explain_timeouts 0 0 per sec
partition_all_docs_timeouts 0 0 per sec
temporary_view_reads 0 0 per sec
view_reads 0 0 per sec
clients_requesting_changes 0 0 per sec
purge_requests 0 0 per sec
|abortedrequests=0;; bulkrequests=0;; requests=1;; viewtimeouts=0;; findtimeouts=0;; explaintimeouts=0;; alldocstimeouts=0;; partitionviewrequests=0;; partitionfindrequests=0;; partitionexplainrequests=0;; partitionalldocsrequests=0;; partitionviewtimeouts=0;; partitionfindtimeouts=0;; partitionexplaintimeouts=0;; partitionalldocstimeouts=0;; temporaryviewreads=0;; viewreads=0;; clientsrequestingchanges=0;; purgerequests=0;;
Description of the properties: