1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-09-18 16:48:44 +00:00

Light improvement in FreeBSD part of ps parsing

This commit is contained in:
Dennis Yusupoff 2010-10-21 12:38:43 +02:00 committed by Steve Schnepp
parent 0ea6b7fa9c
commit f0015e24e4

View file

@ -37,7 +37,7 @@ regex given as the process name, as reported by ps.
#%# capabilities=autoconf #%# capabilities=autoconf
=head1 VERSION =head1 VERSION
0.3 light improvement in FreeBSD part of ps parsing
0.2 second release, it should now work on machines without GNU sed 0.2 second release, it should now work on machines without GNU sed
0.1 first release, based on: 0.1 first release, based on:
multimemory.in 1590 2008-04-17 18:21:31Z matthias multimemory.in 1590 2008-04-17 18:21:31Z matthias
@ -91,7 +91,7 @@ for name in $names; do
printf "$fieldname.value " printf "$fieldname.value "
if [ "$os" = "freebsd" ]; then if [ "$os" = "freebsd" ]; then
ps auxww | grep -w $name | grep -v grep | sed -Ee 's/[ ]{1,}/ /g' | /usr/bin/cut -d ' ' -f 6 | /usr/bin/awk '{ total = total + $1 } END { print total * 1024 }' ps awxo rss,command | grep -w $name | grep -v grep | /usr/bin/awk '{ total += $1 } END { print total * 1024 }'
else else
ps auxww | grep -w $name | grep -v grep | sed -re 's/[ ]{1,}/ /g' | /usr/bin/cut -d ' ' -f 6 | /usr/bin/awk '{ total = total + $1 } END { print total * 1024 }' ps auxww | grep -w $name | grep -v grep | sed -re 's/[ ]{1,}/ /g' | /usr/bin/cut -d ' ' -f 6 | /usr/bin/awk '{ total = total + $1 } END { print total * 1024 }'
fi fi