A simple nagios plugin to monitor Couchbase 2.x servers/cluster.
###Requirements
# apt-get install nagios3 # pip install requests
git clone https://github.com/YakindanEgitim/nagios-plugin-couchbase.git
Following commands show information based on the currently selected bucket:
define command{
command_name cb_item_count
command_line $USER1$/check_couchbase.py -u $USER2$ -p $USER3$ -I $HOSTADDRESS$ -P $ARG1$ -b $ARG2$ --item-count -W $ARG3$ -C $ARG4$
}
define command{
command_name cb_low_watermark
command_line $USER1$/check_couchbase.py -u $USER2$ -p $USER3$ -I $HOSTADDRESS$ -P $ARG1$ -b $ARG2$ --low-watermark -W $ARG3$ -C $ARG4$
}
define command{
command_name cb_mem_used
command_line $USER1$/check_couchbase.py -u $USER2$ -p $USER3$ -I $HOSTADDRESS$ -P $ARG1$ -b $ARG2$ --memory-used -W $ARG3$ -C $ARG4$
}
You should '--vbucket' parameter for checking vBucket resources. vBucket resources states are pending, total, replica and active. For example if you want to check ejections total state of vbucket, you must specify '--vbucket --total --ejections'. You can see below some examples for vbucket resources checks.
define command{
command_name cb_vb_active_new_items
command_line $USER1$/check_couchbase.py -u $USER2$ -p $USER3$ -I $HOSTADDRESS$ -P $ARG1$ -b $ARG2$ --vbucket --active --new-items -W $ARG3$ -C $ARG4$
}
define command{
command_name cb_vb_pending_new_items
command_line $USER1$/check_couchbase.py -u $USER2$ -p $USER3$ -I $HOSTADDRESS$ -P $ARG1$ -b $ARG2$ --vbucket --pending --new-items -W $ARG3$ -C $ARG4$
}
define command{
command_name cb_vb_total_new_items
command_line $USER1$/check_couchbase.py -u $USER2$ -p $USER3$ -I $HOSTADDRESS$ -P $ARG1$ -b $ARG2$ --vbucket --total --new_items -W $ARG3$ -C $ARG4$
}
define command{
command_name cb_vb_replica_new_items
command_line $USER1$/check_couchbase.py -u $USER2$ -p $USER3$ -I $HOSTADDRESS$ -P $ARG1$ -b $ARG2$ --vbucket --replica --new-items -W $ARG3$ -C $ARG4$
}
You should use '--disk-queues' parameter. Disk queues states are pending, total, replica and active.
define command{
command_name cb_vb_disk_queues_pending_fill_rate
command_line $USER1$/check_couchbase.py -u $USER2$ -p $USER3$ -I $HOSTADDRESS$ -P $ARG1$ -b $ARG2$ --disk-queues --pending --fill-rate -W $ARG3$ -C $ARG4$
}
define command{
command_name cb_vb_disk_queues_pending_drain_rate
command_line $USER1$/check_couchbase.py -u $USER2$ -p $USER3$ -I $HOSTADDRESS$ -P $ARG1$ -b $ARG2$ --disk-queues --pending --drain-rate -W $ARG3$ -C $ARG4$
}
Note1 : We used above commands for cluster level. If you want to query in node level for statistic, you add '--node' parameter and you can remove some parameters. So you can edit following:
define command{
command_name cb_vb_disk_queues_pending_drain_rate
command_line $USER1$/check_couchbase.py -I $HOSTADDRESS$ -b $ARG2$ --disk-queues --pending --drain-rate --node -W $ARG3$ -C $ARG4$
}
In addition, if your CouchBase 'cbstats' command path different from default (/opt/bin/couchbase/cbstats), you should add '--cbstats' option. In this case, you must define full path for '--cbstats' parameter.
define command{
command_name cb_mem_used
command_line $USER1$/check_couchbase.py -I $HOSTADDRESS$ -b $ARG2$ --memory-used --node --cbstats /full_path/ -W $ARG3$ -C $ARG4$
}
You should use '--cbstats' parameter only in node level.
Note2 : If you want to use more options (--disk-reads-per-sec, --high-watermark, --cache-miss-ratio .. etc.), you can see using
'--help' parameter.
$/usr/lib/nagios/plugins/check_couchbase.py --help
Ebru Akagündüz ebru.akagunduz@gmail.com
##License Nagios Plugin Couchbase is available under the GPLv3
It is also available in nagios-exchange: https://exchange.nagios.org/directory/Plugins/Databases/nagios-2Dplugin-2Dcouchbase/details