Module: check_mk
Branch: master
Commit: 5785a211ab0bbb31ea762d63aed686c15235c25b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5785a211ab0bbb…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Thu Sep 3 15:55:27 2015 +0200
#2570 FIX winperf_msx_queues: fixed crash when winperf data is missing
---
.werks/2570 | 13 +++++++++++++
ChangeLog | 1 +
agents/windows/build_version | 2 +-
agents/windows/check_mk_agent-64.exe | Bin 307712 -> 307712 bytes
agents/windows/check_mk_agent-64.unversioned.exe | Bin 307712 -> 307712 bytes
agents/windows/check_mk_agent.cc | 18 ++++++++++++++++--
agents/windows/check_mk_agent.exe | Bin 190464 -> 190976 bytes
agents/windows/check_mk_agent.msi | Bin 747008 -> 747520 bytes
agents/windows/check_mk_agent.unversioned.exe | Bin 190464 -> 190976 bytes
agents/windows/install_agent-64.exe | Bin 181024 -> 181093 bytes
agents/windows/install_agent.exe | Bin 163072 -> 163075 bytes
checks/winperf_msx_queues | 7 ++++---
12 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/.werks/2570 b/.werks/2570
new file mode 100644
index 0000000..9516b57
--- /dev/null
+++ b/.werks/2570
@@ -0,0 +1,13 @@
+Title: winperf_msx_queues: fixed crash when winperf data is missing
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1441287640
+
+Previously the windows agent would return empty sections if it couldn't retrieve performance data.
+The winperf_msx_queues check responded to this empty section by crashing.
+This has been fixed by making sure the agent doesn't return empty winperf sections and by making the
+check handle empty sections gracefully
diff --git a/ChangeLog b/ChangeLog
index 9126678..730017f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -166,6 +166,7 @@
* 1290 FIX: brocade_mlx_fan: Fix: Not longer add fans who not are present while discovery
* 2569 FIX: fixed crash in aix lvm check after volume disappears...
* 2559 FIX: job: Trying to read job result files as non root when agent is not executed as root
+ * 2570 FIX: winperf_msx_queues: fixed crash when winperf data is missing...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce unhandled exceptions...
diff --git a/agents/windows/build_version b/agents/windows/build_version
index 0d38910..9d683f8 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-212
+214
diff --git a/agents/windows/check_mk_agent-64.exe b/agents/windows/check_mk_agent-64.exe
index ad4a729..2d32de7 100755
Binary files a/agents/windows/check_mk_agent-64.exe and b/agents/windows/check_mk_agent-64.exe differ
diff --git a/agents/windows/check_mk_agent-64.unversioned.exe b/agents/windows/check_mk_agent-64.unversioned.exe
index e76e106..646279a 100755
Binary files a/agents/windows/check_mk_agent-64.unversioned.exe and b/agents/windows/check_mk_agent-64.unversioned.exe differ
diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc
index 68117b5..e8b21f6 100644
--- a/agents/windows/check_mk_agent.cc
+++ b/agents/windows/check_mk_agent.cc
@@ -868,10 +868,8 @@ void outputCounterValue(SOCKET &out, PERF_COUNTER_DEFINITION *counterPtr, PERF_C
void dump_performance_counters(SOCKET &out, unsigned counter_base_number, const char *countername)
{
crash_log("<<<winperf_%s>>>", countername);
- output(out, "<<<winperf_%s>>>\n", countername);
static LARGE_INTEGER Frequency;
QueryPerformanceFrequency (&Frequency);
- output(out, "%.2f %u %lu\n", current_time(), counter_base_number, Frequency.QuadPart);
// registry entry is ascii representation of counter index
char counter_index_name[8];
@@ -912,6 +910,10 @@ void dump_performance_counters(SOCKET &out, unsigned counter_base_number, const
// Determine first object in list of objects
PERF_OBJECT_TYPE *objectPtr = FirstObject(dataBlockPtr);
+ // awkward way to ensure we really really only create the section header if there
+ // are performance counters
+ bool first_counter = true;
+
// Now walk through the list of objects. The bad news is:
// even if we expect only one object, windows might send
// us more than one object. We need to scan a list of objects
@@ -939,6 +941,12 @@ void dump_performance_counters(SOCKET &out, unsigned counter_base_number, const
int num_instances = objectPtr->NumInstances;
if (num_instances >= 0)
{
+ if (first_counter) {
+ output(out, "<<<winperf_%s>>>\n", countername);
+ output(out, "%.2f %u %lu\n", current_time(), counter_base_number, Frequency.QuadPart);
+ first_counter = false;
+ }
+
output(out, "%d instances:", num_instances);
char name[512];
PERF_INSTANCE_DEFINITION *instancePtr = FirstInstance(objectPtr);
@@ -957,6 +965,12 @@ void dump_performance_counters(SOCKET &out, unsigned counter_base_number, const
output(out, "\n");
}
+ if (first_counter && (objectPtr->NumCounters > 0)) {
+ output(out, "<<<winperf_%s>>>\n", countername);
+ output(out, "%.2f %u %lu\n", current_time(), counter_base_number, Frequency.QuadPart);
+ first_counter = false;
+ }
+
// Now walk through the counter list a second time and output all counters
for (unsigned int b=0 ; b < objectPtr->NumCounters ; b++)
{
diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe
index abcdca8..613f67a 100755
Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe differ
diff --git a/agents/windows/check_mk_agent.msi b/agents/windows/check_mk_agent.msi
index b2d29c7..80c1f89 100755
Binary files a/agents/windows/check_mk_agent.msi and b/agents/windows/check_mk_agent.msi differ
diff --git a/agents/windows/check_mk_agent.unversioned.exe b/agents/windows/check_mk_agent.unversioned.exe
index 27818a3..6a1db6e 100755
Binary files a/agents/windows/check_mk_agent.unversioned.exe and b/agents/windows/check_mk_agent.unversioned.exe differ
diff --git a/agents/windows/install_agent-64.exe b/agents/windows/install_agent-64.exe
index 0cfb47f..57f32ba 100755
Binary files a/agents/windows/install_agent-64.exe and b/agents/windows/install_agent-64.exe differ
diff --git a/agents/windows/install_agent.exe b/agents/windows/install_agent.exe
index e08b52f..5524f41 100755
Binary files a/agents/windows/install_agent.exe and b/agents/windows/install_agent.exe differ
diff --git a/checks/winperf_msx_queues b/checks/winperf_msx_queues
index a770572..3e2ba1c 100644
--- a/checks/winperf_msx_queues
+++ b/checks/winperf_msx_queues
@@ -89,9 +89,10 @@ def inventory_winperf_msx_queues(info):
return [ (name, { "offset" : offset } ) for name, offset in queues.items() ]
def check_winperf_msx_queues(item, params, info):
- num_instances = int(info[1][0])
- if num_instances < 1:
- return (3, "no counters available, transport service running?")
+ # current windows agents should not produce winperf sections with no data after the header but
+ # this ensures compatibility with older agents
+ if len(info) < 2 or int(info[1][0]):
+ return 3, "no counters available, transport service running?"
# Old default case:
if type(params) == tuple:
Module: check_mk
Branch: master
Commit: 3ecaf5b4b0210e1c01353e096d3987c27b914350
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3ecaf5b4b0210e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 3 15:11:54 2015 +0200
#2559 FIX job: Trying to read job result files as non root when agent is not executed as root
---
.werks/2559 | 10 ++++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 6 +++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/2559 b/.werks/2559
new file mode 100644
index 0000000..2243e9e
--- /dev/null
+++ b/.werks/2559
@@ -0,0 +1,10 @@
+Title: job: Trying to read job result files as non root when agent is not executed as root
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1441285840
+
+
diff --git a/ChangeLog b/ChangeLog
index 5c83796..4296d38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -165,6 +165,7 @@
* 2558 FIX: cmciii.temp: Do not discover air temperature sensors anymore...
* 1290 FIX: brocade_mlx_fan: Fix: Not longer add fans who not are present while discovery
* 2569 FIX: fixed crash in aix lvm check after volume disappears...
+ * 2559 FIX: job: Trying to read job result files as non root when agent is not executed as root
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce unhandled exceptions...
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index bee6a79..b016e18 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -610,7 +610,11 @@ if pushd $MK_VARDIR/job >/dev/null; then
for username in *
do
if [ -d "$username" ] && cd "$username" ; then
- su "$username" -c "head -n -0 -v *"
+ if [ $EUID -eq 0 ]; then
+ su "$username" -c "head -n -0 -v *"
+ else
+ head -n -0 -v *
+ fi
cd ..
fi
done
Module: check_mk
Branch: master
Commit: 1243ea9426753240fcc0f678f5b3e244b9efc4b2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1243ea94267532…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 3 14:26:44 2015 +0200
#2558 FIX cmciii.temp: Do not discover air temperature sensors anymore
Fixes an exception in the check as the air temperature data can not be used by this check.
---
.werks/2558 | 10 ++++++++++
ChangeLog | 1 +
checks/cmciii | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/2558 b/.werks/2558
new file mode 100644
index 0000000..a98f3cf
--- /dev/null
+++ b/.werks/2558
@@ -0,0 +1,10 @@
+Title: cmciii.temp: Do not discover air temperature sensors anymore
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1441283161
+
+Fixes an exception in the check as the air temperature data can not be used by this check.
diff --git a/ChangeLog b/ChangeLog
index dc03de0..a3565fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -162,6 +162,7 @@
* 2554 FIX: oracle_recovery_status: Fixed exception when files have no checkpoints
* 2568 FIX: apache_status: fixed computation of bytes and requests per second...
* 2557 FIX: cmciii_lcp_airin cmciii_lcp_airout cmciii_lcp_waterin cmciii_lcp_waterout: Fixed exception parsing data from some devices
+ * 2558 FIX: cmciii.temp: Do not discover air temperature sensors anymore...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce unhandled exceptions...
diff --git a/checks/cmciii b/checks/cmciii
index 0e69e09..b310024 100644
--- a/checks/cmciii
+++ b/checks/cmciii
@@ -457,7 +457,7 @@ def inventory_cmciii_temp(info):
units = parse_units(info[1])
for (unit, item_name), entry in parsed.iteritems():
unit_type, unit_name = units[int(unit)-1][0:2]
- if re.search(r'Temperature$',item_name):
+ if "Temperature" in item_name and "Air." not in item_name:
inventory.append( ("%s %s" % (unit_name, item_name), None) )
return inventory
Module: check_mk
Branch: master
Commit: cb1c2f4c9fdcc9e9235082c634e667bd5e89b38b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cb1c2f4c9fdcc9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 3 14:25:43 2015 +0200
#2581 FIX Fix crashing Nagios core in rare case when excessive commands are being executed
The crash was due to the fact that the internal Nagios API for executing commands
is not thread safe. The CMC was not affected. This fixes the problems:
http://tracker.nagios.org/view.php?id=656http://lists.mathias-kettner.de/pipermail/checkmk-en/2015-February/014497.h…
Thanks to Ryan C. Underwood for the patch!
---
.werks/2581 | 17 +++++++++++++++++
ChangeLog | 1 +
livestatus/src/Store.cc | 10 ++++++++++
livestatus/src/Store.h | 3 +++
4 files changed, 31 insertions(+)
diff --git a/.werks/2581 b/.werks/2581
new file mode 100644
index 0000000..ca2a6eb
--- /dev/null
+++ b/.werks/2581
@@ -0,0 +1,17 @@
+Title: Fix crashing Nagios core in rare case when excessive commands are being executed
+Level: 2
+Component: livestatus
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1441283031
+
+The crash was due to the fact that the internal Nagios API for executing commands
+is not thread safe. The CMC was not affected. This fixes the problems:
+
+http://tracker.nagios.org/view.php?id=656
+
+http://lists.mathias-kettner.de/pipermail/checkmk-en/2015-February/014497.html
+
+Thanks to Ryan C. Underwood for the patch!
diff --git a/ChangeLog b/ChangeLog
index 700435c..dc03de0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -256,6 +256,7 @@
Livestatus:
* 2493 FIX: Fixed wrong JSON format when using stats queries together with header columns...
* 2542 FIX: Fix segmentation fault when filtering for service columns in log table...
+ * 2581 FIX: Fix crashing Nagios core in rare case when excessive commands are being executed...
HW/SW-Inventory:
* 2128 mk_inventory.vbs: inventory plugin for Windows now available as vbs script...
diff --git a/livestatus/src/Store.cc b/livestatus/src/Store.cc
index e2fd4e0..57449cb 100644
--- a/livestatus/src/Store.cc
+++ b/livestatus/src/Store.cc
@@ -89,8 +89,16 @@ Store::Store()
{
_table_columns.addTable(it->second);
}
+
+ pthread_mutex_init(&_command_mutex, NULL);
}
+Store::~Store()
+{
+ pthread_mutex_destroy(&_command_mutex);
+}
+
+
Table *Store::findTable(string name)
{
_tables_t::iterator it = _tables.find(name);
@@ -147,6 +155,7 @@ bool Store::answerRequest(InputBuffer *input, OutputBuffer *output)
void Store::answerCommandRequest(const char *command)
{
+ pthread_mutex_lock(&_command_mutex);
#ifdef NAGIOS4
process_external_command1((char *)command);
#else
@@ -154,6 +163,7 @@ void Store::answerCommandRequest(const char *command)
/* int ret = */
submit_external_command((char *)command, &buffer_items);
#endif
+ pthread_mutex_unlock(&_command_mutex);
}
diff --git a/livestatus/src/Store.h b/livestatus/src/Store.h
index 5d72b41..19b35e0 100644
--- a/livestatus/src/Store.h
+++ b/livestatus/src/Store.h
@@ -68,8 +68,11 @@ class Store
typedef map<string, Table *> _tables_t;
_tables_t _tables;
+ pthread_mutex_t _command_mutex;
+
public:
Store();
+ ~Store();
LogCache* logCache() { return &_log_cache; };
void registerHostgroup(hostgroup *);
void registerComment(nebstruct_comment_data *);