Created
July 17, 2013 13:09
-
-
Save jonfuller/6020424 to your computer and use it in GitHub Desktop.
Shell script to use in a Jenkins job for displaying whether a given Jenkins slave node is up or down. Use this as an "execute shell" build step. NB: Must be run on a machine that has bash (i.e. not Windows)
This file contains hidden or 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
NODE_NAME="name-of-node" | |
ENDPOINT="http://JENKINSURL_GOES_HERE/computer/api/xml?xpath=computerSet/computer\[displayName='$NODE_NAME'\]/offline/text()" | |
ENDPOINT_RESULT=$(curl $ENDPOINT 2> /dev/null) | |
if [ $ENDPOINT_RESULT = "false" ] ; then | |
exit 0 | |
fi | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment