From: Dennis Schafroth Date: Mon, 28 Mar 2011 08:54:56 +0000 (+0200) Subject: Malloc info in server-status X-Git-Tag: v1.5.5~6 X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=commitdiff_plain;h=6b40da0ef0f434e21322ec41d92a01a3d1a215f3;p=pazpar2-moved-to-github.git Malloc info in server-status --- diff --git a/etc/check-pazpar2.sh b/etc/check-pazpar2.sh index c5d97d6..de11de4 100755 --- a/etc/check-pazpar2.sh +++ b/etc/check-pazpar2.sh @@ -63,6 +63,6 @@ if [ "$CRIT_LEVEL" != "" ] ; then fi fi -echo "SESSIONS $MSG $SESSIONS ($CLIENTS) | $SESSIONS;$WARN_LEVEL;$CRIT_LEVEL " +echo "SESSIONS $MSG $SESSIONS ($CLIENTS) [$VIRT,$VIRTUSE,$AREA,$ORDBLKS,$UORDBLKS,$FORDBLKS,$KEEPCOST,$HBLKS,$HBLKHD] | $SESSIONS;$WARN_LEVEL;$CRIT_LEVEL " exit $rc diff --git a/etc/server-status-nagios.xsl b/etc/server-status-nagios.xsl index 56f53fa..9a2b21b 100644 --- a/etc/server-status-nagios.xsl +++ b/etc/server-status-nagios.xsl @@ -8,6 +8,10 @@ + + + + export SESSIONS= @@ -20,7 +24,42 @@ export RESULTSETS= - + + AREA= + + + + ORDBLKS= + + + + UORDBLKS= + + + + FORDBLKS= + + + + KEEPCOST= + + + + HBLKS= + + + + HBLKHD= + + VIRT= + + + + VIRTUSE= + + + + diff --git a/src/http_command.c b/src/http_command.c index e8bba87..6acc2c3 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -41,6 +41,29 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "settings.h" #include "client.h" +#include + +void print_meminfo(WRBUF wrbuf) { +#ifdef __GNUC__ + struct mallinfo minfo; + minfo = mallinfo(); + wrbuf_printf(wrbuf, " \n" + " %d\n" + " %d\n" + " %d\n" + " %d\n" + " %d\n" + " %d\n" + " %d\n" + " %d\n" + " %d\n" + " \n", + minfo.arena, minfo.uordblks, minfo.fordblks,minfo.ordblks, minfo.keepcost, minfo.hblks, minfo.hblkhd, minfo.arena + minfo.hblkhd, minfo.uordblks + minfo.hblkhd); + +#endif +} + + // Update this when the protocol changes #define PAZPAR2_PROTOCOL_VERSION "1" @@ -632,6 +655,7 @@ static void cmd_server_status(struct http_channel *c) wrbuf_printf(c->wrbuf, " %u\n", clients); /* Only works if yaz has been compiled with enabling of this */ wrbuf_printf(c->wrbuf, " %u\n",resultsets); + print_meminfo(c->wrbuf); /* TODO add all sessions status */ /* http_sessions_t http_sessions = c->http_sessions; */