]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
munin show total memory if sbrk trick does not work (eg. FreeBSD).
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 8 Jun 2009 15:43:15 +0000 (15:43 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 8 Jun 2009 15:43:15 +0000 (15:43 +0000)
git-svn-id: file:///svn/unbound/trunk@1645 be551aaa-1e26-0410-a405-d3ace91eadb9

contrib/unbound_munin_
doc/Changelog
doc/TODO

index 0754217ba3032b9e39ec904c459a480362970a26..ae291348a7dccc4848e61a0179ca46fe99316fde 100755 (executable)
@@ -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
index 5a7167aa8d06906956a8756a353f607b891b8a1a..33a63f5c8d97f34afb72aab0a5485691f44844cf 100644 (file)
@@ -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.
index 02c66b2c01c5f15b0b87f1e26a18fa6404a58dfb..28a5d947c951e291be366620826105c0f36c6715 100644 (file)
--- 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.