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
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
July 2013
----- 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
4 participants
235 discussions
Start a n
N
ew thread
Check_MK Git: check_mk: Multisite: new status icons: export as csv, export as json
by Andreas Boesl
Module: check_mk Branch: master Commit: 492ac9304c4ab54facdd1682ccd08ce144a18ce1 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=492ac9304c4ab5…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Thu Jul 4 17:23:55 2013 +0200 Multisite: new status icons: export as csv, export as json --- ChangeLog | 1 + web/htdocs/htmllib.py | 5 ++++ web/plugins/views/webservice.py | 62 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e29dea..48a2781 100644 --- a/ChangeLog +++ b/ChangeLog @@ -76,6 +76,7 @@ via "sidebar_show_scrollbar = True" in multisite.mk * Added option to disable automatic userdb synchronizations in multisite * Implemented search forms for most data tables + * New status icons: export as CSV, export as JSON WATO: * Allow to configure check-/retry_interval in second precision diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 4f7cd04..5f16179 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -965,6 +965,11 @@ document.body.onfocus = keybindings_focus; (self.makeuri([]), _("URL to this frame")) h += '<a target="_top" href="%s"><img class=statusicon src="images/status_pageurl.png" title="%s"></a>\n' % \ ("index.py?" + urlencode_vars([("start_url", self.makeuri([]))]), _("URL to this page including sidebar")) + + h += '<a target="_top" href="%s"><img class=statusicon src="images/status_frameurl.png" title="%s"></a>\n' % \ + (self.makeuri([("output_format", "json_export")]), _("Export as JSON")) + h += '<a target="_top" href="%s"><img class=statusicon src="images/status_frameurl.png" title="%s"></a>\n' % \ + (self.makeuri([("output_format", "csv_export")]), _("Export as CSV")) for img, tooltip in self.status_icons.items(): h += '<img class=statusicon src="images/status_%s.png" title="%s">\n' % (img, tooltip) return h diff --git a/web/plugins/views/webservice.py b/web/plugins/views/webservice.py index ed31b35..1e8cfce 100644 --- a/web/plugins/views/webservice.py +++ b/web/plugins/views/webservice.py @@ -63,7 +63,12 @@ def encode_string_json(s): return '"' + json_escape.sub(lambda m: json_encoding_table[m.group(0)], s) + '"' -def render_json(rows, view, group_painters, painters, num_columns, show_checkboxes): +def render_json(rows, view, group_painters, painters, num_columns, show_checkboxes, export = False): + if export: + html.req.content_type = "appliation/json; charset=UTF-8" + filename = '%s-%s.json' % (view['name'], time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime(time.time()))) + html.req.headers_out['Content-Disposition'] = 'Attachment; filename=%s' % filename + html.write("[\n") first = True @@ -97,9 +102,62 @@ def render_json(rows, view, group_painters, painters, num_columns, show_checkbox html.write("\n]\n") +multisite_layouts["json_export"] = { + "title" : _("JSON data export"), + "render" : lambda a,b,c,d,e,f: render_json(a,b,c,d,e,f,True), + "group" : False, + "hide" : True, +} + multisite_layouts["json"] = { "title" : _("JSON data output"), - "render" : render_json, + "render" : lambda a,b,c,d,e,f: render_json(a,b,c,d,e,f,False), + "group" : False, + "hide" : True, +} + + +def render_csv(rows, view, group_painters, painters, num_columns, show_checkboxes, export = False): + if export: + html.req.content_type = "text/csv; charset=UTF-8" + filename = '%s-%s.csv' % (view['name'], time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime(time.time()))) + html.req.headers_out['Content-Disposition'] = 'Attachment; filename=%s' % filename + + csv_separator = html.var("csv_separator", ",") + first = True + for p in painters: + if first: + first = False + else: + html.write(csv_separator) + content = p[0]["name"] + stripped = htmllib.strip_tags(content) + stripped = stripped.replace(csv_separator, "\%s" % csv_separator) + html.write(stripped.encode("utf-8")) + + for row in rows: + html.write("\n") + first = True + for p in painters: + if first: + first = False + else: + html.write(csv_separator) + tdclass, content = p[0]["paint"](row) + stripped = htmllib.strip_tags(content) + stripped = stripped.replace(csv_separator, "\%s" % csv_separator) + html.write(stripped.encode("utf-8")) + +multisite_layouts["csv_export"] = { + "title" : _("CSV data export"), + "render" : lambda a,b,c,d,e,f: render_csv(a,b,c,d,e,f,True), + "group" : False, + "hide" : True, +} + +multisite_layouts["csv"] = { + "title" : _("CSV data output"), + "render" : lambda a,b,c,d,e,f: render_csv(a,b,c,d,e,f,False), "group" : False, "hide" : True, }
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: Livestatus: experimental speedup of statehist table
by Mathias Kettner
Module: check_mk Branch: master Commit: b7bfd1a8095680d484891b4b965c169507444407 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b7bfd1a8095680…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Thu Jul 4 17:15:36 2013 +0200 Livestatus: experimental speedup of statehist table --- livestatus/src/Column.h | 4 -- livestatus/src/Filter.h | 10 ++--- livestatus/src/Query.cc | 2 +- livestatus/src/Query.h | 1 + livestatus/src/Table.cc | 1 - livestatus/src/TableStateHistory.cc | 84 +++++++++++++++++++++++++++++------ livestatus/src/TableStateHistory.h | 2 +- livestatus/src/module.c | 5 +++ 8 files changed, 84 insertions(+), 25 deletions(-) diff --git a/livestatus/src/Column.h b/livestatus/src/Column.h index eba28fe..5fe9b33 100644 --- a/livestatus/src/Column.h +++ b/livestatus/src/Column.h @@ -46,7 +46,6 @@ class Column { string _name; string _description; - Table *_table; public: int _indirect_offset; int _extra_offset; @@ -63,9 +62,6 @@ public: virtual Filter *createFilter(int opid __attribute__ ((__unused__)), char *value __attribute__ ((__unused__))) { return 0; } void *shiftPointer(void *data); void setExtraOffset(int o) { _extra_offset = o; } - void setTable(Table *t) { _table = t; } - Table *table() { return _table; } - }; #endif // Column_h diff --git a/livestatus/src/Filter.h b/livestatus/src/Filter.h index d7beef8..5162058 100644 --- a/livestatus/src/Filter.h +++ b/livestatus/src/Filter.h @@ -33,27 +33,27 @@ using namespace std; class Query; -class Table; +class Column; class Filter { string _error_message; // Error in constructor unsigned _error_code; - Table *_table; + Column *_column; protected: Query *_query; // needed by TimeOffsetFilter (currently) void setError(unsigned code, const char *format, ...); public: - Filter() : _query(0) {} + Filter() : _query(0), _column(0) {} virtual ~Filter() {} string errorMessage() { return _error_message; } unsigned errorCode() { return _error_code; } bool hasError() { return _error_message != ""; } void setQuery(Query *q) { _query = q; } - void setTable(Table *t) { _table = t; } - Table *table() { return _table; } + void setColumn(Column *c) { _column = c; } + Column *column() { return _column; } virtual bool accepts(void *data) = 0; virtual void *indexFilter(const char *columnname __attribute__ ((__unused__))) { return 0; } virtual void findIntLimits(const char *columnname __attribute__ ((__unused__)), int *lower __attribute__ ((__unused__)), int *upper __attribute__ ((__unused__))) {} diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc index 0fccb09..138ce94 100644 --- a/livestatus/src/Query.cc +++ b/livestatus/src/Query.cc @@ -249,7 +249,7 @@ Filter *Query::createFilter(Column *column, int operator_id, char *value) } else { filter->setQuery(this); - filter->setTable(column->table()); + filter->setColumn(column); } return filter; } diff --git a/livestatus/src/Query.h b/livestatus/src/Query.h index d8c05ef..82b864a 100644 --- a/livestatus/src/Query.h +++ b/livestatus/src/Query.h @@ -130,6 +130,7 @@ public: void findIntLimits(const char *columnname, int *lower, int *upper); void optimizeBitmask(const char *columnname, uint32_t *bitmask); int timezoneOffset() { return _timezone_offset; } + AndingFilter *filter() { return &_filter; } private: bool doStats(); diff --git a/livestatus/src/Table.cc b/livestatus/src/Table.cc index a64abb3..9c5c23d 100644 --- a/livestatus/src/Table.cc +++ b/livestatus/src/Table.cc @@ -40,7 +40,6 @@ void Table::addColumn(Column *col) } else { _columns.insert(make_pair(col->name(), col)); - col->setTable(this); } } diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc index c56a942..2041511 100644 --- a/livestatus/src/TableStateHistory.cc +++ b/livestatus/src/TableStateHistory.cc @@ -28,6 +28,7 @@ #include <unistd.h> #include <stddef.h> #include <stdarg.h> +#include <list> #include "nagios.h" #include "logger.h" @@ -48,6 +49,8 @@ #include "Timeperiod.h" #endif +int g_disable_statehist_filtering = 0; + typedef pair<string, string> HostServiceKey; @@ -256,6 +259,38 @@ LogEntry *TableStateHistory::getNextLogentry() void TableStateHistory::answerQuery(Query *query) { + // Create a partial filter, that contains only such filters that + // check attributes of current hosts and services + typedef deque<Filter *> object_filter_t; + object_filter_t object_filter; + AndingFilter *orig_filter = query->filter(); + + if (!g_disable_statehist_filtering) { + deque<Filter *>::iterator it = orig_filter->begin(); + while (it != orig_filter->end()) { + Filter *filter = *it; + Column *column = filter->column(); + if (column) { + const char *column_name = column->name(); + if (!strncmp(column_name, "current_", 8) + || !strncmp(column_name, "host_", 5) + || !strncmp(column_name, "service_", 8)) + { + object_filter.push_back(filter); + // logger(LOG_NOTICE, "Nehme Column: %s", column_name); + } + else { + // logger(LOG_NOTICE, "Column geht nciht: %s", column_name); + } + } + else { + // logger(LOG_NOTICE, "Mist: Filter ohne Column"); + } + ++it; + } + } + + g_store->logCache()->lockLogCache(); g_store->logCache()->logCachePreChecks(); @@ -390,22 +425,42 @@ void TableStateHistory::answerQuery(Query *query) state_info_t::iterator it_hst = state_info.find(key); if (it_hst == state_info.end()) { - // No state found. Now check if this host/services is filtered out - if (objectFilteredOut(entry->_host_name, entry->_svc_desc)) { - object_blacklist.insert(key); - continue; + // Create state object that we also need for filtering right now + state = new HostServiceState(); + state->_is_host = entry->_svc_desc == 0; + state->_host = entry->_host; + state->_service = entry->_service; + state->_host_name = key.first.c_str(); + state->_service_description = key.second.c_str(); + + // No state found. Now check if this host/services is filtered out. + // Note: we currently do not filter out hosts since they might be + // needed for service states + if (entry->_svc_desc) + { + bool filtered_out = false; + for (object_filter_t::iterator it = object_filter.begin(); + it != object_filter.end(); + ++it) + { + Filter *filter = *it; + if (!filter->accepts(state)) { + // logger(LOG_NOTICE, "kann ich rausschmeissen: %s/%s", key.first.c_str(), key.second.c_str()); + filtered_out = true; + break; + } + } + + if (filtered_out) { + object_blacklist.insert(key); + delete state; + continue; + } } - state = new HostServiceState(); + // Store this state object for tracking state transitions state_info.insert(std::make_pair(key, state)); - - state->_is_host = entry->_svc_desc == 0; state->_from = _since; - state->_host = entry->_host; - state->_service = entry->_service; - - state->_host_name = key.first.c_str(); - state->_service_description = key.second.c_str(); // Get notification period of host/service // If this host/service is no longer availabe in nagios -> set to "" @@ -524,8 +579,11 @@ void TableStateHistory::answerQuery(Query *query) g_store->logCache()->unlockLogCache(); } -bool TableStateHistory::objectFilteredOut(const char *host_name, const char *service_description) +bool TableStateHistory::objectFilteredOut(Query *query, void *entry) { + + + return false; } diff --git a/livestatus/src/TableStateHistory.h b/livestatus/src/TableStateHistory.h index 5c0b82e..69b9536 100644 --- a/livestatus/src/TableStateHistory.h +++ b/livestatus/src/TableStateHistory.h @@ -68,7 +68,7 @@ private: LogEntry* getPreviousLogentry(); LogEntry* getNextLogentry(); void process(Query *query, HostServiceState *hs_state); - bool objectFilteredOut(const char *host_name, const char *service_description); + bool objectFilteredOut(Query *, void *entry); }; diff --git a/livestatus/src/module.c b/livestatus/src/module.c index 47c66a6..a3f9cd8 100644 --- a/livestatus/src/module.c +++ b/livestatus/src/module.c @@ -84,6 +84,7 @@ int g_num_clientthreads = 10; /* allow 10 concurrent connections per default int g_num_queued_connections = 0; /* current number of queued connections (for statistics) */ int g_num_active_connections = 0; /* current number of active connections (for statistics) */ size_t g_thread_stack_size = 65536; /* stack size of threads */ +extern int g_disable_statehist_filtering; #define false 0 #define true 1 @@ -760,6 +761,10 @@ void livestatus_parse_arguments(const char *args_orig) else if (!strcmp(left, "num_livecheck_helpers")) { g_num_livehelpers = atoi(right); } + else if (!strcmp(left, "disable_statehist_filtering")) + { + g_disable_statehist_filtering = atoi(right); + } else { logger(LG_INFO, "Ignoring invalid option %s=%s", left, right); }
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: Availability: fix exceptions when no hosts/ services are selected
by Mathias Kettner
Module: check_mk Branch: master Commit: 60264e518261cb654fcd060c39e0a12ac0737a61 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=60264e518261cb…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Thu Jul 4 16:28:38 2013 +0200 Availability: fix exceptions when no hosts/services are selected --- livestatus/src/Column.h | 4 ++ livestatus/src/Filter.h | 4 ++ livestatus/src/Query.cc | 4 +- livestatus/src/Table.cc | 4 +- livestatus/src/TableStateHistory.cc | 83 ++++++++++++++++++++++++++++++++++- livestatus/src/TableStateHistory.h | 58 +----------------------- web/plugins/views/availability.py | 4 ++ 7 files changed, 102 insertions(+), 59 deletions(-) diff --git a/livestatus/src/Column.h b/livestatus/src/Column.h index 197d427..eba28fe 100644 --- a/livestatus/src/Column.h +++ b/livestatus/src/Column.h @@ -40,11 +40,13 @@ using namespace std; class Filter; class Query; +class Table; class Column { string _name; string _description; + Table *_table; public: int _indirect_offset; int _extra_offset; @@ -61,6 +63,8 @@ public: virtual Filter *createFilter(int opid __attribute__ ((__unused__)), char *value __attribute__ ((__unused__))) { return 0; } void *shiftPointer(void *data); void setExtraOffset(int o) { _extra_offset = o; } + void setTable(Table *t) { _table = t; } + Table *table() { return _table; } }; diff --git a/livestatus/src/Filter.h b/livestatus/src/Filter.h index 577a78f..d7beef8 100644 --- a/livestatus/src/Filter.h +++ b/livestatus/src/Filter.h @@ -33,11 +33,13 @@ using namespace std; class Query; +class Table; class Filter { string _error_message; // Error in constructor unsigned _error_code; + Table *_table; protected: Query *_query; // needed by TimeOffsetFilter (currently) @@ -50,6 +52,8 @@ public: unsigned errorCode() { return _error_code; } bool hasError() { return _error_message != ""; } void setQuery(Query *q) { _query = q; } + void setTable(Table *t) { _table = t; } + Table *table() { return _table; } virtual bool accepts(void *data) = 0; virtual void *indexFilter(const char *columnname __attribute__ ((__unused__))) { return 0; } virtual void findIntLimits(const char *columnname __attribute__ ((__unused__)), int *lower __attribute__ ((__unused__)), int *upper __attribute__ ((__unused__))) {} diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc index cd0521e..0fccb09 100644 --- a/livestatus/src/Query.cc +++ b/livestatus/src/Query.cc @@ -247,8 +247,10 @@ Filter *Query::createFilter(Column *column, int operator_id, char *value) delete filter; filter = 0; } - else + else { filter->setQuery(this); + filter->setTable(column->table()); + } return filter; } diff --git a/livestatus/src/Table.cc b/livestatus/src/Table.cc index 8e3d350..a64abb3 100644 --- a/livestatus/src/Table.cc +++ b/livestatus/src/Table.cc @@ -38,8 +38,10 @@ void Table::addColumn(Column *col) if (column(col->name())) { delete col; } - else + else { _columns.insert(make_pair(col->name(), col)); + col->setTable(this); + } } diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc index ce774df..0c6d32d 100644 --- a/livestatus/src/TableStateHistory.cc +++ b/livestatus/src/TableStateHistory.cc @@ -49,6 +49,62 @@ #endif +typedef pair<string, string> HostServiceKey; + +struct HostServiceState { + bool _is_host; + time_t _time; + int _lineno; + time_t _from; + time_t _until; + + time_t _duration; + double _duration_part; + + // Do not change order within this block! + // These durations will be bzero'd + time_t _duration_state_UNMONITORED; + double _duration_part_UNMONITORED; + time_t _duration_state_OK; + double _duration_part_OK; + time_t _duration_state_WARNING; + double _duration_part_WARNING; + time_t _duration_state_CRITICAL; + double _duration_part_CRITICAL; + time_t _duration_state_UNKNOWN; + double _duration_part_UNKNOWN; + + // State information + int _host_down; // used if service + int _state; // -1/0/1/2/3 + int _in_notification_period; + int _in_downtime; + int _in_host_downtime; + int _is_flapping; + + + // Absent state handling + bool _may_no_longer_exist; + bool _has_vanished; + time_t _last_known_time; + + + const char *_debug_info; + // Pointer to dynamically allocated strings (strdup) that live here. + // These pointers are 0, if there is no output (e.g. downtime) + char *_log_output; + char *_notification_period; // may be "": -> no period known, we assume "always" + host *_host; + service *_service; + const char *_host_name; // Fallback if host no longer exists + const char *_service_description; // Fallback if service no longer exists + + HostServiceState() { bzero(this, sizeof(HostServiceState)); } + ~HostServiceState(); + void debug_me(const char *loginfo, ...); +}; + + #define CHECK_MEM_CYCLE 1000 /* Check memory every N'th new message */ extern Store *g_store; @@ -203,9 +259,14 @@ void TableStateHistory::answerQuery(Query *query) g_store->logCache()->lockLogCache(); g_store->logCache()->logCachePreChecks(); + // Keep track of the historic state of services/hosts here typedef map<HostServiceKey, HostServiceState*> state_info_t; state_info_t state_info; + // Store hosts/services that we have filtered out here + typedef set<HostServiceKey> object_blacklist_t; + object_blacklist_t object_blacklist; + _query = query; _since = 0; _until = time(0) + 1; @@ -317,9 +378,24 @@ void TableStateHistory::answerQuery(Query *query) key.first = entry->_host_name; key.second = entry->_svc_desc != 0 ? entry->_svc_desc : ""; + if (object_blacklist.find(key) != object_blacklist.end()) + { + // Host/Service is not needed for this query and has already + // been filtered out. + continue; + } + + // Find state object for this host/service HostServiceState *state; state_info_t::iterator it_hst = state_info.find(key); - if (it_hst == state_info.end()) { + if (it_hst == state_info.end()) + { + // No state found. Now check if this host/services is filtered out + if (objectFilteredOut(entry->_host_name, entry->_svc_desc)) { + object_blacklist.insert(key); + continue; + } + state = new HostServiceState(); state_info.insert(std::make_pair(key, state)); @@ -448,6 +524,11 @@ void TableStateHistory::answerQuery(Query *query) g_store->logCache()->unlockLogCache(); } +bool TableStateHistory::objectFilteredOut(const char *host_name, const char *service_description) +{ + return true; +} + void TableStateHistory::updateHostServiceState(Query *query, const LogEntry *entry, HostServiceState *hs_state, const bool only_update){ // Revive host / service if it was unmonitored if (entry->_type != TIMEPERIOD_TRANSITION && hs_state->_has_vanished) diff --git a/livestatus/src/TableStateHistory.h b/livestatus/src/TableStateHistory.h index e7e5bc3..5c0b82e 100644 --- a/livestatus/src/TableStateHistory.h +++ b/livestatus/src/TableStateHistory.h @@ -35,62 +35,7 @@ #include "LogCache.h" #include "Query.h" - -typedef pair<string, string> HostServiceKey; - -struct HostServiceState { - bool _is_host; - time_t _time; - int _lineno; - time_t _from; - time_t _until; - - time_t _duration; - double _duration_part; - - // Do not change order within this block! - // These durations will be bzero'd - time_t _duration_state_UNMONITORED; - double _duration_part_UNMONITORED; - time_t _duration_state_OK; - double _duration_part_OK; - time_t _duration_state_WARNING; - double _duration_part_WARNING; - time_t _duration_state_CRITICAL; - double _duration_part_CRITICAL; - time_t _duration_state_UNKNOWN; - double _duration_part_UNKNOWN; - - // State information - int _host_down; // used if service - int _state; // -1/0/1/2/3 - int _in_notification_period; - int _in_downtime; - int _in_host_downtime; - int _is_flapping; - - - // Absent state handling - bool _may_no_longer_exist; - bool _has_vanished; - time_t _last_known_time; - - - const char *_debug_info; - // Pointer to dynamically allocated strings (strdup) that live here. - // These pointers are 0, if there is no output (e.g. downtime) - char *_log_output; - char *_notification_period; // may be "": -> no period known, we assume "always" - host *_host; - service *_service; - const char *_host_name; // Fallback if host no longer exists - const char *_service_description; // Fallback if service no longer exists - - HostServiceState() { bzero(this, sizeof(HostServiceState)); } - ~HostServiceState(); - void debug_me(const char *loginfo, ...); -}; - +class HostServiceState; class TableStateHistory : public Table { @@ -123,6 +68,7 @@ private: LogEntry* getPreviousLogentry(); LogEntry* getNextLogentry(); void process(Query *query, HostServiceState *hs_state); + bool objectFilteredOut(const char *host_name, const char *service_description); }; diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py index 2500d52..e497fca 100644 --- a/web/plugins/views/availability.py +++ b/web/plugins/views/availability.py @@ -707,6 +707,10 @@ def history_url_of(site, host, service, from_time, until_time): return "view.py?" + htmllib.urlencode_vars(history_url_vars) def render_availability_table(availability, from_time, until_time, range_title, what, avoptions, render_number): + if not availability: + html.message(_("No matching hosts/services.")) + return # No objects + # Some columns might be unneeded due to state treatment options sg = avoptions["state_grouping"] state_groups = [ sg["warn"], sg["unknown"], sg["host_down"] ]
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: Remove test in statehist
by Mathias Kettner
Module: check_mk Branch: master Commit: 54bdba851118e2591ccdfe8770e14a0a5edbaed0 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=54bdba851118e2…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Thu Jul 4 16:30:43 2013 +0200 Remove test in statehist --- livestatus/src/TableStateHistory.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc index 0c6d32d..c56a942 100644 --- a/livestatus/src/TableStateHistory.cc +++ b/livestatus/src/TableStateHistory.cc @@ -526,7 +526,7 @@ void TableStateHistory::answerQuery(Query *query) bool TableStateHistory::objectFilteredOut(const char *host_name, const char *service_description) { - return true; + return false; } void TableStateHistory::updateHostServiceState(Query *query, const LogEntry *entry, HostServiceState *hs_state, const bool only_update){
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: Minor styling of table/search/triangle
by Mathias Kettner
Module: check_mk Branch: master Commit: 126eabb7b3afea4dc263639f6093db51e56ee05b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=126eabb7b3afea…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Thu Jul 4 15:15:40 2013 +0200 Minor styling of table/search/triangle --- web/htdocs/pages.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/htdocs/pages.css b/web/htdocs/pages.css index 0148108..3d4205f 100644 --- a/web/htdocs/pages.css +++ b/web/htdocs/pages.css @@ -394,9 +394,11 @@ table.data tr a.toggle_actions { } table.data tr th a.toggle_actions img { vertical-align: top; - width: 16px; - height: 16px; + width: 12px; + height: 13px; padding: 0; + position: relative; + top: 2px; } /* Group header used in table, box and tiled layout */
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: Merge branch 'master' of ssh://mathias-kettner.de/ check_mk
by Mathias Kettner
Module: check_mk Branch: master Commit: 47e9ad03f24a6aca5afc1c324e298eef0b7082fc URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=47e9ad03f24a6a…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Thu Jul 4 14:37:31 2013 +0200 Merge branch 'master' of ssh://mathias-kettner.de/check_mk ---
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: ps/ps.perf: allow to set levels on CPU util, optional averaging of CPU
by Mathias Kettner
Module: check_mk Branch: master Commit: d63df08a17b382b45447545a02a1eba5286d086b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d63df08a17b382…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Thu Jul 4 14:37:28 2013 +0200 ps/ps.perf: allow to set levels on CPU util, optional averaging of CPU --- ChangeLog | 1 + checks/ps | 89 ++++++++++++++++----- modules/check_mk_base.py | 8 +- pnp-templates/check_mk-ps.perf.php | 91 ++++++++++++++-------- web/plugins/wato/check_parameters.py | 142 ++++++++++++++++++++++------------ 5 files changed, 229 insertions(+), 102 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=d63df08a17…
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: nowiki sectionheader now shows title
by Andreas Boesl
Module: check_mk Branch: master Commit: 910c859ccb97b0ae5f92179b7e719491b1070ac9 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=910c859ccb97b0…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Thu Jul 4 14:34:08 2013 +0200 nowiki sectionheader now shows title --- modules/check_mk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/check_mk.py b/modules/check_mk.py index fafb013..1367ce5 100755 --- a/modules/check_mk.py +++ b/modules/check_mk.py @@ -3324,8 +3324,8 @@ def show_check_manual(checkname): # preserve the inner { and } in double braces and then replace the braces left return line.replace('{{', '{{').replace('}}', '}}').replace("{", "<b>").replace("}", "</b>") - def print_sectionheader(line, ignored): - print "H1:" + line + def print_sectionheader(line, title): + print "H1:" + title def print_subheader(line): print "H2:" + line
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: add missing author to cisco_cpu
by Andreas Boesl
Module: check_mk Branch: master Commit: 9d35ad29e323f7a6cfc5782d9891168a386cb336 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d35ad29e323f7…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Thu Jul 4 11:57:59 2013 +0200 add missing author to cisco_cpu --- checkman/cisco_cpu | 1 + 1 file changed, 1 insertion(+) diff --git a/checkman/cisco_cpu b/checkman/cisco_cpu index 0353a8d..9ea11d8 100644 --- a/checkman/cisco_cpu +++ b/checkman/cisco_cpu @@ -1,6 +1,7 @@ title: CPU utilization of the last 5 minutes on CISCO devices agents: snmp catalog: hw/network/cisco +author: Mathias Kettner <mk(a)mathias-kettner.de> license: GPL distribution: check_mk description:
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: New rules for jolokia check (JVM):
by Andreas Boesl
Module: check_mk Branch: master Commit: a5edc918fa124900d680e9b949b132ec3d3b03d7 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a5edc918fa1249…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Thu Jul 4 11:39:33 2013 +0200 New rules for jolokia check (JVM): uptime, threads, sessions, requests, queue --- ChangeLog | 2 + checks/jolokia_metrics | 22 +++-- web/plugins/wato/check_parameters.py | 168 ++++++++++++++++++++++++++++++++++ 3 files changed, 183 insertions(+), 9 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=a5edc918fa…
11 years, 3 months
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
23
24
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
Results per page:
10
25
50
100
200