Last active
November 27, 2015 06:03
-
-
Save syuhei176/513d0605feb2407b7dd6 to your computer and use it in GitHub Desktop.
Check cassandra status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import sys, re | |
hostname = 'cassandra host' | |
check = subprocess.check_output(['nodetool', '-h', hostname, 'status']) | |
line = check.split('\n') | |
for l in line: | |
m = re.match(r"DN" , l) | |
if m: | |
print("Down") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment