From: Wouter Wijngaards Date: Mon, 8 Jun 2009 15:43:15 +0000 (+0000) Subject: munin show total memory if sbrk trick does not work (eg. FreeBSD). X-Git-Tag: release-1.3.1~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=baaaae857aa4dbb9268a00c0c6eacb4132a27ca6;p=thirdparty%2Funbound.git munin show total memory if sbrk trick does not work (eg. FreeBSD). git-svn-id: file:///svn/unbound/trunk@1645 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/contrib/unbound_munin_ b/contrib/unbound_munin_ index 0754217ba..ae291348a 100755 --- a/contrib/unbound_munin_ +++ b/contrib/unbound_munin_ @@ -437,7 +437,21 @@ queue) done ;; memory) - for x in mem.total.sbrk mem.cache.rrset mem.cache.message \ + mn=`echo mem.total.sbrk | sed $ABBREV | tr . _` + get_value 'mem.total.sbrk' + if test $value -eq 0; then + chk=`echo $ctrl | sed -e 's/-control$/-checkconf/'` + pidf=`$chk -o pidfile $conf 2>&1` + pid=`cat $pidf 2>&1` + value=`ps -p "$pid" -o rss= 2>&1` + if test "`expr $value + 1 - 1 2>&1`" = "$value"; then + value=`expr $value \* 1024` + else + value=0 + fi + fi + echo "$mn.value" $value + for x in mem.cache.rrset mem.cache.message \ mem.mod.iterator mem.mod.validator; do print_value $x done diff --git a/doc/Changelog b/doc/Changelog index 5a7167aa8..33a63f5c8 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -7,6 +7,7 @@ - fix lint from complaining on ldns/sha.h. - help compiler figure out aliasing in priv_rrset_bad() routine. - fail to configure with python if swig is not found. + - unbound_munin_ in contrib uses ps to show rss if sbrk does not work. 3 June 2009: Wouter - fixup bad free() when wrongly encoded DSA signature is seen. diff --git a/doc/TODO b/doc/TODO index 02c66b2c0..28a5d947c 100644 --- a/doc/TODO +++ b/doc/TODO @@ -70,8 +70,6 @@ o infra and lame cache: easier size config (in Mb), show usage in graphs. - winevent - poll if too many fds - ssl open apache style - fwd above stub, make hole in fwds -- munin use ps to print total mem -- no swig, but ask python, configure fails. - fix indent # ifs - flush_* remove msg cache entry if one. - do not flush/delete callback queries or call error on callback at least.