Created
June 5, 2017 13:58
-
-
Save jvshahid/16d83452f0283cde0705161b68b3a0ee to your computer and use it in GitHub Desktop.
find desired lrps with unclaimed instances
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
#!/usr/bin/env bash | |
source /var/vcap/jobs/cfdot/bin/setup | |
desired_lrps=$(cfdot desired-lrps | jq -r '.process_guid + " " + (.instances | tostring)') | |
export IFS=$'\n' | |
for i in $desired_lrps; do | |
guid=$(echo $i | awk '{print $1}') | |
instances=$(echo $i | awk '{print $2}') | |
running=$(cfdot actual-lrp-groups-for-guid $guid | jq -r -c .instance.state | egrep 'RUNNING|CLAIMED' | wc -l) | |
if [ $running -ne $instances ]; then | |
echo "process $guid has $running running instances and $instances desired instances" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment