Module: check_mk
Branch: master
Commit: 33d7591216aaa2e9e407ef820b560a05d6c75b58
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=33d7591216aaa2…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Jan 17 16:10:14 2013 +0100
FIX: startup crash when no textfile is specified and pattern is added
---
ChangeLog | 3 +++
agents/windows/check_mk.example.ini | 24 ++++++++++++------------
agents/windows/check_mk_agent.cc | 6 ++++++
agents/windows/check_mk_agent.exe | Bin 110592 -> 111104 bytes
agents/windows/install_agent.exe | Bin 125348 -> 130870 bytes
5 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8e2cbf8..d54847b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,9 @@
* FIX: megaraid_bbu - Handle missing charge information (ignoring them)
* FIX: myssql_tablespaces - fix PNP graph (thanks to Christian Zock)
* kernel.util: add "Average" information to PNP graph
+ * Windows Agent: Fix startup crash on adding a logfiles pattern, but no logfile
specified
+ * Windows Agent: check_mk.example.ini: commented logfiles section
+
Multisite:
* FIX: Fixed rendering of dashboard globes in opera
diff --git a/agents/windows/check_mk.example.ini b/agents/windows/check_mk.example.ini
index bfa9302..2929fc6 100644
--- a/agents/windows/check_mk.example.ini
+++ b/agents/windows/check_mk.example.ini
@@ -23,19 +23,19 @@
[logfiles]
- # Define textfiles to be monitored, separated by |
- textfile = C:\tmp logfiles\message_*.log|D:\log\sample.txt
- # Set patterns for defined textfiles
- ok = Successfully logged in*
- crit = Error in*
- warn = Unable to contact*
- ignore = Backup * saved
+ # # Define textfiles to be monitored, separated by |
+ # textfile = C:\tmp logfiles\message_*.log|D:\log\sample.txt
+ # # Set patterns for defined textfiles
+ # ok = Successfully logged in*
+ # crit = Error in*
+ # warn = Unable to contact*
+ # ignore = Backup * saved
- # Define additional textfiles with different patterns
- textfile = C:\tmp\memo.udf
- # Set patterns for defined textfile
- warn = *overdue*
- ok = *mail sent*
+ # # Define additional textfiles with different patterns
+ # textfile = C:\tmp\memo.udf
+ # # Set patterns for defined textfile
+ # warn = *overdue*
+ # ok = *mail sent*
[logwatch]
# Testing: output *all* messages from the eventlogs
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 85da879..4f2e132 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -1450,6 +1450,12 @@ void print_logwatch_config()
// Add a new state pattern to the current pattern container
void add_condition_pattern(char state, char *value)
{
+ if (g_current_globline_container == NULL) {
+ fprintf(stderr, "You need to set a textfile, before specifying a condition
pattern\n");
+ return;
+ }
+
+
if (g_current_globline_container
&& g_current_globline_container->patterns->num_patterns + 1 >=
MAX_LOGWATCH_CONDITIONS)
{
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index bd4f5ec..202aa7e 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 e68f6ef..06922ac 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe
differ