[checkmk-commits] Check_MK Git: check_mk: windows agent: add debug output for logfiles

git version control git at mathias-kettner.de
Fri Nov 2 11:34:18 CET 2012


Module: check_mk
Branch: master
Commit: 0cf521ec3a1e918622ac138b2e2a1433af32478c
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0cf521ec3a1e918622ac138b2e2a1433af32478c

Author: Andreas Boesl <ab at mathias-kettner.de>
Date:   Fri Nov  2 11:34:15 2012 +0100

windows agent: add debug output for logfiles

---

 agents/windows/check_mk_agent.cc  |    7 ++++++-
 agents/windows/check_mk_agent.exe |  Bin 109056 -> 109568 bytes
 agents/windows/install_agent.exe  |  Bin 129863 -> 129945 bytes
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index c9d988f..3d7fc69 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -1448,10 +1448,13 @@ void update_or_create_logwatch_textfile(const char *full_filename, pattern_conta
                                              (((unsigned long long)fileinfo.nFileSizeHigh) << 32);
 
                 if (file_id != textfile->file_id) {                // file has been changed 
+                    printf("File id has been changed %s\n", full_filename);
                     textfile->offset = 0;
                     textfile->file_id = file_id;
-                } else if (textfile->file_size < textfile->offset) // file has been truncated
+                } else if (textfile->file_size < textfile->offset) { // file has been truncated
+                    printf("File has been truncated %s\n", full_filename);
                     textfile->offset = 0;
+                }
 
                 textfile->missing = false; 
             }
@@ -1597,6 +1600,7 @@ void cleanup_logwatch()
 bool process_textfile(FILE *file, logwatch_textfile* textfile, SOCKET &out, bool write_output) {
     char line[4096];
     condition_pattern *pattern = 0;
+    printf("Checking file %s\n", textfile->path);
     while (!feof(file)) {
         if (!fgets(line, sizeof(line), file))
             break;
@@ -2823,6 +2827,7 @@ void read_config_file()
         }
     }
     fclose(file);
+    print_logwatch_config();
 }
 
 
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index 7a57f13..05bdcf9 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index e9ebd19..e34e830 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe differ



More information about the checkmk-commits mailing list