mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Initial version
This commit is contained in:
parent
94d9f9e09b
commit
7171ec327e
40
plugins/other/proc_mem
Executable file
40
plugins/other/proc_mem
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# (c) 2010, Rodrigo Sieiro <rsieiro@gmail.com>
|
||||
# Based on the 'du_multidirs' plugin, written by Christian Kujau <lists@nerdbynature.de>
|
||||
#
|
||||
# Configure it by using the processes env var, i.e.:
|
||||
#
|
||||
# [proc_mem]
|
||||
# env.processes munin-node apache2
|
||||
#
|
||||
|
||||
. $MUNIN_LIBDIR/plugins/plugin.sh
|
||||
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
fi
|
||||
|
||||
processes=${processes:="munin-node"}
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo 'graph_title Memory usage by process'
|
||||
echo 'graph_args --base 1024 -l 0'
|
||||
echo 'graph_vlabel Bytes'
|
||||
echo 'graph_category processes'
|
||||
echo 'graph_info This graph shows the memory usage of several processes'
|
||||
|
||||
for proc in $processes; do
|
||||
echo "$proc.label $proc"
|
||||
done
|
||||
|
||||
# echo "$u".warning 0
|
||||
# echo "$u".critical 0
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for proc in $processes; do
|
||||
echo "$proc.value " `ps u -C $proc | awk 'BEGIN { sum = 0 } NR > 1 { sum += $6 }; END { print sum * 1024 }'`
|
||||
done
|
Loading…
Reference in New Issue
Block a user