Module: check_mk
Branch: master
Commit: f61a59a68e8e436b8bf1df4d69798b5c7074ef4c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f61a59a68e8e43…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 9 08:50:10 2010 +0100
Windows Agent provides uptime of the system now
Applied patch 0001-Windows-Agent-add-uptime-funktion.patch from Josef
Hack. Thanks!
---
agents/windows/check_mk_agent.cc | 13 +++++++++++++
agents/windows/check_mk_agent.exe | Bin 95232 -> 95232 bytes
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index f7c8f43..4e26b73 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -220,6 +220,18 @@ void output(SOCKET &out, const char *format, ...)
}
+void section_uptime(SOCKET &out)
+{
+ output(out, "<<<uptime>>>\n");
+ static LARGE_INTEGER Frequency,Ticks;
+ QueryPerformanceFrequency (&Frequency);
+ QueryPerformanceCounter (&Ticks);
+ Ticks.QuadPart = Ticks.QuadPart - Frequency.QuadPart;
+ unsigned int uptime = (double)Ticks.QuadPart / Frequency.QuadPart;
+ output(out, "%s\n", llu_to_string(uptime));
+}
+
+
void section_df(SOCKET &out)
{
output(out, "<<<df>>>\n");
@@ -1094,6 +1106,7 @@ void output_data(SOCKET &out)
setlocale(LC_ALL, "C");
section_check_mk(out);
+ section_uptime(out);
section_df(out);
section_ps(out);
section_mem(out);
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 263adc5..42b81e5 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe
differ