-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Healthrule list, added healthrule enable/disable
Updated Healthrule list, added healthrule enable/disable. Also added recipes for healthrule_enablebyname and healthrule_disablebyname
- Loading branch information
1 parent
50c26f2
commit ad9bd4e
Showing
7 changed files
with
3,183 additions
and
205 deletions.
There are no files selected for viewing
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
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# { | ||
# "enabled": true, | ||
# "id": 35428, | ||
# "name": "CPU utilization is too high" | ||
# } | ||
|
||
ENVIRONMENT=$1 | ||
APPLICATION_ID=$2 | ||
HR_NAME=$3 | ||
|
||
echo "${ENVIRONMENT} ---- ${APPLICATION_ID} ----- ${HR_NAME} -------" | ||
# Get a list of healthrules that match the grep argument | ||
# Format is [ID] [Name] | ||
# In case anyone cares - we do the grep after the sed and awk commands to handle the potential edge case of the grep regex matching one of our keywords (id, name). | ||
# This way they get filtered out before we search on the HR name. | ||
HEALTHRULES=$(../act.sh -E ${ENVIRONMENT} healthrule list -a ${APPLICATION_ID} | sed 's/},{/\'$'\n'/g | awk -F "\"" '/"id":([[:digit:]]+)/ {print $3" "$6}' - | sed 's/^://'g | sed 's/, / /' | grep "${HR_NAME}" | awk '{print $1}' - ) | ||
|
||
for HR in $HEALTHRULES | ||
do | ||
echo "Disable HR ${HR}" | ||
../act.sh -E ${ENVIRONMENT} healthrule disable -a ${APPLICATION_ID} -i ${HR} | ||
done; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# { | ||
# "enabled": true, | ||
# "id": 35428, | ||
# "name": "CPU utilization is too high" | ||
# } | ||
|
||
ENVIRONMENT=$1 | ||
APPLICATION_ID=$2 | ||
HR_NAME=$3 | ||
|
||
echo "${ENVIRONMENT} ---- ${APPLICATION_ID} ----- ${HR_NAME} -------" | ||
# Get a list of healthrules that match the grep argument | ||
# Format is [ID] [Name] | ||
# In case anyone cares - we do the grep after the sed and awk commands to handle the potential edge case of the grep regex matching one of our keywords (id, name). | ||
# This way they get filtered out before we search on the HR name. | ||
HEALTHRULES=$(../act.sh -E ${ENVIRONMENT} healthrule list -a ${APPLICATION_ID} | sed 's/},{/\'$'\n'/g | awk -F "\"" '/"id":([[:digit:]]+)/ {print $3" "$6}' - | sed 's/^://'g | sed 's/, / /' | grep "${HR_NAME}" | awk '{print $1}' - ) | ||
|
||
for HR in $HEALTHRULES | ||
do | ||
echo "Enable HR ${HR}" | ||
../act.sh -E ${ENVIRONMENT} healthrule enable -a ${APPLICATION_ID} -i ${HR} | ||
done; |