lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
December 2016
----- 2024 -----
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
10 participants
391 discussions
Start a n
N
ew thread
fixed wrong rule variable
by Simon Betz
Module: check_mk Branch: master Commit: 9ff329fbf016f6e21bd8f48442e4c761b38d4e27 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9ff329fbf016f6…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Fri Dec 9 09:24:41 2016 +0100 fixed wrong rule variable --- web/plugins/wato/check_parameters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py index 2815bb9..9b259ec 100644 --- a/web/plugins/wato/check_parameters.py +++ b/web/plugins/wato/check_parameters.py @@ -6692,7 +6692,7 @@ register_check_parameters( _("Netscaler VServer States"), Dictionary( elements = [ - ("health_status", Tuple(title = _("Health status"), elements = [ + ("health_levels", Tuple(title = _("Lower health levels"), elements = [ Percentage(title = _("Warning below"), default_value = 100.0), Percentage(title = _("Critical below"), default_value = 0.1), ])),
7 years, 6 months
1
0
0
0
fixed levelstext
by Simon Betz
Module: check_mk Branch: master Commit: fbd074f1b5223e270d0139ac3e077d139a42ee22 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fbd074f1b5223e…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Fri Dec 9 09:16:00 2016 +0100 fixed levelstext --- checks/netscaler_vserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/netscaler_vserver b/checks/netscaler_vserver index 1e1c761..3f7c727 100644 --- a/checks/netscaler_vserver +++ b/checks/netscaler_vserver @@ -112,7 +112,7 @@ def check_netscaler_vserver(item, params, info): health_state = 1 if health_state > 0: - infotext += " (warn/crit at %s/%s)" % \ + infotext += " (warn/crit below %s/%s)" % \ (get_percent_human_readable(warn), get_percent_human_readable(crit))
7 years, 6 months
1
0
0
0
4111 FIX hp_proliant: fixed empty data handling
by Simon Betz
Module: check_mk Branch: master Commit: 6b18522601693380412749f42a48612622f01ff8 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6b185226016933…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Thu Dec 8 18:04:59 2016 +0100 4111 FIX hp_proliant: fixed empty data handling --- checks/hp_proliant | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/hp_proliant b/checks/hp_proliant index 0c17f51..1b03c68 100644 --- a/checks/hp_proliant +++ b/checks/hp_proliant @@ -33,7 +33,7 @@ hp_proliant_general_status_map = { 1: 'Unknown', 2: 'Ok', 3: 'Degr hp_proliant_general_status2nagios_map = { 'Unknown': 3, 'Ok': 0, 'Degraded': 1, 'Failed': 2, } def inventory_proliant_general(info): - if len(info) > 0 and len(info[0]) > 1: + if len(info) > 0 and len(info[0]) > 1 and info[0][0]: return [ (None, None) ] def check_proliant_general(item, no_params, info):
7 years, 6 months
1
0
0
0
Fetched livestatus from upstream.
by Sven Panne
Module: check_mk Branch: master Commit: 0a25fbee0072edeaa44e4d3649586f80e5dca800 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0a25fbee0072ed…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Thu Dec 8 16:22:17 2016 +0100 Fetched livestatus from upstream. --- livestatus/src/NullColumn.h | 1 + livestatus/src/Query.cc | 70 ++++++++++++++++----------------------------- livestatus/src/Query.h | 6 ++-- 3 files changed, 27 insertions(+), 50 deletions(-) diff --git a/livestatus/src/NullColumn.h b/livestatus/src/NullColumn.h index 96e3469..e928ce2 100644 --- a/livestatus/src/NullColumn.h +++ b/livestatus/src/NullColumn.h @@ -42,6 +42,7 @@ public: : Column(name, description, -1, -1) {} ColumnType type() override { return ColumnType::null; } void output(void *row, RowRenderer &r, contact *auth_user) override; + bool mustDelete() const override { return true; } }; #endif // NullColumn_h diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc index 5770ab8..3439c15 100644 --- a/livestatus/src/Query.cc +++ b/livestatus/src/Query.cc @@ -218,12 +218,6 @@ Query::~Query() { } } -Column *Query::createDummyColumn(const char *name) { - _dummy_columns.push_back( - make_unique<NullColumn>(name, "non-existing column")); - return _dummy_columns.back().get(); -} - void Query::addColumn(Column *column) { _columns.push_back(column); } void Query::setResponseHeader(OutputBuffer::ResponseHeader r) { @@ -497,18 +491,13 @@ void Query::parseColumnsLine(char *line) { _columns.push_back(column); } else { Informational(_logger) << "Replacing non-existing column '" - << string(column_name) - << "' with null column"; + << column_name << "' with null column"; // Do not fail any longer. We might want to make this configurable. // But not failing has the advantage that an updated GUI, that - // expects new columns, - // will be able to keep compatibility with older Livestatus - // versions. - // invalidHeader( - // "Table '%s' has no column '%s'", _table->name(), - // column_name); - Column *col = createDummyColumn(column_name); - _columns.push_back(col); + // expects new columns, will be able to keep compatibility with + // older Livestatus versions. + _columns.push_back( + new NullColumn(column_name, "non-existing column")); } } _show_column_headers = false; @@ -731,17 +720,11 @@ void Query::process(OutputBuffer *output) { } void Query::start(QueryRenderer &q) { - if (doStats()) { - // if we have no StatsGroupBy: column, we allocate one only row of - // Aggregators, - // directly in _stats_aggregators. When grouping the rows of aggregators - // will be created each time a new group is found. - if (_columns.empty()) { - _stats_aggregators = new Aggregator *[_stats_columns.size()]; - for (unsigned i = 0; i < _stats_columns.size(); i++) { - _stats_aggregators[i] = _stats_columns[i]->createAggregator(); - } - } + // if we have no StatsGroupBy: column, we allocate one only row of + // Aggregators, directly in _stats_aggregators. When grouping the rows of + // aggregators will be created each time a new group is found. + if (doStats() && _columns.empty()) { + _stats_aggregators = createAggregators(); } if (_show_column_headers) { @@ -793,16 +776,10 @@ bool Query::processDataset(void *data) { } if (doStats()) { - Aggregator **aggr; // When doing grouped stats, we need to fetch/create a row of // aggregators for the current group - if (!_columns.empty()) { - _stats_group_spec_t groupspec; - computeStatsGroupSpec(groupspec, data); - aggr = getStatsGroup(groupspec); - } else { - aggr = _stats_aggregators; - } + Aggregator **aggr = + _columns.empty() ? _stats_aggregators : getStatsGroup(data); for (unsigned i = 0; i < _stats_columns.size(); i++) { aggr[i]->consume(data, _auth_user, _timezone_offset); @@ -865,24 +842,25 @@ void Query::optimizeBitmask(const string &column_name, uint32_t *bitmask) { _filter.optimizeBitmask(column_name, bitmask, _timezone_offset); } -Aggregator **Query::getStatsGroup(Query::_stats_group_spec_t &groupspec) { +Aggregator **Query::getStatsGroup(void *data) { + _stats_group_spec_t groupspec; + for (auto column : _columns) { + groupspec.push_back(column->valueAsString(data, _auth_user)); + } + auto it = _stats_groups.find(groupspec); if (it == _stats_groups.end()) { - auto aggr = new Aggregator *[_stats_columns.size()]; - for (unsigned i = 0; i < _stats_columns.size(); i++) { - aggr[i] = _stats_columns[i]->createAggregator(); - } - _stats_groups.emplace(groupspec, aggr); - return aggr; + it = _stats_groups.emplace(groupspec, createAggregators()).first; } return it->second; } -void Query::computeStatsGroupSpec(Query::_stats_group_spec_t &groupspec, - void *data) { - for (auto column : _columns) { - groupspec.push_back(column->valueAsString(data, _auth_user)); +Aggregator **Query::createAggregators() { + auto aggr = new Aggregator *[_stats_columns.size()]; + for (size_t i = 0; i < _stats_columns.size(); i++) { + aggr[i] = _stats_columns[i]->createAggregator(); } + return aggr; } void Query::doWait() { diff --git a/livestatus/src/Query.h b/livestatus/src/Query.h index e6b34de..a5ca09e 100644 --- a/livestatus/src/Query.h +++ b/livestatus/src/Query.h @@ -94,7 +94,6 @@ private: Logger *const _logger; std::vector<Column *> _columns; - std::vector<std::unique_ptr<Column>> _dummy_columns; std::vector<std::unique_ptr<StatsColumn>> _stats_columns; Aggregator **_stats_aggregators; @@ -113,8 +112,8 @@ private: bool doStats(); void doWait(); - Aggregator **getStatsGroup(_stats_group_spec_t &groupspec); - void computeStatsGroupSpec(_stats_group_spec_t &groupspec, void *data); + Aggregator **getStatsGroup(void *data); + Aggregator **createAggregators(); Filter *createFilter(Column *column, RelationalOperator relOp, const std::string &value); void parseFilterLine(char *line, VariadicFilter &filter); @@ -141,7 +140,6 @@ private: void parseLocaltimeLine(char *line); void start(QueryRenderer &q); void finish(QueryRenderer &q); - Column *createDummyColumn(const char *name); }; #endif // Query_h
7 years, 6 months
1
0
0
0
Better label for EC expected messages option
by Mathias Kettner
Module: check_mk Branch: master Commit: 8f9829069975e820125a35e409c5d94078b1a261 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8f9829069975e8…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Thu Dec 8 15:48:48 2016 +0100 Better label for EC expected messages option --- web/plugins/wato/mkeventd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/plugins/wato/mkeventd.py b/web/plugins/wato/mkeventd.py index 66a16ef..a21b1fa 100644 --- a/web/plugins/wato/mkeventd.py +++ b/web/plugins/wato/mkeventd.py @@ -556,7 +556,7 @@ vs_mkeventd_rule = Dictionary( ), ( "count", Integer( - title = _("Number of expected messages in each interval"), + title = _("Number of expected messages"), minvalue = 1, ) ),
7 years, 6 months
1
0
0
0
Added test for precompiled update agent
by Lars Michelsen
Module: check_mk Branch: master Commit: 5053f07077b95ec3bd76b65db9d47566452df0b1 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5053f07077b95e…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Dec 8 11:38:53 2016 +0100 Added test for precompiled update agent --- .../windows/test_precompiled_cmk_update_agent.py | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/agents/windows/test_precompiled_cmk_update_agent.py b/tests/agents/windows/test_precompiled_cmk_update_agent.py new file mode 100644 index 0000000..b3a2b5d --- /dev/null +++ b/tests/agents/windows/test_precompiled_cmk_update_agent.py @@ -0,0 +1,38 @@ +#!/usr/bin/python +# encoding: utf-8 + +import os +import glob +from testlib import cmc_path + +precompiled_files = [ + 'plugins/cmk-update-agent.exe' +] + + +def test_precompiled_files_present(): + for filename in precompiled_files: + path = "%s/agents/windows/%s" % (cmc_path(), filename) + assert os.path.exists(path) + + +def test_precompiled_file_ages(): + newest_source_file, newest_source_time = find_newest_source_file() + + for filename in precompiled_files: + path = "%s/agents/windows/%s" % (cmc_path(), filename) + commit_time = last_commit_time(path) + assert commit_time >= newest_source_time, \ + "%s is older than source code file %s" % (path, newest_source_file) + + +def find_newest_source_file(): + path = "%s/agents/plugins/cmk-update-agent" % cmc_path() + return path, last_commit_time(path) + + +def last_commit_time(path): + lines = os.popen('unset GIT_DIR ; cd "%s" ; ' + 'git log -n 1 --date=raw -- "%s"' % (os.path.dirname(path), path)).readlines() + timestamp = int(lines[2].split()[1]) + return timestamp
7 years, 6 months
1
0
0
0
Make our custom exceptions copyable and picklable
by Sven Panne
Module: check_mk Branch: master Commit: f1a612dda86795702567df63b6259da9c9c18205 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f1a612dda86795…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Thu Dec 8 10:26:27 2016 +0100 Make our custom exceptions copyable and picklable By not calling __init__ for the superclass in our own exception's __init__, we effectively break a required protocol: BaseException needs to know all arguments to make copy.copy() and pickling work. Furthermore, we get sensible __str__ and __unicode__ methods, too. Note that we should *not* modify the arguments when passing them up the __init__ chain, because that way we break the copy/pickling protocol again. Starting with Python 3.3, BaseException is more forgiving for such "naive subclasses" (wording taken from Python's HISTORY file, in effect they mean "broken" ;-), see the epic 5-year discussion in the Python bug traker at
https://bugs.python.org/issue1692335
. TODO: * Quite a few custom exceptions needlessly remember a single attribute. This is subsumed by the superclass's behavior, so a simple "pass" should be enough. To do this, the attribute access sites have to be adapted slightly. * The MKException.__str__ method (including its comment) is bogus, it is just fighting the str vs. unicode symptom at the wrong place: __str__ should return a str, and __unicode__ should return, well, unicode... --- cmk_base/localize.py | 1 + cmk_base/packaging.py | 1 + lib/exceptions.py | 9 +++++++++ livestatus/api/python/livestatus.py | 20 +++++++------------- modules/automation.py | 1 + modules/check_mk_base.py | 4 ++++ scripts/autodetect.py | 5 +++-- web/htdocs/guitester.py | 4 +++- web/htdocs/html_mod_python.py | 1 + web/htdocs/htmllib.py | 2 +- web/htdocs/lib.py | 7 ++++++- web/htdocs/wato.py | 2 +- web/htdocs/watolib.py | 2 +- 13 files changed, 39 insertions(+), 20 deletions(-) diff --git a/cmk_base/localize.py b/cmk_base/localize.py index 9e1517e..1ee0547 100644 --- a/cmk_base/localize.py +++ b/cmk_base/localize.py @@ -37,6 +37,7 @@ logger = cmk.log.get_logger(__name__) class LocalizeException(Exception): def __init__(self, reason): self.reason = reason + super(LocalizeException, self).__init__(reason) def __str__(self): return self.reason diff --git a/cmk_base/packaging.py b/cmk_base/packaging.py index abe089c..b0812f7 100644 --- a/cmk_base/packaging.py +++ b/cmk_base/packaging.py @@ -48,6 +48,7 @@ pac_ext = ".mkp" class PackageException(Exception): def __init__(self, reason): self.reason = reason + super(PackageException, self).__init__(reason) def __str__(self): return self.reason diff --git a/lib/exceptions.py b/lib/exceptions.py index 3642b83..1ac4350 100644 --- a/lib/exceptions.py +++ b/lib/exceptions.py @@ -37,6 +37,13 @@ except NameError: # never used directly in the code. Just some wrapper to make all of our # exceptions handleable with one call class MKException(Exception): + # TODO: The comment and the method below are nonsense: If we want unicode, + # it is __unicode__'s task. This just seems to be a workaround for incorrect + # call sites confusing both kinds of strings. Sometimes returning a unicode + # string below just asks for trouble when e.g. this is spliced into a byte + # string, and it *is* a byte string when __str__ is called: Splicing into a + # unicode string would call __unicode__. + # # Do not use the Exception() __str__, because it uses str() # to convert the message. We want to keep unicode strings untouched # And don't use self.message, because older python versions don't @@ -49,6 +56,7 @@ class MKException(Exception): class MKGeneralException(MKException): def __init__(self, reason): self.reason = reason + super(MKGeneralException, self).__init__(reason) def __str__(self): return self.reason @@ -77,6 +85,7 @@ class MKTerminate(Exception): class MKBailOut(Exception): def __init__(self, reason): self.reason = reason + super(MKBailOut, self).__init__(reason) def __str__(self): return self.reason diff --git a/livestatus/api/python/livestatus.py b/livestatus/api/python/livestatus.py index 2b695bd..7cefeff 100644 --- a/livestatus/api/python/livestatus.py +++ b/livestatus/api/python/livestatus.py @@ -59,30 +59,24 @@ remove_cache_regex = re.compile("\nCache:[^\n]*") class MKLivestatusException(Exception): def __init__(self, value): self.parameter = value + super(MKLivestatusException, self).__init__(value) def __str__(self): return str(self.parameter) class MKLivestatusSocketError(MKLivestatusException): - def __init__(self, reason): - MKLivestatusException.__init__(self, reason) + pass class MKLivestatusSocketClosed(MKLivestatusSocketError): - def __init__(self, reason): - MKLivestatusSocketError.__init__(self, reason) + pass class MKLivestatusConfigError(MKLivestatusException): - def __init__(self, reason): - MKLivestatusException.__init__(self, reason) + pass class MKLivestatusQueryError(MKLivestatusException): - def __init__(self, code, reason): - MKLivestatusException.__init__(self, "%s: %s" % (code, reason)) - self.code = code + pass class MKLivestatusNotFoundError(MKLivestatusException): - def __init__(self, query): - MKLivestatusException.__init__(self, query) - self.query = query + pass # We need some unique value here NO_DEFAULT = lambda: None @@ -320,7 +314,7 @@ class BaseConnection: except: raise MKLivestatusSocketError("Malformed output") else: - raise MKLivestatusQueryError(code, data.strip()) + raise MKLivestatusQueryError("%s: %s" % (code, data.strip())) # In case of an IO error or the other side having # closed the socket do a reconnect and try again, but diff --git a/modules/automation.py b/modules/automation.py index 1306d31..f370722 100644 --- a/modules/automation.py +++ b/modules/automation.py @@ -35,6 +35,7 @@ import cmk_base.rulesets as rulesets class MKAutomationError(Exception): def __init__(self, reason): self.reason = reason + super(MKAutomationError, self).__init__(reason) def __str__(self): return self.reason diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py index 83ef343..1b23151 100644 --- a/modules/check_mk_base.py +++ b/modules/check_mk_base.py @@ -144,12 +144,14 @@ ZERO = 0.0 class MKCounterWrapped(Exception): def __init__(self, reason): self.reason = reason + super(MKCounterWrapped, self).__init__(reason) def __str__(self): return self.reason class MKAgentError(Exception): def __init__(self, reason): self.reason = reason + super(MKAgentError, self).__init__(reason) def __str__(self): return self.reason @@ -158,6 +160,7 @@ class MKParseFunctionError(Exception): self.exception_type = exception_type self.exception = exception self.backtrace = backtrace + super(MKParseFunctionError, self).__init__(self, exception_type, exception, backtrace) def exc_info(self): return self.exception_type, self.exception, self.backtrace @@ -168,6 +171,7 @@ class MKParseFunctionError(Exception): class MKSNMPError(Exception): def __init__(self, reason): self.reason = reason + super(MKSNMPError, self).__init__(reason) def __str__(self): return self.reason diff --git a/scripts/autodetect.py b/scripts/autodetect.py index 9bb4bad..5c37e70 100755 --- a/scripts/autodetect.py +++ b/scripts/autodetect.py @@ -65,8 +65,9 @@ target_values = { # /usr/sbin/nagios3 -d /etc/nagios3/nagios.cfg class Sorry(Exception): - def __init__(self, text): - self.reason = text + def __init__(self, reason): + self.reason = reason + super(Sorry, self).__init__(reason) def find_pid_and_configfile(): procs = os.popen("ps ax -o pid,ppid,user,command").readlines() diff --git a/web/htdocs/guitester.py b/web/htdocs/guitester.py index 382aa2a..46674df 100644 --- a/web/htdocs/guitester.py +++ b/web/htdocs/guitester.py @@ -37,7 +37,9 @@ import cmk.store as store class MKGuitestFailed(MKException): def __init__(self, errors): self.errors = errors - MKException.__init__(self, _("GUI Test failed")) + super(MKGuitestFailed, self).__init__(errors) + def __str__(self): + return _("GUI Test failed") class GUITester: diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py index 41c885a..308cd91 100644 --- a/web/htdocs/html_mod_python.py +++ b/web/htdocs/html_mod_python.py @@ -35,6 +35,7 @@ import cmk.paths class FinalizeRequest(Exception): def __init__(self, code = None): self.status = code or apache.OK + super(FinalizeRequest, self).__init__(code) class html_mod_python(htmllib.html): diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 4e33594..97467d1 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -79,7 +79,7 @@ class InvalidUserInput(Exception): def __init__(self, varname, text): self.varname = varname self.text = text - + super(InvalidUserInput, self).__init__(varname, text) class RequestTimeout(MKException): pass diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py index da18e42..81a88b0 100644 --- a/web/htdocs/lib.py +++ b/web/htdocs/lib.py @@ -44,6 +44,7 @@ LOG_DEBUG = 7 # debug-level messages class MKAuthException(MKException): def __init__(self, reason): self.reason = reason + super(MKAuthException, self).__init__(reason) def __str__(self): return self.reason @@ -74,7 +75,11 @@ class MKConfigError(MKException): class MKUserError(MKException): def __init__(self, varname, message): self.varname = varname - super(MKUserError, self).__init__(message) + self.message = message + super(MKUserError, self).__init__(varname, message) + + def __str__(self): + return self.message def title(self): return _("Invalid User Input") diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 2823763..b6dca3c 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -8269,7 +8269,7 @@ class ExceptionName(TextAscii): kwargs["regex"] = "^[-a-z0-9A-Z /]*$" kwargs["regex_error"] = _("This is not a valid Nagios timeperiod day specification.") kwargs["allow_empty"] = False - TextAscii.__init__(self, **kwargs) + super(ExceptionName, self).__init__(**kwargs) def validate_value(self, value, varprefix): if value in [ "monday", "tuesday", "wednesday", "thursday", diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py index a616305..ed43001 100644 --- a/web/htdocs/watolib.py +++ b/web/htdocs/watolib.py @@ -5429,7 +5429,7 @@ def collect_hosts(folder): class MKAutomationException(Exception): def __init__(self, msg): - Exception.__init__(self, msg) + super(MKAutomationException, self).__init__(msg) def check_mk_automation(siteid, command, args=None, indata="", stdin_data=None, timeout=None, sync=True):
7 years, 6 months
1
0
0
0
Added missing sudos.
by Sven Panne
Module: check_mk Branch: master Commit: fa23646358a9d91c7b41fad998c7b1ba5c58a0d3 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fa23646358a9d9…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Thu Dec 8 10:17:48 2016 +0100 Added missing sudos. --- tests/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 13cb152..8d1be6c 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -51,8 +51,8 @@ setup: sudo apt-get install \ python-pip \ python-lxml - pip install --upgrade pip - pip install --upgrade \ + sudo pip install --upgrade pip + sudo pip install --upgrade \ pytest \ requests \ beautifulsoup4 \
7 years, 6 months
1
0
0
0
4136 Availability CSV export: Adding grouping title as first column in case of grouped views
by Lars Michelsen
Module: check_mk Branch: master Commit: efdfe0b6bf5aece24395896cf315532b073f51f3 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=efdfe0b6bf5aec…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Dec 8 10:25:27 2016 +0100 4136 Availability CSV export: Adding grouping title as first column in case of grouped views --- .werks/4136 | 9 +++++++++ ChangeLog | 1 + web/plugins/views/availability.py | 18 +++++++++++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.werks/4136 b/.werks/4136 new file mode 100644 index 0000000..ba0c8f1 --- /dev/null +++ b/.werks/4136 @@ -0,0 +1,9 @@ +Title: Availability CSV export: Adding grouping title as first column in case of grouped views +Level: 1 +Component: multisite +Compatible: compat +Version: 1.4.0i3 +Date: 1481189103 +Class: feature + + diff --git a/ChangeLog b/ChangeLog index ec66a46..ad6f571 100644 --- a/ChangeLog +++ b/ChangeLog @@ -54,6 +54,7 @@ * 3997 New metric for mrpe/check_icmp... * 4083 Web API: Always output full traceback in case of non Check_MK unhandled exceptions * 4135 View CSV export: Group cells are added in front of the regular cells for each row... + * 4136 Availability CSV export: Adding grouping title as first column in case of grouped views * 3974 FIX: Sorting comments in hover menu of comments icon by time now * 4040 FIX: Fix error in view about "No WATO folder ..." in case of host imported via cmcdump... * 4046 FIX: Repaired html rendering.... diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py index 22b0d92..7aab6e5 100644 --- a/web/plugins/views/availability.py +++ b/web/plugins/views/availability.py @@ -831,9 +831,13 @@ def handle_edit_annotations(): # '----------------------------------------------------------------------' def output_availability_csv(what, av_data, avoptions): - def cells_from_row(object_titles, cell_titles, row_object, row_cells): + def cells_from_row(group_titles, group_cells, object_titles, cell_titles, row_object, row_cells): + for column_title, group_title in zip(group_titles, group_cells): + table.cell(column_title, group_title) + for title, (name, url) in zip(object_titles, row_object): table.cell(title, name) + for (title, help), (text, css) in zip(cell_titles, row_cells): table.cell(title, text) @@ -843,14 +847,22 @@ def output_availability_csv(what, av_data, avoptions): for group_title, availability_table in availability_tables: av_table = availability.layout_availability_table(what, group_title, availability_table, avoptions) pad = 0 + + if group_title: + group_titles, group_cells = [_("Group")], [group_title] + else: + group_titles, group_cells = [], [] + for row in av_table["rows"]: table.row() - cells_from_row(av_table["object_titles"], av_table["cell_titles"], + cells_from_row(group_titles, group_cells, + av_table["object_titles"], av_table["cell_titles"], row["object"], row["cells"]) # presumably all rows have the same width pad = len(row["object"]) - 1 table.row() - cells_from_row(av_table["object_titles"], av_table["cell_titles"], + cells_from_row(group_titles, group_cells, + av_table["object_titles"], av_table["cell_titles"], [(_("Summary"), "")] + [("", "")] * pad, av_table["summary"]) table.end()
7 years, 6 months
1
0
0
0
Filenames of CSV exports are now quoted correctly
by Lars Michelsen
Module: check_mk Branch: master Commit: b99e8bbb61bc12804bbe8035279dd55f93a17f0f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b99e8bbb61bc12…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Dec 8 09:53:55 2016 +0100 Filenames of CSV exports are now quoted correctly --- web/htdocs/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/htdocs/views.py b/web/htdocs/views.py index 2460769..ccabfb0 100644 --- a/web/htdocs/views.py +++ b/web/htdocs/views.py @@ -2961,7 +2961,7 @@ def output_csv_headers(view): filename = '%s-%s.csv' % (view['name'], time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime(time.time()))) if type(filename) == unicode: filename = filename.encode("utf-8") - html.req.headers_out['Content-Disposition'] = 'Attachment; filename=%s' % filename + html.req.headers_out['Content-Disposition'] = 'Attachment; filename="%s"' % filename #. # .--Icon Selector-------------------------------------------------------.
7 years, 6 months
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
40
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Results per page:
10
25
50
100
200