-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
729232c
commit 5535cd6
Showing
4 changed files
with
61 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
FOLDER_PATH=/usr/local/addons/redmatic | ||
|
||
REFERENCE_SIZE=$1 | ||
|
||
#calculate size of folder | ||
SIZE=$(/usr/bin/du -s $FOLDER_PATH | /usr/bin/awk '{print $1}') | ||
|
||
#convert size to MB | ||
MBSIZE=$((SIZE / 1024)) | ||
|
||
#output size so Monit can capture it | ||
echo "$FOLDER_PATH disk $MBSIZE MB usage [$REFERENCE_SIZE MB allowed]" | ||
|
||
#provide status code for alert | ||
if [[ $MBSIZE -gt $(( $REFERENCE_SIZE )) ]]; then | ||
exit 1 | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CHECK PROCESS redmatic-nodered MATCHING '^node-red\s*$' | ||
GROUP redmatic | ||
MODE PASSIVE | ||
ONREBOOT NOSTART | ||
|
||
if memory usage > 200 MB then alert | ||
if cpu > 90% for 2 cycles then alert | ||
if disk write rate > 1 MB/s for 2 cycles then alert | ||
if failed | ||
host localhost | ||
port 1880 | ||
protocol http | ||
request "/addons/red/" | ||
then alert | ||
|
||
CHECK PROGRAM redmatic-diskusage with path "/usr/local/addons/redmatic/bin/monit-du.sh 512" | ||
GROUP redmatic | ||
MODE PASSIVE | ||
ONREBOOT NOSTART | ||
every "23 3 * * *" | ||
if status != 0 then alert | ||
|
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