Last active
December 19, 2015 22:19
-
-
Save tserong/6026993 to your computer and use it in GitHub Desktop.
Check if current node in a Pacemaker cluster is currently running any resources (new and improved thanks to lge on #linux-ha).
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
#!/bin/sh | |
[ -n "$(crm_mon -1 -n 2>/dev/null | sed -ne '/^Failed actions:/ q; /^Node '$(crm_node -n)':/,/^Node/ { /^Node/ d; p }')" ] \ | |
&& echo 'this node is hosting resources' \ | |
|| echo 'this node is slacking off, doing nothing' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment