Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 180e3f89cf | |||
| 80bbf47755 |
+1
-1
@@ -1 +1 @@
|
||||
0.7.9
|
||||
0.8.1.1
|
||||
|
||||
@@ -34,14 +34,19 @@ Hosts="${Hosts} cvtt-prod-01.cvtt.vpn"
|
||||
Hosts="${Hosts} cvtt-prod-02.cvtt.vpn"
|
||||
Hosts="${Hosts} cvtt-prod-03.cvtt.vpn"
|
||||
|
||||
Metrics=()
|
||||
|
||||
function space_alert() {
|
||||
ALERT_USAGE=75%
|
||||
for ln in "${Measurements[@]}"
|
||||
for metric in "${Metrics[@]}"
|
||||
do
|
||||
IFS=$' '; args=($ln); unset IFS
|
||||
IFS=$' '; args=($metric); unset IFS
|
||||
host=${args[0]}
|
||||
fs=${args[1]}
|
||||
space_used=${args[2]}
|
||||
|
||||
echo "if [ ${space_used%?} -ge ${ALERT_USAGE%?} ]; then" >&2
|
||||
|
||||
if [ ${space_used%?} -ge ${ALERT_USAGE%?} ]; then
|
||||
echo ":red_circle: Filesystem **${host}:${fs}** is using **${space_used}** :red_circle:"
|
||||
fi
|
||||
@@ -52,6 +57,7 @@ function storage_check() {
|
||||
|
||||
result_lines=()
|
||||
|
||||
declare -a SingleMeas
|
||||
for host in ${Hosts}
|
||||
do
|
||||
if [[ "${host}" == *"cryptovaltrading.com" ]]; then
|
||||
@@ -70,7 +76,12 @@ function storage_check() {
|
||||
do
|
||||
IFS=$' '; args=($ln); unset IFS
|
||||
res="${args[5]}| **${host}** | ***${args[6]}*** | *${args[5]}* |"
|
||||
|
||||
result_lines+=("$res")
|
||||
|
||||
fs=${args[6]}
|
||||
used=${args[5]}
|
||||
Metrics+=("$host $fs $used")
|
||||
done
|
||||
unset IFS
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user