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
December
November
October
September
August
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
November 2016
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 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
9 participants
299 discussions
Start a n
N
ew thread
Bugfix in wato.py
by Roland Halbig
Module: check_mk Branch: master Commit: 44777b50c7cbc2ab9abec0429e1920c22c127489 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=44777b50c7cbc2…
Author: Roland Halbig <rh(a)mathias-kettner.de> Date: Thu Nov 3 11:02:37 2016 +0100 Bugfix in wato.py --- web/htdocs/wato.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index eb83b60..77c9a0d 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -5003,7 +5003,7 @@ def interactive_progress(items, title, stats, finishvars, timewait, success_stat for num, (label, value) in enumerate(stats): html.open_tr() html.th(label) - html.td(num, id_="progress_stat%d" % value) + html.td(value, id_="progress_stat%d" % num) html.close_tr() html.close_table() html.close_td()
8 years, 1 month
1
0
0
0
Fetched Livestatus from downstream.
by Sven Panne
Module: check_mk Branch: master Commit: fae992b3c4b44da0beb0e1281b3a9efc40ef7036 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fae992b3c4b44d…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Wed Nov 2 16:25:23 2016 +0100 Fetched Livestatus from downstream. --- livestatus/src/ClientQueue.h | 3 +-- livestatus/src/Query.h | 6 +++--- livestatus/src/TableStateHistory.cc | 4 ++-- livestatus/src/TableStateHistory.h | 3 +-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/livestatus/src/ClientQueue.h b/livestatus/src/ClientQueue.h index 3d1e92b..60309c8 100644 --- a/livestatus/src/ClientQueue.h +++ b/livestatus/src/ClientQueue.h @@ -40,8 +40,7 @@ public: void terminate(); private: - typedef std::deque<int> _queue_t; - _queue_t _queue; + std::deque<int> _queue; std::mutex _mutex; std::condition_variable _cond; bool _should_terminate; diff --git a/livestatus/src/Query.h b/livestatus/src/Query.h index cb8f605..e6327b3 100644 --- a/livestatus/src/Query.h +++ b/livestatus/src/Query.h @@ -93,9 +93,9 @@ private: Logger *const _logger; // normal queries - typedef std::vector<Column *> _columns_t; - _columns_t _columns; - _columns_t _dummy_columns; // dynamically allocated. Must delete them. + std::vector<Column *> _columns; + // dynamically allocated. Must delete them. + std::vector<Column *> _dummy_columns; // stats queries std::vector<StatsColumn *> _stats_columns; // must also delete diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc index 77c2ee9..2d3d39a 100644 --- a/livestatus/src/TableStateHistory.cc +++ b/livestatus/src/TableStateHistory.cc @@ -619,7 +619,7 @@ void TableStateHistory::answerQuery(Query *query) { // Determine initial in_notification_period status } - _notification_periods_t::const_iterator tmp_period = + auto tmp_period = _notification_periods.find(state->_notification_period); if (tmp_period != _notification_periods.end()) { state->_in_notification_period = tmp_period->second; @@ -791,7 +791,7 @@ int TableStateHistory::updateHostServiceState(Query *query, // Apply latest notification period information and set the host_state // to unmonitored - _notification_periods_t::const_iterator it_status = + auto it_status = _notification_periods.find(hs_state->_notification_period); if (it_status != _notification_periods.end()) { hs_state->_in_notification_period = it_status->second; diff --git a/livestatus/src/TableStateHistory.h b/livestatus/src/TableStateHistory.h index 8168c17..ebddd98 100644 --- a/livestatus/src/TableStateHistory.h +++ b/livestatus/src/TableStateHistory.h @@ -59,8 +59,7 @@ class TableStateHistory : public Table { int _until; // Notification periods information, name: active(1)/inactive(0) - typedef std::map<std::string, int> _notification_periods_t; - _notification_periods_t _notification_periods; + std::map<std::string, int> _notification_periods; // Helper functions to traverse through logfiles _logfiles_t::iterator _it_logs;
8 years, 1 month
1
0
0
0
Not checking permission of currently logged in user when acknowledging werks during wato init config creation
by Lars Michelsen
Module: check_mk Branch: master Commit: f71bf9fc03a02feaff4b8e3f55165b65c4aef1f5 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f71bf9fc03a02f…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Nov 2 14:47:13 2016 +0100 Not checking permission of currently logged in user when acknowledging werks during wato init config creation --- web/htdocs/userdb.py | 5 +++-- web/htdocs/wato.py | 2 +- web/htdocs/werks.py | 10 ++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py index 98bd108..734ccf3 100644 --- a/web/htdocs/userdb.py +++ b/web/htdocs/userdb.py @@ -665,7 +665,7 @@ def load_custom_attr(userid, key, conv_func, default = None): def save_custom_attr(userid, key, val): path = custom_attr_path(userid, key) make_nagios_directory(os.path.dirname(path)) - create_user_file(path, 'w').write('%s\n' % val) + store.save_file(path, '%s\n' % val) def remove_custom_attr(userid, key): @@ -780,7 +780,8 @@ def save_users(profiles): # authentication secret for local processes auth_file = user_dir + "/automation.secret" if "automation_secret" in user: - create_user_file(auth_file, "w").write("%s\n" % user["automation_secret"]) + with create_user_file(auth_file, "w") as f: + f.write("%s\n" % user["automation_secret"]) else: remove_user_file(auth_file) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 1357b76..eb83b60 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -14632,7 +14632,7 @@ def create_sample_config(): # This is not really the correct place for such kind of action, but the best place we could # find to execute it only for new created sites. import werks - werks.acknowledge_all_werks() + werks.acknowledge_all_werks(check_permission=False) save_mkeventd_sample_config() diff --git a/web/htdocs/werks.py b/web/htdocs/werks.py index d88b928..fcb7a68 100644 --- a/web/htdocs/werks.py +++ b/web/htdocs/werks.py @@ -195,8 +195,10 @@ def acknowledge_werk(werk): acknowledge_werks([werk]) -def acknowledge_werks(werks): - config.user.need_permission("general.acknowledge_werks") +def acknowledge_werks(werks, check_permission=True): + if check_permission: + config.user.need_permission("general.acknowledge_werks") + ack_ids = load_acknowledgements() for werk in werks: ack_ids.append(werk["id"]) @@ -208,9 +210,9 @@ def save_acknowledgements(acknowledged_werks): store.save_data_to_file(acknowledgement_path, acknowledged_werks) -def acknowledge_all_werks(): +def acknowledge_all_werks(check_permission=True): load_werks() - acknowledge_werks(unacknowledged_incompatible_werks()) + acknowledge_werks(unacknowledged_incompatible_werks(), check_permission) def werk_is_pre_127(werk):
8 years, 1 month
1
0
0
0
added graphing for checks using data of fans
by Marcel Arentz
Module: check_mk Branch: master Commit: f1f536e87490031301f54fd77ce2a6afec203345 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f1f536e8749003…
Author: Marcel Arentz <ma(a)mathias-kettner.de> Date: Wed Nov 2 14:43:57 2016 +0100 added graphing for checks using data of fans --- checks/bintec_sensors | 1 + checks/brocade | 3 ++- checks/bvip_fans | 1 + checks/climaveneta_fan | 1 + checks/emc_isilon_fans | 7 ++++--- checks/entity_sensors | 1 + checks/fan.include | 8 +++++--- checks/fsc_fans | 15 ++++++++------- checks/netextreme_fan | 1 + checks/netscaler_health | 5 +++-- web/plugins/metrics/check_mk.py | 26 ++++++++++++++++++++++++++ 11 files changed, 53 insertions(+), 16 deletions(-) diff --git a/checks/bintec_sensors b/checks/bintec_sensors index 8ea003d..e813430 100644 --- a/checks/bintec_sensors +++ b/checks/bintec_sensors @@ -66,6 +66,7 @@ check_info["bintec_sensors.fan"] = { "service_description" : "%s", "snmp_info" : bintec_sensors_info, "snmp_scan_function" : bintec_sensors_scan, + "has_perfdata" : True, "default_levels_variable" : "bintec_sensors_fan_default_levels", "group" : "hw_fans", "includes" : [ "fan.include" ], diff --git a/checks/brocade b/checks/brocade index e1fa5da..29adf53 100644 --- a/checks/brocade +++ b/checks/brocade @@ -77,7 +77,8 @@ check_info["brocade.fan"] = { "service_description" : "FAN %s", "group" : "hw_fans", "snmp_info" : brocade_info, - 'snmp_scan_function' : brocade_scan, + "snmp_scan_function" : brocade_scan, + "has_perfdata" : True, "includes" : [ "fan.include" ], } diff --git a/checks/bvip_fans b/checks/bvip_fans index ac17904..fe5b1bb 100644 --- a/checks/bvip_fans +++ b/checks/bvip_fans @@ -43,6 +43,7 @@ check_info["bvip_fans"] = { "service_description" : "Fan %s", "snmp_scan_function" : bvip_scan_function, "snmp_info" : (".1.3.6.1.4.1.3967.1.1.8.1", [OID_END, 1 ]), + "has_perfdata" : True, "includes" : [ 'bvip.include', 'fan.include' ], "group" : "hw_fans", } diff --git a/checks/climaveneta_fan b/checks/climaveneta_fan index 5fde683..85a4058 100644 --- a/checks/climaveneta_fan +++ b/checks/climaveneta_fan @@ -46,6 +46,7 @@ check_info["climaveneta_fan"] = { "service_description" : "Fan %s", "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.1.0") == "pCO Gateway", "snmp_info" : (".1.3.6.1.4.1.9839.2.1.2", [ 42, 43 ] ), + "has_perfdata" : True, "default_levels_variable" : "climaveneta_fan_default_levels", "group" : "hw_fans", "includes" : [ "fan.include" ], diff --git a/checks/emc_isilon_fans b/checks/emc_isilon_fans index cc74b9b..6db3def 100644 --- a/checks/emc_isilon_fans +++ b/checks/emc_isilon_fans @@ -59,7 +59,8 @@ check_info["emc_isilon_fans"] = { 4, # ISILON-MIB::fanSpeed, ]), 'snmp_scan_function' : lambda oid: "isilon" in oid('.1.3.6.1.2.1.1.1.0').lower(), - "group" : "hw_fans", - "default_levels_variable" : "emc_isilon_fan_default_levels", - "includes" : [ 'fan.include' ], + 'has_perfdata' : True, + 'group' : "hw_fans", + 'default_levels_variable' : "emc_isilon_fan_default_levels", + 'includes' : [ 'fan.include' ], } diff --git a/checks/entity_sensors b/checks/entity_sensors index f297788..d17ef8c 100644 --- a/checks/entity_sensors +++ b/checks/entity_sensors @@ -238,6 +238,7 @@ check_info['entity_sensors.fan'] = { 'inventory_function' : lambda parsed: inventory_entity_sensors(parsed, "fan"), 'check_function' : check_entity_sensors_fan, 'service_description' : 'Fan %s', + 'has_perfdata' : True, 'default_levels_variable' : 'entity_sensors_fan_default_variables', 'group' : 'hw_fans', 'includes' : ['fan.include'], diff --git a/checks/fan.include b/checks/fan.include index 6ca538f..c345bb1 100644 --- a/checks/fan.include +++ b/checks/fan.include @@ -36,12 +36,14 @@ def check_fan(rpm, params): levelstext = levelstext[:-1] + \ " and at or above %s/%s RPM)" % (warn_upper, crit_upper) + perfdata = [ ("fan", rpm, warn, crit, warn_upper, crit_upper)] + # Note that None < int if rpm < crit or crit_upper != None and rpm >= crit_upper: message += levelstext - return 2, message + return 2, message, perfdata elif rpm < warn or warn_upper != None and rpm >= warn_upper: message += levelstext - return 1, message + return 1, message, perfdata else: - return 0, message + return 0, message, perfdata diff --git a/checks/fsc_fans b/checks/fsc_fans index 014bf66..10e9369 100644 --- a/checks/fsc_fans +++ b/checks/fsc_fans @@ -40,11 +40,12 @@ def check_fsc_fans(item, params, info): check_info["fsc_fans"] = { - 'check_function': check_fsc_fans, - 'inventory_function': inventory_fsc_fans, - 'group': "hw_fans", - 'service_description': 'FSC %s', - 'snmp_info': ('.1.3.6.1.4.1.231.2.10.2.2.5.2.2.1', [16, 8]), - 'snmp_scan_function': lambda oid: oid(".1.3.6.1.4.1.231.2.10.2.1.1.0"), - 'includes': [ 'fan.include' ], + 'inventory_function' : inventory_fsc_fans, + 'check_function' : check_fsc_fans, + 'service_description' : 'FSC %s', + 'snmp_info' : ('.1.3.6.1.4.1.231.2.10.2.2.5.2.2.1', [16, 8]), + 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.4.1.231.2.10.2.1.1.0"), + 'has_perfdata' : True, + 'group' : "hw_fans", + 'includes' : [ 'fan.include' ], } diff --git a/checks/netextreme_fan b/checks/netextreme_fan index 4c957cd..e1c9a9a 100644 --- a/checks/netextreme_fan +++ b/checks/netextreme_fan @@ -58,6 +58,7 @@ check_info['netextreme_fan'] = { "4", # extremeFanSpeed (RPM) ]), 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.1916.2"), + 'has_perfdata' : True, 'group' : 'hw_fans', 'default_levels_variable' : 'netextreme_fan_default_levels', 'includes' : [ "fan.include" ], diff --git a/checks/netscaler_health b/checks/netscaler_health index 8ea511b..3b5cafc 100644 --- a/checks/netscaler_health +++ b/checks/netscaler_health @@ -77,13 +77,14 @@ def check_netscaler_health_fan(item, params, info): return check_fan(int(value), params) check_info["netscaler_health.fan"] = { - "check_function" : check_netscaler_health_fan, "inventory_function" : inventory_netscaler_health_fan, + "check_function" : check_netscaler_health_fan, "service_description" : "FAN %s", - "group" : "hw_fans", "snmp_info" : netscaler_health_info, "snmp_scan_function" : netscaler_health_scan, + "has_perfdata" : True, "default_levels_variable" : "netscaler_health_fan_default_levels", + "group" : "hw_fans", "includes" : [ "fan.include" ], } #. diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py index e73ae02..b2623ae 100644 --- a/web/plugins/metrics/check_mk.py +++ b/web/plugins/metrics/check_mk.py @@ -216,6 +216,12 @@ unit_info["l/s"] = { "render" : lambda v: physical_precision(v, 3, _("l/s")), } +unit_info["rpm"] = { + "title" : _("Rounds Per Minute"), + "symbol" : _("rpm"), + "render" : lambda v: physical_precision(v, 4, _("rpm")), +} + #. # .--Metrics-------------------------------------------------------------. # | __ __ _ _ | @@ -3745,6 +3751,12 @@ metric_info["filehandler_perc"] = { "color" : "#4800ff", } +metric_info["fan"] = { + "title" : _("Fan speed"), + "unit" : "rpm", + "color" : "16/b" +} + #. # .--Checks--------------------------------------------------------------. # | ____ _ _ | @@ -5702,6 +5714,13 @@ perfometer_info.append({ "total" : 100.0, }) +perfometer_info.append({ + "type" : "logarithmic", + "metric" : "fan", + "half_value": 3000, + "exponent" : 2, +}) + #. # .--Graphs--------------------------------------------------------------. # | ____ _ | @@ -5724,6 +5743,13 @@ perfometer_info.append({ # ('tablespace_used', 'area') graph_info.append({ + "title" : _("Fan speed"), + "metrics" : [ + ( "fan_speed", "area" ), + ] +}) + +graph_info.append({ "title" : _("Context switches"), "metrics" : [ ( "vol_context_switches", "area" ),
8 years, 1 month
1
0
0
0
Fetched Livestatus from downstream.
by Sven Panne
Module: check_mk Branch: master Commit: 42dc2f20cc3c8db186178b1ab40aa3ad807359e9 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=42dc2f20cc3c8d…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Wed Nov 2 13:21:03 2016 +0100 Fetched Livestatus from downstream. --- livestatus/src/DynamicEventConsoleReplicationColumn.cc | 11 +++++++---- livestatus/src/EventConsoleConnection.cc | 2 +- livestatus/src/EventConsoleConnection.h | 3 +-- livestatus/src/MonitoringCore.h | 1 + livestatus/src/TableEventConsole.cc | 7 +++++-- livestatus/src/module.cc | 3 +++ 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/livestatus/src/DynamicEventConsoleReplicationColumn.cc b/livestatus/src/DynamicEventConsoleReplicationColumn.cc index ca1f35e..95e0df3 100644 --- a/livestatus/src/DynamicEventConsoleReplicationColumn.cc +++ b/livestatus/src/DynamicEventConsoleReplicationColumn.cc @@ -79,8 +79,11 @@ DynamicEventConsoleReplicationColumn::DynamicEventConsoleReplicationColumn( Column *DynamicEventConsoleReplicationColumn::createColumn( const std::string &name, const std::string &arguments) { - ECTableConnection ec(_core, "REPLICATE " + arguments); - ec.run(); - return new ReplicationColumn(name, "replication value", -1, -1, - ec.getResult()); + string result; + if (_core->mkeventdEnabled()) { + ECTableConnection ec(_core, "REPLICATE " + arguments); + ec.run(); + result = ec.getResult(); + } + return new ReplicationColumn(name, "replication value", -1, -1, result); } diff --git a/livestatus/src/EventConsoleConnection.cc b/livestatus/src/EventConsoleConnection.cc index 50e47cd..912775b 100644 --- a/livestatus/src/EventConsoleConnection.cc +++ b/livestatus/src/EventConsoleConnection.cc @@ -38,7 +38,7 @@ using std::string; EventConsoleConnection::EventConsoleConnection(Logger *logger, string path) : _path(move(path)), _socket(-1), _logger(logger, [this](ostream &os) { - os << "[mkeventd at " << getPath() << "] "; + os << "[mkeventd at " << _path << "] "; }) {} void EventConsoleConnection::run() { diff --git a/livestatus/src/EventConsoleConnection.h b/livestatus/src/EventConsoleConnection.h index ac63ab4..cb65078 100644 --- a/livestatus/src/EventConsoleConnection.h +++ b/livestatus/src/EventConsoleConnection.h @@ -32,8 +32,7 @@ class EventConsoleConnection { public: - explicit EventConsoleConnection(Logger *logger, std::string path); - std::string getPath() const { return _path; } + EventConsoleConnection(Logger *logger, std::string path); void run(); protected: diff --git a/livestatus/src/MonitoringCore.h b/livestatus/src/MonitoringCore.h index 83637c4..01a9d7a 100644 --- a/livestatus/src/MonitoringCore.h +++ b/livestatus/src/MonitoringCore.h @@ -45,6 +45,7 @@ public: virtual bool is_contact_member_of_contactgroup(ContactGroup *group, Contact *contact) = 0; + virtual bool mkeventdEnabled() = 0; virtual std::string mkeventdSocketPath() = 0; virtual Logger *loggerLivestatus() = 0; diff --git a/livestatus/src/TableEventConsole.cc b/livestatus/src/TableEventConsole.cc index 9b3280d..6448282 100644 --- a/livestatus/src/TableEventConsole.cc +++ b/livestatus/src/TableEventConsole.cc @@ -102,6 +102,9 @@ TableEventConsole::TableEventConsole(MonitoringCore *core) : Table(core->loggerLivestatus()), _core(core) {} void TableEventConsole::answerQuery(Query *query) { - string internal_name = name().substr(12); // skip "eventconsole" prefix :-P - ECTableConnection(_core, internal_name, query).run(); + if (_core->mkeventdEnabled()) { + string internal_name = + name().substr(12); // skip "eventconsole" prefix :-P + ECTableConnection(_core, internal_name, query).run(); + } } diff --git a/livestatus/src/module.cc b/livestatus/src/module.cc index a0becd5..e58eece 100644 --- a/livestatus/src/module.cc +++ b/livestatus/src/module.cc @@ -597,6 +597,9 @@ public: toImpl(contact)) != 0; } + // TODO(sp) Do we need a separate NEB argument for this? + bool mkeventdEnabled() override { return true; } + string mkeventdSocketPath() override { return g_mkeventd_socket_path; } Logger *loggerLivestatus() override { return fl_logger_livestatus; }
8 years, 1 month
1
0
0
0
Fetched Livestatus from downstream.
by Sven Panne
Module: check_mk Branch: master Commit: c18812d4d48a92c063b63d54ac617b00c8f847b1 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c18812d4d48a92…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Wed Nov 2 11:34:52 2016 +0100 Fetched Livestatus from downstream. --- livestatus/src/MonitoringCore.h | 7 +++++ livestatus/src/TableEventConsole.h | 2 +- livestatus/src/TableEventConsoleEvents.cc | 44 ++++-------------------------- livestatus/src/TableEventConsoleHistory.cc | 44 ++++-------------------------- livestatus/src/module.cc | 30 +++++++++++++++++++- 5 files changed, 49 insertions(+), 78 deletions(-) diff --git a/livestatus/src/MonitoringCore.h b/livestatus/src/MonitoringCore.h index 591e7e7..83637c4 100644 --- a/livestatus/src/MonitoringCore.h +++ b/livestatus/src/MonitoringCore.h @@ -32,11 +32,18 @@ class Logger; /// An abstraction layer for the monitoring core (nagios or cmc) class MonitoringCore { public: + class Contact; + class ContactGroup; class Host; virtual ~MonitoringCore() = default; virtual Host *getHostByDesignation(const std::string &designation) = 0; + virtual ContactGroup *find_contactgroup(const std::string &name) = 0; + + virtual bool host_has_contact(Host *host, Contact *contact) = 0; + virtual bool is_contact_member_of_contactgroup(ContactGroup *group, + Contact *contact) = 0; virtual std::string mkeventdSocketPath() = 0; diff --git a/livestatus/src/TableEventConsole.h b/livestatus/src/TableEventConsole.h index ade3bae..35819d5 100644 --- a/livestatus/src/TableEventConsole.h +++ b/livestatus/src/TableEventConsole.h @@ -193,7 +193,7 @@ protected: } }; -private: +protected: MonitoringCore *_core; }; diff --git a/livestatus/src/TableEventConsoleEvents.cc b/livestatus/src/TableEventConsoleEvents.cc index 5d63fcf..beb7a2d 100644 --- a/livestatus/src/TableEventConsoleEvents.cc +++ b/livestatus/src/TableEventConsoleEvents.cc @@ -28,14 +28,6 @@ #include "Table.h" #include "TableHosts.h" -#ifdef CMC -#include "ContactGroup.h" -#include "Host.h" -#include "World.h" -#else -#include "auth.h" -#endif - using std::string; #ifdef CMC @@ -132,38 +124,12 @@ string TableEventConsoleEvents::namePrefix() const { return "eventconsoleevents_"; } -// TODO(sp) Move this into some kind of abstraction layer. -namespace { -bool hasContact(MonitoringCore::Host *hst, contact *ctc) { -#ifdef CMC - return hst != nullptr && reinterpret_cast<Host *>(hst)->hasContact(ctc); -#else - return is_authorized_for(ctc, reinterpret_cast<host *>(hst), nullptr); -#endif -} - -bool hasContact(contactgroup *cg, contact *ctc) { -#ifdef CMC - return cg != nullptr && cg->isMember(ctc); -#else - return is_contact_member_of_contactgroup(cg, ctc) != 0; -#endif -} - -contactgroup *getContactGroup(const string &name) { -#ifdef CMC - return g_live_world->getContactGroup(name); -#else - // Older Nagios headers are not const-correct... :-P - return find_contactgroup(const_cast<char *>(name.c_str())); -#endif -} -} // namespace - // TODO(sp) This is copy-n-pasted in TableEventConsoleHistory. +// TODO(sp) Remove evil casts below. bool TableEventConsoleEvents::isAuthorized(contact *ctc, void *data) { if (MonitoringCore::Host *hst = static_cast<Row *>(data)->_host) { - return hasContact(hst, ctc); + return _core->host_has_contact( + hst, reinterpret_cast<MonitoringCore::Contact *>(ctc)); } ListEventConsoleColumn *col = @@ -173,7 +139,9 @@ bool TableEventConsoleEvents::isAuthorized(contact *ctc, void *data) { } for (const auto &name : col->getValue(data)) { - if (hasContact(getContactGroup(name), ctc)) { + if (_core->is_contact_member_of_contactgroup( + _core->find_contactgroup(name), + reinterpret_cast<MonitoringCore::Contact *>(ctc))) { return true; } } diff --git a/livestatus/src/TableEventConsoleHistory.cc b/livestatus/src/TableEventConsoleHistory.cc index aa52a30..69f0a8a 100644 --- a/livestatus/src/TableEventConsoleHistory.cc +++ b/livestatus/src/TableEventConsoleHistory.cc @@ -27,14 +27,6 @@ #include "MonitoringCore.h" #include "TableEventConsoleEvents.h" -#ifdef CMC -#include "ContactGroup.h" -#include "Host.h" -#include "World.h" -#else -#include "auth.h" -#endif - using std::string; #ifdef CMC @@ -79,38 +71,12 @@ string TableEventConsoleHistory::namePrefix() const { return "eventconsolehistory_"; } -// TODO(sp) Move this into some kind of abstraction layer. -namespace { -bool hasContact(MonitoringCore::Host *hst, contact *ctc) { -#ifdef CMC - return hst != nullptr && reinterpret_cast<Host *>(hst)->hasContact(ctc); -#else - return is_authorized_for(ctc, reinterpret_cast<host *>(hst), nullptr); -#endif -} - -bool hasContact(contactgroup *cg, contact *ctc) { -#ifdef CMC - return cg != nullptr && cg->isMember(ctc); -#else - return is_contact_member_of_contactgroup(cg, ctc) != 0; -#endif -} - -contactgroup *getContactGroup(const string &name) { -#ifdef CMC - return g_live_world->getContactGroup(name); -#else - // Older Nagios headers are not const-correct... :-P - return find_contactgroup(const_cast<char *>(name.c_str())); -#endif -} -} // namespace - // TODO(sp) This is copy-n-pasted in TableEventConsoleEvents. +// TODO(sp) Remove evil casts below. bool TableEventConsoleHistory::isAuthorized(contact *ctc, void *data) { if (MonitoringCore::Host *hst = static_cast<Row *>(data)->_host) { - return hasContact(hst, ctc); + return _core->host_has_contact( + hst, reinterpret_cast<MonitoringCore::Contact *>(ctc)); } ListEventConsoleColumn *col = @@ -120,7 +86,9 @@ bool TableEventConsoleHistory::isAuthorized(contact *ctc, void *data) { } for (const auto &name : col->getValue(data)) { - if (hasContact(getContactGroup(name), ctc)) { + if (_core->is_contact_member_of_contactgroup( + _core->find_contactgroup(name), + reinterpret_cast<MonitoringCore::Contact *>(ctc))) { return true; } } diff --git a/livestatus/src/module.cc b/livestatus/src/module.cc index 94b7277..a0becd5 100644 --- a/livestatus/src/module.cc +++ b/livestatus/src/module.cc @@ -576,17 +576,45 @@ int broker_event(int event_type __attribute__((__unused__)), void *data) { class NagiosCore : public MonitoringCore { public: - Host *getHostByDesignation(const std::string &designation) override { + Host *getHostByDesignation(const string &designation) override { auto it = fl_hosts_by_designation.find(unsafe_tolower(designation)); return it == fl_hosts_by_designation.end() ? nullptr : fromImpl(it->second); } + bool host_has_contact(Host *host, Contact *contact) override { + return is_authorized_for(toImpl(contact), toImpl(host), nullptr); + } + + ContactGroup *find_contactgroup(const std::string &name) override { + // Older Nagios headers are not const-correct... :-P + return fromImpl(::find_contactgroup(const_cast<char *>(name.c_str()))); + } + + bool is_contact_member_of_contactgroup(ContactGroup *group, + Contact *contact) override { + return ::is_contact_member_of_contactgroup(toImpl(group), + toImpl(contact)) != 0; + } + string mkeventdSocketPath() override { return g_mkeventd_socket_path; } Logger *loggerLivestatus() override { return fl_logger_livestatus; } private: + static contact *toImpl(Contact *c) { + return reinterpret_cast<contact *>(c); + } + + static contactgroup *toImpl(ContactGroup *g) { + return reinterpret_cast<contactgroup *>(g); + } + + static ContactGroup *fromImpl(contactgroup *g) { + return reinterpret_cast<ContactGroup *>(g); + } + + static host *toImpl(Host *h) { return reinterpret_cast<host *>(h); } static Host *fromImpl(host *h) { return reinterpret_cast<Host *>(h); } };
8 years, 1 month
1
0
0
0
Fixed test after HTML cleanup
by Lars Michelsen
Module: check_mk Branch: master Commit: c2bfb2a6cb07fb5d4b127e5632dc7691922ecfbc URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c2bfb2a6cb07fb…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Nov 2 11:19:18 2016 +0100 Fixed test after HTML cleanup --- tests/testlib/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py index 524c34f..96a39b2 100644 --- a/tests/testlib/__init__.py +++ b/tests/testlib/__init__.py @@ -287,8 +287,7 @@ class Site(object): # Call WATO once for creating the default WATO configuration response = web.get("wato.py").text assert "<title>WATO" in response - print "Got response: %s" % response - assert "<div class=title>Manual Checks</div>" in response + assert "<div class=\"title\">Manual Checks</div>" in response for f in [ "etc/check_mk/conf.d/wato/rules.mk",
8 years, 1 month
1
0
0
0
Added debug output to test
by Lars Michelsen
Module: check_mk Branch: master Commit: bf009117a76b0e23884eea491dde0e5459c38a9c URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bf009117a76b0e…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Nov 2 10:51:20 2016 +0100 Added debug output to test --- tests/testlib/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py index f98e23e..524c34f 100644 --- a/tests/testlib/__init__.py +++ b/tests/testlib/__init__.py @@ -287,6 +287,7 @@ class Site(object): # Call WATO once for creating the default WATO configuration response = web.get("wato.py").text assert "<title>WATO" in response + print "Got response: %s" % response assert "<div class=title>Manual Checks</div>" in response for f in [
8 years, 1 month
1
0
0
0
3974 FIX Sorting comments in hover menu of comments icon by time now
by Lars Michelsen
Module: check_mk Branch: master Commit: a26e4e610908cb98554ae9d92d19528c0c29603d URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a26e4e610908cb…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Nov 2 08:20:37 2016 +0100 3974 FIX Sorting comments in hover menu of comments icon by time now --- .werks/3974 | 10 ++++++++++ ChangeLog | 1 + web/plugins/icons/builtin.py | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.werks/3974 b/.werks/3974 new file mode 100644 index 0000000..425d21c --- /dev/null +++ b/.werks/3974 @@ -0,0 +1,10 @@ +Title: Sorting comments in hover menu of comments icon by time now +Level: 1 +Component: multisite +Class: fix +Compatible: compat +State: unknown +Version: 1.4.0i2 +Date: 1478071210 + + diff --git a/ChangeLog b/ChangeLog index 7ca5610..b367a71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -57,6 +57,7 @@ * 3969 FIX: CentOS 5.5: Fixed incompatibility with the available OpenSSL 0.98... * 4037 FIX: Fix graphs that have optional metrics... * 3973 FIX: Backup: Fixed displaying wrong finish time after backup completion + * 3974 FIX: Sorting comments in hover menu of comments icon by time now WATO: * 3915 User access times: New icon when never logged in; New column "last seen" diff --git a/web/plugins/icons/builtin.py b/web/plugins/icons/builtin.py index e8ed731..284f02e 100644 --- a/web/plugins/icons/builtin.py +++ b/web/plugins/icons/builtin.py @@ -550,7 +550,7 @@ def paint_comment_icon(what, row, tags, host_custom_vars): comments = row[what + "_comments_with_extra_info"] if len(comments) > 0: text = "" - for c in comments: + for c in sorted(comments, key=lambda x: x[4]): id, author, comment, ty, timestamp = c comment = comment.replace("\n", "<br>") text += "%s %s: \"%s\" \n" % (paint_age(timestamp, True, 0, 'abs')[1], author, comment)
8 years, 1 month
1
0
0
0
← Newer
1
...
27
28
29
30
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
Results per page:
10
25
50
100
200