Module: check_mk
Branch: master
Commit: 46a560ff31e220a251bae78f775384e5203f88b8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=46a560ff31e220…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Apr 2 12:37:09 2013 +0200
* windows_agent: Now buffers output before writing it to the socket
Results in less tcp packages per call
---
ChangeLog | 2 ++
agents/windows/check_mk_agent.cc | 35 ++++++++++++++++++++++++++++-------
agents/windows/check_mk_agent.exe | Bin 111104 -> 111104 bytes
agents/windows/install_agent.exe | Bin 130870 -> 130952 bytes
4 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d8d5d1c..531df24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,6 +55,8 @@
* agent_vsphere: New VMWare ESX monitoring that uses pySphere and the VMWare
API in order to get data very efficiently. Read (upcoming) documentation
for details.
+ * windows_agent: Now buffers output before writing it to the socket
+ Results in less tcp packages per call
Notifications:
* notify.py: unique spoolfiles name no longer created with uuid
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 2aea327..9fddea0 100755
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -156,6 +156,7 @@ bool verbose_mode = false;
bool g_crash_debug = false;
bool do_tcp = false;
bool should_terminate = false;
+bool force_tcp_output = false; // if true, send socket data immediately
char g_hostname[256];
// sections enabled (configurable in check_mk.ini)
@@ -3076,13 +3077,21 @@ void listen_tcp_loop()
void output(SOCKET &out, const char *format, ...)
{
- static char outbuffer[4096];
-
+ static char outbuffer[16384];
+ static int len = 0;
va_list ap;
va_start(ap, format);
- int len = vsnprintf(outbuffer, sizeof(outbuffer), format, ap);
+ int written_len = vsnprintf(outbuffer + len, sizeof(outbuffer) - len, format, ap);
+ len += written_len;
+
+ // We do not send out the data immediately
+ // This would lead to many small tcp packages
+ bool write_to_socket = false;
+ if (force_tcp_output || len > 1300)
+ write_to_socket = true;
+
if (do_tcp) {
- while (!should_terminate) {
+ while (write_to_socket && !should_terminate) {
int result = send(out, outbuffer, len, 0);
if (result == SOCKET_ERROR) {
debug("send() failed");
@@ -3105,9 +3114,14 @@ void output(SOCKET &out, const char *format, ...)
}
}
else if (result == 0)
- debug("send() returned 0");
- else if (result != len)
- debug("send() sent too few bytes");
+ debug("send() returned 0");
+ else if (result != len) {
+ debug("send() sent too few bytes");
+ len -= result;
+ }
+ else
+ len = 0;
+
break;
}
}
@@ -3202,6 +3216,13 @@ void output_data(SOCKET &out)
section_mrpe(out);
if (enabled_sections & SECTION_SYSTEMTIME)
section_systemtime(out);
+
+ // Send remaining data in out buffer
+ if (do_tcp) {
+ force_tcp_output = true;
+ output(out, "");
+ force_tcp_output = false;
+ }
}
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index e1fbb05..abb7633 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 9b001ac..401e933 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe differ
Module: check_mk
Branch: master
Commit: ab381ee6f5ea9b24cab05e9cbf70b7b11b4a712c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab381ee6f5ea9b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 2 12:09:53 2013 +0200
Updated bug entries #0904
---
.bugs/904 | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 82 insertions(+), 8 deletions(-)
diff --git a/.bugs/904 b/.bugs/904
index 5ad2898..f445b78 100644
--- a/.bugs/904
+++ b/.bugs/904
@@ -1,11 +1,85 @@
-Title: References like \1 \2 to regex groups do not work in "expect regular messages" mode
+Title: Support event processing (eg cancelling) after rewriting
Component: ec
-Class: bug
-State: wontfix
-Date: 2013-01-31 11:17:10
-Targetversion: 1.2.2
+State: open
+Date: 2013-04-02 11:48:32
+Targetversion: future
+Class: feature
-In this case, e.g. when rewriting the message text, it only shows \1 \2.
+From old ticketing system #371246:
-2013-02-11 10:41:13: changed state open -> wontfix
-Obsolete through #905
+We've located the issue. It seems like canceling events doesn't work with
+rewriting. We're sending SNMP traps from a backup server with status for
+each host, the received hostname in EC is the backup server and we're
+rewriting to the correct hostname for each backup job.
+
+When we receive the expected regular message, as a canceling event, the
+rewrite is not performed, and the previous critical event is not
+canceled.
+
+[1362647115.920606] Do not cancel event 3613: host is not the same (vmtxm01qa != vmnag01qa)
+
+Bug / Feature request?
+
+--
+Trond Viggo Håpnes
+Driftskonsulent, Buypass AS
+Direkte: +47 61 13 58 36, Mobil: +47 402 22 662
+
+> -----Original Message-----
+> From: checkmk-en-bounces(a)lists.mathias-kettner.de [mailto:checkmk-en-
+> bounces(a)lists.mathias-kettner.de] On Behalf Of Trond Viggo Håpnes
+> Sent: 6. mars 2013 12:05
+> To: checkmk-en(a)lists.mathias-kettner.de
+> Subject: [Check_mk (english)] Eventconsole - Expect regular messages
+>
+> Anyone managed to implemt "Expect regular messages" in eventconsole?
+>
+> We're trying to monitor backup jobs, but can't get "canceling event"
+> working. From the documentation I can't figure out how the rule
+> should be configured.
+>
+> In the criteria section I've configured, "Text to match",
+> "Match host", "Match syslog ..." and "Text to cancel event. In the
+> Counting & timing section I've checked the "Expect regular messages"
+> and
+> tested with several intervals and merging settings. And set the state
+> to CRIT.
+>
+> With the tryout function I do get a green light with canceling status
+> on
+> the correct rule.
+>
+> When I send a message which should cancel the event with "Generate
+> Event",
+> nothing happens. The critical event on the host is not canceled.
+>
+> Is this the correct way to implement this kind of monitoring?
+>
+> Running Check_MK 1.2.2b3, not OMD.
+>
+> --
+> Trond Viggo Håpnes
+> Driftskonsulent, Buypass AS
+>
+>
+> _______________________________________________
+> checkmk-en mailing list
+> checkmk-en(a)lists.mathias-kettner.de
+> http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en
+------------------------------------------------
+
+
+Hello,
+
+this is a missing informationen in our documentation.
+
+The processing of events is befor the rewriting. This behavior isnt easy to change.
+
+----------------------------------
+
+Ok. An easier approach could be to make it possible to disable the host
+check in the "Matching criteria" for "cancel event"?
+
+We've commented out the check in the code. And we now have functional
+backup monitoring. I guess there will be others with similar
+requirements.
Module: check_mk
Branch: master
Commit: f110670f3c5c12764f3b4fbcb738adb066b134e6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f110670f3c5c12…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Apr 2 11:12:00 2013 +0200
FIX: mssql.vbs (agent plugin) now sets auth options for each instance
---
ChangeLog | 1 +
agents/windows/plugins/mssql.vbs | 7 ++++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cb7d14a..83ccc14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -93,6 +93,7 @@
* FIX: check_mk-mssql_counters.transactions: fix computation also
* check_http: now support the option -L (urlizing the result)
* Added mem section to Mac OSX agent (Thanks to Brad Davis)
+ * FIX: mssql.vbs (agent plugin) now sets auth options for each instance
Multisite:
* FIX: fix localization in non-OMD environment
diff --git a/agents/windows/plugins/mssql.vbs b/agents/windows/plugins/mssql.vbs
index 80ffd7d..dc7eaa4 100644
--- a/agents/windows/plugins/mssql.vbs
+++ b/agents/windows/plugins/mssql.vbs
@@ -88,15 +88,16 @@ hostname = WScript.CreateObject("WScript.Shell").ExpandEnvironmentStrings("%COMP
Set CONN = CreateObject("ADODB.Connection")
Set RS = CreateObject("ADODB.Recordset")
CONN.Provider = "sqloledb"
+
' Select a special DB
'CONN.Properties("Initial Catalog").Value = "test123"
-' At this place one could implement to user other authentication mechanism
-CONN.Properties("Integrated Security").Value = "SSPI"
-
' Loop all found server instances and connect to them
' In my tests only the connect using the "named instance" string worked
For Each instId In instIds.Keys
+ ' At this place one could implement to use other authentication mechanism
+ CONN.Properties("Integrated Security").Value = "SSPI"
+
If InStr(instId, "_") <> 0 Then
instName = Split(instId, "_")(1)
Else
Module: check_mk
Branch: master
Commit: 6539e8a9f57403115e59361b7f6b71b3a82e3ee0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6539e8a9f57403…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Apr 1 20:41:29 2013 +0200
FIX: remove some trailing spaces in sidebar.py
---
web/htdocs/sidebar.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 7f5cbc5..48e16ae 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -419,9 +419,9 @@ def ajax_speedometer():
scheduled_rate = html.live.query_summed_stats(
"GET hosts\n"
"Stats: suminv check_interval\n")[0] / 60.0
-
- # 2. Now get data of all active services and of passive/non-check_mk-services.
- # For passive services we assume that they are scheduled with the rate the
+
+ # 2. Now get data of all active services and of passive/non-check_mk-services.
+ # For passive services we assume that they are scheduled with the rate the
# is configured via "check_interval". Nagios does not use this setting for i
# passive checks, but we have no other option.
scheduled_rate += html.live.query_summed_stats(