You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Kevin Burton <bu...@spinn3r.com> on 2015/03/07 01:37:57 UTC

Best way to alert/monitor "nodetool status” down.

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
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>
<http://spinn3r.com>

Re: Best way to alert/monitor "nodetool status” down.

Posted by Jan <cn...@yahoo.com>.
You could set up an Alert  for Node down within OpsCenter. OpsCenter also offers you the option to send an email to a paging system with reminders. 

Jan/ 

     On Sunday, March 8, 2015 6:10 AM, Vasileios Vlachos <va...@gmail.com> wrote:
   

  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
  Location: San Francisco, CA
  blog: http://burtonator.wordpress.com … or check out my Google+ profile       
 
 -- 
Kind Regards,

Vasileios Vlachos

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

   

Re: Best way to alert/monitor "nodetool status” down.

Posted by Vasileios Vlachos <va...@gmail.com>.
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)