Skip to content
Snippets Groups Projects
Commit 561d16b8 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

v1.6: show most consuming processes if ram usage is > nn %

parent 288d9082
No related branches found
No related tags found
No related merge requests found
...@@ -22,11 +22,13 @@ ...@@ -22,11 +22,13 @@
# 2020-07-08 v1.3 <axel.hahn@iml.unibe.ch> FIX: set "ph." instead "ps." # 2020-07-08 v1.3 <axel.hahn@iml.unibe.ch> FIX: set "ph." instead "ps."
# 2020-07-16 v1.4 <axel.hahn@iml.unibe.ch> FIX: add unit MB in the performance data (see #3939) # 2020-07-16 v1.4 <axel.hahn@iml.unibe.ch> FIX: add unit MB in the performance data (see #3939)
# 2021-03-24 v1.5 <axel.hahn@iml.unibe.ch> increase Swap critical limit 5 --> 50 # 2021-03-24 v1.5 <axel.hahn@iml.unibe.ch> increase Swap critical limit 5 --> 50
# 2022-03-09 v1.6 <axel.hahn@iml.unibe.ch> show most ram intensive processes
# ====================================================================== # ======================================================================
. `dirname $0`/inc_pluginfunctions . `dirname $0`/inc_pluginfunctions
iMinRamUsageToShowProcesses=30
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# FUNCTIONS # FUNCTIONS
...@@ -105,6 +107,13 @@ echo ...@@ -105,6 +107,13 @@ echo
cat /proc/meminfo | egrep "^(Mem|Cache|Buffers|Swap|Slab|SReclaimable)" cat /proc/meminfo | egrep "^(Mem|Cache|Buffers|Swap|Slab|SReclaimable)"
# v1.6: show most consuming processes if usage is > nn %
if [ $ramUsage -gt $iMinRamUsageToShowProcesses ]; then
echo
echo "RAM usage is higher $iMinRamUsageToShowProcesses percent ... showing most consuming processes:"
ps aux | head -1; ps aux | sort -nrk 3,3 | head -n 5
fi
# --- performance data # --- performance data
ph.perfadd "memory-total" "${ramTotal}MB" "" "" 0 ${ramTotal} ph.perfadd "memory-total" "${ramTotal}MB" "" "" 0 ${ramTotal}
ph.perfadd "memory-used" "${ramUsed}MB" "" "" 0 ${ramTotal} ph.perfadd "memory-used" "${ramUsed}MB" "" "" 0 ${ramTotal}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment