-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUsed-RAM.sh
More file actions
16 lines (16 loc) · 840 Bytes
/
Used-RAM.sh
File metadata and controls
16 lines (16 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /bin/bash
dir=$(pwd)
. "$dir"/ntfy.conf
if [ "$memavail" -lt "$ram_low" ]; then curl ntfy.sh \
-d '{
"topic": "'$notifname'",
"message": "Holy smokes batman! The RAM is GONE on the server '$hostname' ! only '$memavail'Gb remaining",
"title": "RAM alert, less than '$ram_low'",
"tags": ["warning","computer"],
"priority": 4,
"click": "http://portainer.local:9000/#!/auth",
"actions": [{ "action": "view", "label": "Admin panel", "url": "http://portainer.local:9000/#!/auth" }]
}'
else echo "$dt" '|' "INFO |-Used-RAM.sh| Not overloaded, much ram left on server '$HOST'(low ram threshold is set to '$ram_low'Gb), '$memavail'Gb of free memory remaining ";
echo "$dt" '|' "INFO |-Used-RAM.sh| Not relaying any notification. Memory is mostly taken by '$ram_chk' at '$ram_per'percent |mem--> '$ram_chk' | "
fi