Module: check_mk
Branch: master
Commit: cf4aea64fc00021329f3d6fa712feb99bac7ab02
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cf4aea64fc0002…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 22 15:26:59 2016 +0100
#2945 FIX LDAP: Fixed broken sync for LDAP connections named "ldap"
Custom LDAP connections created with the ID "ldap" could not synchronize
users correctly.
---
.werks/2945 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/userdb.py | 5 +++--
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/2945 b/.werks/2945
new file mode 100644
index 0000000..30b1c43
--- /dev/null
+++ b/.werks/2945
@@ -0,0 +1,10 @@
+Title: LDAP: Fixed broken sync for LDAP connections named "ldap"
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453472773
+Class: fix
+
+Custom LDAP connections created with the ID "ldap" could not synchronize
+users correctly.
diff --git a/ChangeLog b/ChangeLog
index 1890d93..eb42ac9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -239,6 +239,7 @@
* 2901 FIX: Fixed issue editing availability annotations...
* 2904 FIX: Improved error handling when custom url dashlets raise an exception...
* 2830 FIX: Improved sorting in view column "Services colored according to state"...
+ * 2945 FIX: LDAP: Fixed broken sync for LDAP connections named "ldap"...
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index b8753f8..2b74935 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -104,8 +104,9 @@ def cleanup_connection_id(connection_id):
# Old Check_MK used a static "ldap" connector id for all LDAP users.
# Since Check_MK now supports multiple LDAP connections, the ID has
- # been changed to "default"
- if connection_id == 'ldap':
+ # been changed to "default". But only transform this when there is
+ # no connection existing with the id LDAP.
+ if connection_id == 'ldap' and not get_connection('ldap'):
connection_id = 'default'
return connection_id
Module: check_mk
Branch: master
Commit: c702b770c12b9e1d09899177efce0c9bcc75ff43
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c702b770c12b9e…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Jan 22 15:17:00 2016 +0100
Now really added the files
---
checkman/dell_eql_storage | 18 ++++++++
checks/dell_eql_storage | 104 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 122 insertions(+)
diff --git a/checkman/dell_eql_storage b/checkman/dell_eql_storage
new file mode 100644
index 0000000..61d2712
--- /dev/null
+++ b/checkman/dell_eql_storage
@@ -0,0 +1,18 @@
+title: Dell Equallogic SAN Storage
+agents: snmp
+catalog: hw/storagehw/dell
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the Health- and Raid State on Dell Equallogic SAN Storages.
+ It also shows the total and used space and show how many space is used for snapshots or for replication.
+
+
+item:
+ The Name of the Member Device
+
+inventory:
+ One service will be created for each member
+
+perfdata:
+ The size and used space of the device
diff --git a/checks/dell_eql_storage b/checks/dell_eql_storage
new file mode 100644
index 0000000..4858bf6
--- /dev/null
+++ b/checks/dell_eql_storage
@@ -0,0 +1,104 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+def inventory_dell_eql_storage(info):
+ for line in info:
+ yield line[0], {}
+
+def check_dell_eql_storage(item, _no_params, info):
+ for name, desc, health_state, raid_state, total_storage, \
+ repl_storage, snap_storage, used_storage in info:
+ if name == item:
+ yield 0, desc
+
+ # Health Status:
+ health_states = {
+ "0" : "Unknown",
+ "1" : "Normal",
+ "2" : "Warning",
+ "3" : "Critical",
+ }
+ if health_state == "1":
+ state = 0
+ elif health_state in [ "2", "0" ]:
+ state = 1
+ else:
+ state = 2
+ yield state, "Health State: %s" % health_states[health_state]
+
+ # Raid Status
+ raid_states = {
+ "1" : "Ok",
+ "2" : "Degraded",
+ "3" : "Verifying",
+ "4" : "Reconstructing",
+ "5" : "Failed",
+ "6" : "CatastrophicLoss",
+ "7" : "Expanding",
+ "8" : "Mirroring",
+ }
+
+ if raid_state == "1":
+ state = 0
+ elif raid_state in [ "3", "4", "7", "8"]:
+ state = 1
+ else:
+ state = 2
+ yield state, "Raid State: %s" % raid_states[raid_state]
+
+ # Storage
+ total_bytes = int(total_storage) * 1048576
+ used_bytes = int(used_storage) * 1048576
+ repl_bytes = int(repl_storage) * 1048576
+ snap_bytes = int(snap_storage) * 1048576
+ perfdata = [("fs_used", used_bytes),("fs_size", total_bytes)]
+ yield 0, "Used: %s/%s (Snapshots: %s, Replication: %s)" % \
+ (get_bytes_human_readable(used_bytes), \
+ get_bytes_human_readable(total_bytes),\
+ get_bytes_human_readable(snap_bytes),\
+ get_bytes_human_readable(repl_bytes)),\
+ perfdata
+
+
+
+check_info["dell_eql_storage"] = {
+ "check_function" : check_dell_eql_storage,
+ "inventory_function" : inventory_dell_eql_storage,
+ "service_description" : "Storage %s",
+ "has_perfdata" : True,
+ "snmp_scan_function" : lambda oid: "EQL-SUP" in oid(".1.3.6.1.2.1.1.1.0"),
+ "snmp_info" : (".1.3.6.1.4.1.12740.2.1", [
+ "1.1.9.1", #eqlMemberName
+ "1.1.7.1", #eqlMemberDescription
+ "5.1.1.1", #eqlMemberHealthStatus
+ "13.1.1.1", #eqlMemberRaidStatus
+ "10.1.1.1", #eqlMemberTotalStorage
+ "10.1.4.1", #eqlMemberReplStorage
+ "10.1.3.1", #eqlMemberSnapStorage
+ "10.1.2.1", #eqlMemberUsedStorage
+ ]),
+}
+
Module: check_mk
Branch: master
Commit: ee8f868b7a1aa0fc2621a22b94f090f27b2a965c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ee8f868b7a1aa0…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Jan 22 15:16:23 2016 +0100
#1324 New Check for Dell Equallogic SAN Devices
---
.werks/1324 | 9 +++++++++
ChangeLog | 1 +
2 files changed, 10 insertions(+)
diff --git a/.werks/1324 b/.werks/1324
new file mode 100644
index 0000000..8f1237f
--- /dev/null
+++ b/.werks/1324
@@ -0,0 +1,9 @@
+Title: New Check for Dell Equallogic SAN Devices
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453472156
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index cecc49e..1890d93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -92,6 +92,7 @@
* 2934 all temperature checks rewritten to use the shared temperature api...
NOTE: Please refer to the migration notes!
* 1323 win_printers: Warning and Critical levels can now be set...
+ * 1324 New Check for Dell Equallogic SAN Devices
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
Module: check_mk
Branch: master
Commit: 7b00f1553ff23dd29e0d4d82f56bbf07bd5f9a94
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b00f1553ff23d…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Jan 22 12:08:34 2016 +0100
Updated bug entries #2181
---
.bugs/2181 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/2181 b/.bugs/2181
new file mode 100644
index 0000000..cf271d0
--- /dev/null
+++ b/.bugs/2181
@@ -0,0 +1,9 @@
+Title: visuals.load should only load data of existing users
+Component: multisite
+State: open
+Date: 2016-01-22 12:04:33
+Targetversion: future
+Class: bug
+
+The visual.load function also loads the directories of no longer existing users.
+This does have quite a performance impact when there are thousands of users in ~/var/check_mk/web.
Module: check_mk
Branch: master
Commit: 7d5b3f95a139a73c40c78967ead064143c0d91db
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d5b3f95a139a7…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Jan 22 11:24:36 2016 +0100
#2831 FIX Removing a previously set custom attribute for a contact did not work as intented
The mechanism resetting a custom attribute to its default value was not working properly.
In the GUI you could see that the attribute was correctly unset.
However, the configuration for the monitoring core still used the old configured value.
This has been fixed.
---
.werks/2831 | 12 ++++++++++++
ChangeLog | 4 ++--
web/htdocs/userdb.py | 2 +-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/2831 b/.werks/2831
new file mode 100644
index 0000000..ccec531
--- /dev/null
+++ b/.werks/2831
@@ -0,0 +1,12 @@
+Title: Removing a previously set custom attribute for a contact did not work as intented
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453457638
+Class: fix
+
+The mechanism resetting a custom attribute to its default value was not working properly.
+In the GUI you could see that the attribute was correctly unset.
+However, the configuration for the monitoring core still used the old configured value..
+This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 7b675ca..cecc49e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -84,8 +84,6 @@
* 2918 agent_jolokia: jolokia can now be monitored using a special agent
* 2919 hp_webmgmt_status: New check for health status of various Hewlett-Packard devices...
* 2920 hr_cpu: this check can now also supports per-core features...
- * 1322 solaris_prtdiag: New Check for Solaris Hardware State based on prtdiag
- * 1323 win_printers: Warning and Critical levels can now be set...
* 1322 solaris_prtdiag_status: New Check for Solaris Hardware State based on prtdiag
* 2921 printer_supply_ricoh: check now tries to handle negative readings properly...
* 2922 check_mk_agent.linux: mrpe sections can now be cached...
@@ -93,6 +91,7 @@
* 2829 filesystem checks: introduced default levels for inodes used (10%/5% free)...
* 2934 all temperature checks rewritten to use the shared temperature api...
NOTE: Please refer to the migration notes!
+ * 1323 win_printers: Warning and Critical levels can now be set...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
@@ -271,6 +270,7 @@
* 2925 FIX: Editing a notification rule for a missing user selected random other user...
* 2905 FIX: Check plugins: Non existant man pages now result in helpful error messages
* 2943 FIX: Preventing issues with password completion of browsers on user and profile edit pages
+ * 2831 FIX: Removing a previously set custom attribute for a contact did not work as intented...
Notifications:
* 2811 Mail notifications: Now able to add Host/Service Notes Url...
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 63e518e..b8753f8 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -438,7 +438,7 @@ def save_users(profiles):
core_custom_macros = [ k for k,o in user_attributes.items() if o.get('add_custom_macro') ]
for user in profiles.keys():
for macro in core_custom_macros:
- if profiles[user].get(macro):
+ if macro in profiles[user]:
profiles[user]['_'+macro] = profiles[user][macro]
multisite_custom_values = [ k for k,v in user_attributes.items() if v["domain"] == "multisite" ]
Module: check_mk
Branch: master
Commit: 4280b6a86839464dc2518a3f9d66a4ae7d501f31
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4280b6a8683946…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri Jan 22 10:15:07 2016 +0100
gitbug regarding windows inventory bug
---
.bugs/2405 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/2405 b/.bugs/2405
new file mode 100644
index 0000000..36d4347
--- /dev/null
+++ b/.bugs/2405
@@ -0,0 +1,9 @@
+Title: Windows inventory plugin seems to crash with cyrillic symbols in sofware list
+Component: checks
+State: open
+Date: 2016-01-22 10:11:05
+Targetversion: 1.2.7
+Class: bug
+
+With cyrillic symbols in the software list (manufacturer field) the inventory plugin crashs and doesn't report remaining sections.
+The same probably applies to other symbols not present in the current code page.
Module: check_mk
Branch: master
Commit: 63dd02ad72b87396d2402b9f3b4a12df62cd52f3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=63dd02ad72b873…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Jan 21 15:35:19 2016 +0100
Refactoring: Use vector instead old-skool C array.
---
livestatus/src/InputBuffer.cc | 16 ++++++----------
livestatus/src/InputBuffer.h | 4 ++--
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/livestatus/src/InputBuffer.cc b/livestatus/src/InputBuffer.cc
index 0290641..f4fd7ab 100644
--- a/livestatus/src/InputBuffer.cc
+++ b/livestatus/src/InputBuffer.cc
@@ -62,17 +62,13 @@ pair<list<string>, InputBuffer::Result> failure(InputBuffer::Result r)
}
}
-// TODO: We need the suppression pragma below because _readahead_buffer is not
-// initialized in the constructor. Just replace all this manual fiddling with
-// pointers, offsets, etc. with vector.
-
-// cppcheck-suppress uninitMemberVar
InputBuffer::InputBuffer(int fd, const int *termination_flag)
- : _fd(fd), _termination_flag(termination_flag)
+ : _fd(fd)
+ , _termination_flag(termination_flag)
+ , _readahead_buffer(buffer_size)
{
_read_index = 0; // points to data not yet processed
_write_index = 0; // points to end of data in buffer
- _end_index = buffer_size; // points ot end of buffer
}
// read in data enough for one complete request (and maybe more).
@@ -111,7 +107,7 @@ pair<list<string>, InputBuffer::Result> InputBuffer::readRequest()
{
// Is there still space left in the buffer => read in
// further data into the buffer.
- if (_write_index < _end_index)
+ if (_write_index < _readahead_buffer.capacity())
{
Result rd = readData(); // tries to read in further data into buffer
if (rd == Result::timeout) {
@@ -155,7 +151,7 @@ pair<list<string>, InputBuffer::Result> InputBuffer::readRequest()
}
// OK. So no space is left in the buffer. But maybe at the
// *beginning* of the buffer is space left again. This is
- // very probable if _write_index == _end_index. Most
+ // very probable if _write_index == _readahead_buffer.capacity(). Most
// of the buffer's content is already processed. So we simply
// shift the yet unprocessed data to the very left of the buffer.
else if (_read_index > 0) {
@@ -224,7 +220,7 @@ InputBuffer::Result InputBuffer::readData()
int retval = select(_fd + 1, &fds, NULL, NULL, &tv);
if (retval > 0 && FD_ISSET(_fd, &fds)) {
- ssize_t r = read(_fd, &_readahead_buffer[_write_index], _end_index - _write_index);
+ ssize_t r = read(_fd, &_readahead_buffer[_write_index], _readahead_buffer.capacity() - _write_index);
if (r < 0) {
return Result::eof;
}
diff --git a/livestatus/src/InputBuffer.h b/livestatus/src/InputBuffer.h
index 5c0256f..89b7d15 100644
--- a/livestatus/src/InputBuffer.h
+++ b/livestatus/src/InputBuffer.h
@@ -30,6 +30,7 @@
#include <list>
#include <string>
#include <utility>
+#include <vector>
class InputBuffer {
public:
@@ -52,10 +53,9 @@ private:
int _fd;
const int *_termination_flag;
- char _readahead_buffer[buffer_size];
+ std::vector<char> _readahead_buffer;
size_t _read_index;
size_t _write_index;
- size_t _end_index;
Result readData();
};
Module: check_mk
Branch: master
Commit: 522aa2062a56acc56444bc5a4b5305ca55b11b3b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=522aa2062a56ac…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Jan 21 15:54:46 2016 +0100
Make InputBuffer's underlying buffer grow dynamically.
We start at 4k (seems to be more than enough for the common cases), and
impose a rather arbitrary upper bound of 500MB. We can make this
configurable if we want, but for now it's just hard-wired.
---
livestatus/src/InputBuffer.cc | 18 ++++++++++++------
livestatus/src/InputBuffer.h | 2 --
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/livestatus/src/InputBuffer.cc b/livestatus/src/InputBuffer.cc
index f4fd7ab..de84973 100644
--- a/livestatus/src/InputBuffer.cc
+++ b/livestatus/src/InputBuffer.cc
@@ -39,9 +39,11 @@ using std::string;
extern int g_query_timeout_msec;
extern int g_idle_timeout_msec;
-const size_t InputBuffer::buffer_size;
-
namespace {
+const size_t initial_buffer_size = 4096;
+// TODO: Make this configurable?
+const size_t maximum_buffer_size = 500 * 1024 * 1024;
+
const int read_timeout_usec = 200000;
bool timeout_reached(const struct timeval *start, int timeout_ms)
@@ -65,7 +67,7 @@ pair<list<string>, InputBuffer::Result> failure(InputBuffer::Result r)
InputBuffer::InputBuffer(int fd, const int *termination_flag)
: _fd(fd)
, _termination_flag(termination_flag)
- , _readahead_buffer(buffer_size)
+ , _readahead_buffer(initial_buffer_size)
{
_read_index = 0; // points to data not yet processed
_write_index = 0; // points to end of data in buffer
@@ -164,10 +166,14 @@ pair<list<string>, InputBuffer::Result> InputBuffer::readRequest()
// continue -> still no data in buffer, but it will
// be read, as now is space
}
- // buffer is full, but still no end of line found => buffer is too small
+ // buffer is full, but still no end of line found
else {
- logger(LG_INFO, "Error: maximum length of request line exceeded");
- return failure(Result::line_too_long);
+ size_t new_capacity = _readahead_buffer.capacity() * 2;
+ if (new_capacity > maximum_buffer_size) {
+ logger(LG_INFO, "Error: maximum length of request line exceeded");
+ return failure(Result::line_too_long);
+ }
+ _readahead_buffer.resize(new_capacity);
}
}
else // end of line found
diff --git a/livestatus/src/InputBuffer.h b/livestatus/src/InputBuffer.h
index 89b7d15..b358d84 100644
--- a/livestatus/src/InputBuffer.h
+++ b/livestatus/src/InputBuffer.h
@@ -49,8 +49,6 @@ public:
std::pair<std::list<std::string>, Result> readRequest();
private:
- static const size_t buffer_size = 65536;
-
int _fd;
const int *_termination_flag;
std::vector<char> _readahead_buffer;