#!/bin/sh # # (c) 2015, Raphaƫl Droz # (c) 2014, Gilles Fauvie # Based on the 'du_multidirs' plugin, written by Christian Kujau # # Configure it by using the processes env var, i.e.: # # WARNING: SELINUX can block this plugin # # [proc_mem_by_user] # env.users munin-node jprod # # see bug: # http://munin-monitoring.org/ticket/921 # /usr/share/munin/plugins/plugin.sh (clean_fieldname()) . "$MUNIN_LIBDIR/plugins/plugin.sh" users=${users:-munin-node} if [ "$1" = autoconf ]; then ok=1 [ -z "$users" ] && ok=0 for user in $users; do ps u -U "$user" 1> /dev/null 2>&1 || ok=0 done if [ $ok = 1 ]; then echo yes else echo no; fi exit 0 fi if [ "$1" = config ]; then cat < 1 { sum += $6 }; END { print sum * 1024 }') echo "$munin_safe_name.value ${sum:-U}" done