Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mt190502 committed Apr 24, 2024
1 parent e7ba9ed commit c094dfa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions monocloud/monocloud-health.sh
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ report_status() {
if [[ -f "/tmp/monocloud-health/system_load" ]]; then
underthreshold_system=1
rm -f /tmp/monocloud-health/system_load
message+="(Current: $(echo $systemstatus | jq -r '.load'))...\"}"
message+="(Current: $(echo $systemstatus | jq -r '.load')%)...\"}"
curl -fsSL -X POST -H "Content-Type: application/json" -d "$message" "$WEBHOOK_URL"
else
echo "There's no alarm for Underthreshold (SYS) today..."
Expand All @@ -278,7 +278,7 @@ report_status() {
else
overthreshold_system=1
date +%Y-%m-%d >/tmp/monocloud-health/system_load
message+="(Current: $(echo $systemstatus | jq -r '.load'))...\"}"
message+="(Current: $(echo $systemstatus | jq -r '.load')%)...\"}"
curl -fsSL -X POST -H "Content-Type: application/json" -d "$message" "$WEBHOOK_URL"
fi
fi
Expand All @@ -289,22 +289,22 @@ report_status() {
if [[ -f "/tmp/monocloud-health/ram_usage" ]]; then
underthreshold_ram=1
rm -f /tmp/monocloud-health/ram_usage
message+="(Current: $(echo $systemstatus | jq -r '.ram'))...\"}"
message+="(Current: $(echo $systemstatus | jq -r '.ram')%)...\"}"
curl -fsSL -X POST -H "Content-Type: application/json" -d "$message" "$WEBHOOK_URL"
else
echo "There's no alarm for Underthreshold (RAM) today..."
fi
fi

local overthreshold_ram=0
message="{\"text\": \"[Monocloud - $alarm_hostname] [🔴] RAM usage limit has exceeded $RAM_LIMIT }"
message="{\"text\": \"[Monocloud - $alarm_hostname] [🔴] RAM usage limit has exceeded $RAM_LIMIT "
if [[ -n $(echo $systemstatus | jq -r ". | select(.ram | tonumber > $RAM_LIMIT)") ]]; then
if [[ -f "/tmp/monocloud-health/ram_usage" && "$(cat /tmp/monocloud-health/ram_usage)" == "$(date +%Y-%m-%d)" ]]; then
echo "There's no alarm for Overthreshold (RAM) today..."
else
overthreshold_ram=1
date +%Y-%m-%d >/tmp/monocloud-health/ram_usage
message+="(Current: $(echo $systemstatus | jq -r '.ram'))...\"}"
message+="(Current: $(echo $systemstatus | jq -r '.ram')%)...\"}"
curl -fsSL -X POST -H "Content-Type: application/json" -d "$message" "$WEBHOOK_URL"
fi
fi
Expand Down

0 comments on commit c094dfa

Please sign in to comment.