Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NoCloud-Auto-Installer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
NoCloud-Auto-Installer
Commits
4877d416
Verified
Commit
4877d416
authored
3 months ago
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Add setting for DISC overload
parent
03152235
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.env.sample
+2
-0
2 additions, 0 deletions
main.env.sample
upgrade/Monit.sh
+2
-2
2 additions, 2 deletions
upgrade/Monit.sh
with
4 additions
and
2 deletions
main.env.sample
+
2
−
0
View file @
4877d416
...
@@ -39,3 +39,5 @@ export CPU_OVERLOAD_TIME=30 # 1h by default
...
@@ -39,3 +39,5 @@ export CPU_OVERLOAD_TIME=30 # 1h by default
export MEM_OVERLOAD_TIME=30 # 1h by default
export MEM_OVERLOAD_TIME=30 # 1h by default
# MEM_OVERLOAD_PERCENT is percent of memory usage. The number needs to be between 0 and 100
# MEM_OVERLOAD_PERCENT is percent of memory usage. The number needs to be between 0 and 100
export MEM_OVERLOAD_PERCENT=75 # 75% by default
export MEM_OVERLOAD_PERCENT=75 # 75% by default
# DISC_OVERLOAD_PERCENT is percent of disc usage. The number needs to be between 0 and 100
export DISC_OVERLOAD_PERCENT=75 # 75% by default
This diff is collapsed.
Click to expand it.
upgrade/Monit.sh
+
2
−
2
View file @
4877d416
...
@@ -30,7 +30,7 @@ echo "" > ./$$-parts
...
@@ -30,7 +30,7 @@ echo "" > ./$$-parts
for
part
in
"
${
list_of_part
[@]
}
"
for
part
in
"
${
list_of_part
[@]
}
"
do
do
name
=
$(
echo
$part
|
sed
-e
's@^/$@root@'
-e
's@^/@@'
)
name
=
$(
echo
$part
|
sed
-e
's@^/$@root@'
-e
's@^/@@'
)
echo
-e
"check device
$name
with path
$part
\n
if SPACE usage > 75% then alert
\n\n
"
>>
./
$$
-parts
echo
-e
"check device
$name
with path
$part
\n
if SPACE usage >
echo
${
MEM_OVERLOAD_PERCENT
:-
75
}
% then alert
\n\n
"
>>
./
$$
-parts
done
done
mv
./
$$
-parts
/etc/monit/conf-available/disc
mv
./
$$
-parts
/etc/monit/conf-available/disc
ln
-s
/etc/monit/conf-available/disc /etc/monit/conf-enabled/
ln
-s
/etc/monit/conf-available/disc /etc/monit/conf-enabled/
...
@@ -50,7 +50,7 @@ if [ -z "$(dpkg -l | grep libmemcached-tools)" ]; then
...
@@ -50,7 +50,7 @@ if [ -z "$(dpkg -l | grep libmemcached-tools)" ]; then
fi
fi
totalmem
=
`
free
--mega
|
grep
Mem |
awk
'{print $2}'
`
totalmem
=
`
free
--mega
|
grep
Mem |
awk
'{print $2}'
`
usemax
=
$((
$totalmem
*
`
echo
${
RA
M_OVERLOAD_PERCENT
:-
75
}
`
/
100
))
usemax
=
$((
$totalmem
*
`
echo
${
ME
M_OVERLOAD_PERCENT
:-
75
}
`
/
100
))
contentMEM
=
'check system $HOST-mem
contentMEM
=
'check system $HOST-mem
if memory > '
"
$usemax
"
' MB for '
"
`
echo
${
MEM_OVERLOAD_TIME
:-
30
}
`
"
' cycles then alert'
if memory > '
"
$usemax
"
' MB for '
"
`
echo
${
MEM_OVERLOAD_TIME
:-
30
}
`
"
' cycles then alert'
## write in file
## write in file
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment