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 Dec 28, 2023
1 parent ee64298 commit 90257e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/alarm_du_v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ convertToProper() {

report() {
local underthreshold=0
message="{\"text\": \"[ÇÖZÜLDÜ] - [ $(hostname) ${SERVER_NICK:+($SERVER_NICK)} ] Bölüm kullanım seviyesi aşağıdaki bölümler için $THRESHOLD% seviyesinin altına indi;\n\`\`\`\n"
[[ -n "$SERVER_NICK" ]] && alarm_hostname=$SERVER_NICK || alarm_hostname="$(hostname)"
message="{\"text\": \"[ÇÖZÜLDÜ] - [ $alarm_hostname ] Bölüm kullanım seviyesi aşağıdaki bölümler için $THRESHOLD% seviyesinin altına indi;\n\`\`\`\n"
table="$(printf '%-5s | %-10s | %-10s | %-50s | %s' '%' 'Used' 'Total' 'Partition' 'Mount Point')"
table+='\n'
for z in $(seq 1 110); do table+="$(printf '-')"; done
Expand Down Expand Up @@ -132,7 +133,8 @@ report() {


local overthreshold=0
message="{\"text\": \"[UYARI] - [ $(hostname) ] Bölüm kullanım seviyesi aşağıdaki bölümler için $THRESHOLD% seviyesinin üstüne çıktı;\n\`\`\`\n"
[[ -n "$SERVER_NICK" ]] && alarm_hostname=$SERVER_NICK || alarm_hostname="$(hostname)"
message="{\"text\": \"[UYARI] - [ $alarm_hostname ] Bölüm kullanım seviyesi aşağıdaki bölümler için $THRESHOLD% seviyesinin üstüne çıktı;\n\`\`\`\n"
table="$(printf '%-5s | %-10s | %-10s | %-50s | %s' '%' 'Used' 'Total' 'Partition' 'Mount Point')\n"
for z in $(seq 1 110); do table+="$(printf '-')"; done
local oldifs=$IFS
Expand All @@ -158,7 +160,7 @@ report() {
date +%Y-%m-%d > /tmp/alarm_du/${mountpoint//\//_}
overthreshold=1
fi
table+="\n$(printf '%-5s | %-10s | %-10s | %-35s | %-35s' $percentage% $usage $total $partition ${mountpoint//sys_root/})"
table+="\n$(printf '%-5s | %-10s | %-10s | %-50s | %-35s' $percentage% $usage $total $partition ${mountpoint//sys_root/})"
done
message+="$table\n\`\`\`\"}"
IFS=$oldifs
Expand Down

0 comments on commit 90257e7

Please sign in to comment.