Module: check_mk
Branch: master
Commit: 2edb7a36960662af027a79e8bc336f9ec5307152
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2edb7a36960662…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue May 28 11:34:12 2013 +0200
windows agent now outputs 32/64 bit architecture in <<<check_mk>>>
section
---
agents/windows/check_mk_agent.cc | 66 ++++++++++++++++++++++----------------
1 file changed, 39 insertions(+), 27 deletions(-)
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 930a5d0..a69b596 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -45,11 +45,11 @@
#include <stdio.h>
#include <stdint.h>
+#include <winsock2.h>
#include <windows.h>
#include <winbase.h>
#include <winreg.h> // performance counters from registry
#include <tlhelp32.h> // list of processes
-#include <winsock2.h>
#include <stdarg.h>
#include <time.h>
#include <locale.h>
@@ -108,6 +108,16 @@
#define DEFAULT_PLUGIN_TIMEOUT 30
#define DEFAULT_TOTAL_PLUGINS_TIMEOUT 60
+// Check compilation environment 32/64 bit
+#if _WIN32 || _WIN64
+ #if _WIN64
+ #define ENVIRONMENT64
+ #else
+ #define ENVIRONMENT32
+ #endif
+#endif
+
+
// Needed for only_from
struct ipspec {
uint32_t address;
@@ -1438,33 +1448,30 @@ void load_logwatch_offsets()
}
}
-
-
-
// debug output
-void print_logwatch_config()
-{
- printf("\nLOGWATCH CONFIG\n=================\nFILES\n");
- for (unsigned int i = 0; i < g_num_logwatch_textfiles ; i++) {
- printf(" %s %u %x missing %d\n", g_logwatch_textfiles[i]->path,
- (unsigned int)g_logwatch_textfiles[i]->offset,
- (unsigned int) g_logwatch_textfiles[i]->patterns,
- g_logwatch_textfiles[i]->missing);
- }
- printf("\n");
-
- printf("GLOBS\n");
- for (unsigned int i = 0; i < g_num_logwatch_globlines ; i++) {
- printf("Globline Container %x\n", (unsigned
int)g_logwatch_globlines[i]->patterns);
- for (int j = 0; j < g_logwatch_globlines[i]->num_tokens ; j++)
- printf(" %s\n",
g_logwatch_globlines[i]->token[j]->pattern);
- printf("Pattern Container\n");
- for (int j = 0; j < g_logwatch_globlines[i]->patterns->num_patterns;
j++)
- printf(" %c %s\n",
g_logwatch_globlines[i]->patterns->patterns[j]->state,
-
g_logwatch_globlines[i]->patterns->patterns[j]->glob_pattern);
- }
- printf("\n");
-}
+//void print_logwatch_config()
+//{
+// printf("\nLOGWATCH CONFIG\n=================\nFILES\n");
+// for (unsigned int i = 0; i < g_num_logwatch_textfiles ; i++) {
+// printf(" %s %u %x missing %d\n", g_logwatch_textfiles[i]->path,
+// (unsigned int)g_logwatch_textfiles[i]->offset,
+// (unsigned int) g_logwatch_textfiles[i]->patterns,
+// g_logwatch_textfiles[i]->missing);
+// }
+// printf("\n");
+//
+// printf("GLOBS\n");
+// for (unsigned int i = 0; i < g_num_logwatch_globlines ; i++) {
+// printf("Globline Container %x\n", (unsigned
int)g_logwatch_globlines[i]->patterns);
+// for (int j = 0; j < g_logwatch_globlines[i]->num_tokens ; j++)
+// printf(" %s\n",
g_logwatch_globlines[i]->token[j]->pattern);
+// printf("Pattern Container\n");
+// for (int j = 0; j < g_logwatch_globlines[i]->patterns->num_patterns;
j++)
+// printf(" %c %s\n",
g_logwatch_globlines[i]->patterns->patterns[j]->state,
+//
g_logwatch_globlines[i]->patterns->patterns[j]->glob_pattern);
+// }
+// printf("\n");
+//}
// Add a new state pattern to the current pattern container
void add_condition_pattern(char state, char *value)
@@ -2300,6 +2307,11 @@ void section_check_mk(SOCKET &out)
crash_log("<<<check_mk>>>");
output(out, "<<<check_mk>>>\n");
output(out, "Version: %s\n", CHECK_MK_VERSION);
+ #ifdef ENVIRONMENT32
+ output(out, "Architecture: 32bit\n");
+ #else
+ output(out, "Architecture: 64bit\n");
+ #endif
output(out, "AgentOS: windows\n");
output(out, "Hostname: %s\n", g_hostname);
output(out, "WorkingDirectory: %s\n", g_current_directory);