Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_cassandra_cluster.sh

Current Version
1.0
Last Release Date
2012-05-04
Compatible With
  • Nagios 3.x
Owner
License
GPL
Hits
70451
Files:
FileDescription
check_cassandra_cluster.shVerify node joining cassandra multinode cluster, and send alert if the number of live node is less than the specified number.
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
* Software requirements
cassandra(using nodetool)

* overview
- verify that the number of live nodes which belong to Multi Cluster is less than the specified number.
- it is enable to specify the threshold with "-w " and "-c " option.
- fetch the number of live nodes, their status, and performance data with nodetool command.

* note
make sure that $PATH include $HOME_CASSANDRA/bin, like.
# grep cassandra /etc/profile
pathmunge /usr/local/apache-cassandra/bin

* command help
# check_cassandra_cluster.sh -h
Usage: check_cassandra_cluster.sh -H -P -w -c
-H IP address or hostname of the cassandra node to connect, localhost by default.
-P JMX port, 7199 by default.
-w alert warning state, if the number of live nodes is less than .
-c alert critical state, if the number of live nodes is less than .
-h show command option
-V show command version

* example
- OK
# check_cassandra_cluster.sh -H 192.168.213.91 -P 7199 -w 1 -c 0
OK - Live Node:2 - 192.168.213.92:Up,Normal,65.2KB,86.95% 192.168.213.91:Up,Normal,73.76KB,13.05% | Load_192.168.213.92=65.2KB Owns_192.168.213.92=86.95% Load_192.168.213.91=60.14KB Owns_192.168.213.91=13.05%

- WARNING
# check_cassandra_cluster.sh -H 192.168.213.91 -P 7199 -w 2 -c 0
WARNING - Live Node:2 - 192.168.213.92:Up,Normal,65.2KB,86.95% 192.168.213.91:Up,Normal,73.76KB,13.05% | Load_192.168.213.92=65.2KB Owns_192.168.213.92=86.95% Load_192.168.213.91=60.14KB Owns_192.168.213.91=13.05%

- CRITICAL
# check_cassandra_cluster.sh -H 192.168.213.91 -P 7199 -w 3 -c 2
CRITICAL - Live Node:2 - 192.168.213.92:Up,Normal,65.2KB,86.95% 192.168.213.91:Up,Normal,73.76KB,13.05% | Load_192.168.213.92=65.2KB Owns_192.168.213.92=86.95% Load_192.168.213.91=60.14KB Owns_192.168.213.91=13.05%

- when WARNING is less than CRITICAL
# check_cassandra_cluster.sh -H 192.168.213.91 -P 7199 -w 3 -c 4
-w 3 must be less than -c 4.

* status condition
- OK
when the number of live nodes is more than the threshold of warning or critical.

- WARNING
when the number of live nodes is less than the threshold of warning. Ex. if you set warning 5, it gets warning when the number of live nodes are less than 5.

- CRITICAL
when the number of live nodes is less than the threshold of critical. Ex. if you set critical 1, it gets warning when the number of live nodes are less than 1.

- UNKNOWN
when the threshold does not include numeral.

* performance data
extract Load and Owns from "nodetool -h ring"

Address DC Rack Status State Load Owns Token
100438156989107092060814573762535799562
192.168.213.92 datacenter1 rack1 Up Normal 65.2 KB 86.95% 78226618104191638724926445720843438360
192.168.213.91 datacenter1 rack1 Up Normal 60.14 KB 13.05% 100438156989107092060814573762535799562