cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vasileios Vlachos <vasileiosvlac...@gmail.com>
Subject Re: Best way to alert/monitor "nodetool status” down.
Date Sun, 08 Mar 2015 13:09:42 GMT
We use Nagios for monitoring, and we call the following through NRPE:

#!/bin/bash

# Just for reference:
# Nodetool's output represents "Status" ans "State" in this order.
# Status values: U (up), D (down)
# State values: N (normal), L (leaving), J (joining), M (moving)

NODETOOL=$(which nodetool);
NODES_DOWN=$(${NODETOOL} --host localhost status | grep --count -E 
'^D[A-Z]');

if [[ ${NODES_DOWN} -gt 0 ]]; then
     output="CRITICAL - Nodes down: ${NODES_DOWN}";
     return_code=2;
elif [[ ${NODES_DOWN} -eq 0 ]]; then
     output="OK - Nodes down: ${NODES_DOWN}";
     return_code=0;
else
     output="UNKNOWN - Couldn't retrieve cluster information.";
     return_code=3;
fi

echo "${output}";
exit "${return_code}";

I've not used zabbix so I'm not sure the exit codes etc are the same for 
you. Also, you may need to modify the REGEX slightly depending on the 
Cassandra version you are using. There must be a way to get this via the 
JMX console as well, which might be easier for you to monitor.

On 07/03/15 00:37, Kevin Burton wrote:
> What’s the best way to monitor nodetool status being down? IE if a 
> specific server things a node is down (DN).
>
> Does this just use JMX?  IS there an API we can call?
>
> We want to tie it into our zabbix server so we can detect if here is 
> failure.
>
> -- 
> Founder/CEO Spinn3r.com <http://Spinn3r.com>
> Location: *San Francisco, CA*
> blog:**http://burtonator.wordpress.com
> … or check out my Google+ profile 
> <https://plus.google.com/102718274791889610666/posts>
> <http://spinn3r.com>

-- 
Kind Regards,

Vasileios Vlachos

IT Infrastructure Engineer
MSc Internet & Wireless Computing
BEng Electronics Engineering
Cisco Certified Network Associate (CCNA)


Mime
View raw message