From b0ca04e1baf9a3405bfb50d7c3d95e8e425f4c3e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 12 Sep 2008 00:40:06 +0200 Subject: Serverstatus zeigt die Speicherauslastung an --- src/Core/RequestHandler/CoreStatusRequestHandler.h | 8 ++++++-- src/Core/RequestHandler/Makefile.in | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Core/RequestHandler') diff --git a/src/Core/RequestHandler/CoreStatusRequestHandler.h b/src/Core/RequestHandler/CoreStatusRequestHandler.h index eec0154..ec94bb5 100644 --- a/src/Core/RequestHandler/CoreStatusRequestHandler.h +++ b/src/Core/RequestHandler/CoreStatusRequestHandler.h @@ -44,9 +44,13 @@ class CoreStatusRequestHandler : public Common::RequestHandler { if(packet.getType() != Net::Packet::TYPE_CORE_STATUS) return false; // TODO Logging - Common::SystemBackend::Uptime uptime = Common::SystemBackend::getBackend()->getUptime(); + // TODO Require authentication - if(!connection->send(Net::Packets::CoreStatusPacket(Net::Packet::TYPE_OK, packet.getRequestId(), uptime.uptime, uptime.idleTime))) + Common::SystemBackend::UptimeInfo uptimeInfo = Common::SystemBackend::getBackend()->getUptimeInfo(); + Common::SystemBackend::MemoryInfo memInfo = Common::SystemBackend::getBackend()->getMemoryInfo(); + + if(!connection->send(Net::Packets::CoreStatusPacket(Net::Packet::TYPE_OK, packet.getRequestId(), uptimeInfo.uptime, uptimeInfo.idleTime, + memInfo.totalMem, memInfo.freeMem, memInfo.totalSwap, memInfo.freeSwap))) return false; setFinished(); diff --git a/src/Core/RequestHandler/Makefile.in b/src/Core/RequestHandler/Makefile.in index bea3870..2d1cbee 100644 --- a/src/Core/RequestHandler/Makefile.in +++ b/src/Core/RequestHandler/Makefile.in @@ -102,6 +102,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRECPP_CFLAGS = @PCRECPP_CFLAGS@ +PCRECPP_LIBS = @PCRECPP_LIBS@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ -- cgit v1.2.3