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 2011
----- 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
3 participants
336 discussions
Start a n
N
ew thread
Check_MK Git: check_mk: Merge branch 'master' of ssh://mathias-kettner.de/ check_mk
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 7d4ce1dca79007440abc6b87bde4ae8544734ce7 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d4ce1dca79007…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Mon Dec 12 16:35:04 2011 +0100 Merge branch 'master' of ssh://mathias-kettner.de/check_mk ---
12 years, 6 months
1
0
0
0
Check_MK Git: check_mk: Windows agent: new section <<<fileinfo>>>
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: d6b2fe7e669915e38a930339b766ddbb77b53ec0 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d6b2fe7e669915…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Mon Dec 12 15:44:29 2011 +0100 Windows agent: new section <<<fileinfo>>> --- .bugs/491 | 10 ++++ ChangeLog | 2 + agents/windows/check_mk.ini | 5 ++- agents/windows/check_mk_agent.cc | 97 ++++++++++++++++++++++++++++++++++++- agents/windows/check_mk_agent.exe | Bin 101888 -> 102912 bytes 5 files changed, 111 insertions(+), 3 deletions(-) diff --git a/.bugs/491 b/.bugs/491 new file mode 100644 index 0000000..151f82a --- /dev/null +++ b/.bugs/491 @@ -0,0 +1,10 @@ +Title: Document Windows agent <<<fileinfo>>> +Component: docu +Benefit: 1 +State: open +Cost: 1 +Date: 2011-12-12 15:44:36 +Targetversion: 1.2.0 +Class: todo + +Document the new feature of the Windows agent diff --git a/ChangeLog b/ChangeLog index 1c5c316..be56aa2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,8 @@ a system reboot is (hopefully) not neccessary anymore * Windows agent: section <<<df>>> now also outputs junctions (windows mount points). No external plugin is needed. + * Windows agent: new section <<<fileinfo>>> for monitoring file sizes + (and later possible ages) * logwatch: allow to classify messages based on their count (see man page of logwatch for details) diff --git a/agents/windows/check_mk.ini b/agents/windows/check_mk.ini index c156a0f..0f94b3d 100644 --- a/agents/windows/check_mk.ini +++ b/agents/windows/check_mk.ini @@ -32,7 +32,6 @@ # send messages of type warn or crit # logfile * = off - [mrpe] # Run classical Nagios plugins. The word before the command # line is the service description for Nagios. Use backslashes @@ -40,3 +39,7 @@ # check = Dummy mrpe\check_crit # check = IP_Configuration mrpe\check_ipconfig 1.2.3.4 # check = Whatever c:\myplugins\check_whatever -w 10 -c 20 + +[fileinfo] + # path = C:\Programs\Foo\*.log + # path = M:\Bar Test\*.* diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc index e911a62..be2c8dc 100755 --- a/agents/windows/check_mk_agent.cc +++ b/agents/windows/check_mk_agent.cc @@ -90,6 +90,7 @@ #define SECTION_PLUGINS 0x00000200 #define SECTION_LOCAL 0x00000400 #define SECTION_MRPE 0x00000800 +#define SECTION_FILEINFO 0x00001000 // Limits for static global arrays #define MAX_EVENTLOGS 128 @@ -97,6 +98,7 @@ #define MAX_WINPERF_COUNTERS 64 #define MAX_MRPE_COMMANDS 64 #define MAX_EXECUTE_SUFFIXES 64 +#define MAX_FILEINFO_ENTRIES 128 // Default buffer size for reading performance counters #define DEFAULT_BUFFER_SIZE 40960L @@ -132,6 +134,7 @@ void listen_tcp_loop(); void output(SOCKET &out, const char *format, ...); char *ipv4_to_text(uint32_t ip); void output_data(SOCKET &out); +double file_time(const FILETIME *filetime); // .----------------------------------------------------------------------. // | ____ _ _ _ | @@ -196,6 +199,10 @@ unsigned int g_num_mrpe_entries = 0; unsigned g_num_execute_suffixes = 0; char *g_execute_suffixes[MAX_EXECUTE_SUFFIXES]; +// Array of file patterns for fileinfo +unsigned g_num_fileinfo_paths = 0; +char *g_fileinfo_path[MAX_FILEINFO_ENTRIES]; + // .----------------------------------------------------------------------. // | _ _ _ | // | | | | | ___| |_ __ ___ _ __ ___ | @@ -278,8 +285,13 @@ double current_time() FILETIME filetime; GetSystemTime(&systime); SystemTimeToFileTime(&systime, &filetime); - unsigned long long ft = (unsigned long long)(filetime.dwLowDateTime) - + (((unsigned long long)filetime.dwHighDateTime) << 32); + return file_time(&filetime); +} + +double file_time(const FILETIME *filetime) +{ + unsigned long long ft = (unsigned long long)(filetime->dwLowDateTime) + + (((unsigned long long)filetime->dwHighDateTime) << 32); return ft / 10000000.0; } @@ -1282,6 +1294,76 @@ void section_mem(SOCKET &out) output(out, "PageFree: %11d kB\n", statex.ullAvailPageFile / 1024); } +// .-----------------------------------------------------------------------. +// | ______ __ _ _ _ __ ______ | +// | / / / // _(_) | ___(_)_ __ / _| ___\ \ \ \ | +// | / / / /| |_| | |/ _ \ | '_ \| |_ / _ \\ \ \ \ | +// | \ \ \ \| _| | | __/ | | | | _| (_) / / / / | +// | \_\_\_\_| |_|_|\___|_|_| |_|_| \___/_/_/_/ | +// | | +// '-----------------------------------------------------------------------' + +void output_fileinfos(SOCKET &out, const char *path); +void output_fileinfo(SOCKET &out, const char *basename, WIN32_FIND_DATA *data); + +void section_fileinfo(SOCKET &out) +{ + output(out, "<<<fileinfo(sep:124)>>>\n"); + output(out, "%.0f\n", current_time()); + for (unsigned i=0; i<g_num_fileinfo_paths; i++) { + output_fileinfos(out, g_fileinfo_path[i]); + } +} + +void output_fileinfos(SOCKET &out, const char *path) +{ + WIN32_FIND_DATA data; + HANDLE h = FindFirstFileEx(path, FindExInfoStandard, &data, FindExSearchNameMatch, NULL, 0); + if (h != INVALID_HANDLE_VALUE) { + // compute basename of path: search backwards for '\' + const char *basename = ""; + char *end = strrchr(path, '\\'); + if (end) { + *end = 0; + basename = path; + } + output_fileinfo(out, basename, &data); + while (FindNextFile(h, &data)) + output_fileinfo(out, basename, &data); + FindClose(h); + } + else { + output(out, "%s|missing\n", path); + } +} + + +void output_fileinfo(SOCKET &out, const char *basename, WIN32_FIND_DATA *data) +{ + unsigned long long size = (unsigned long long)data->nFileSizeLow + + (((unsigned long long)data->nFileSizeHigh) << 32); + + if (0 == (data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { + output(out, "%s\\%s|%llu|%.0f\n", basename, + data->cFileName, size, file_time(&data->ftLastWriteTime)); + } +} + + +bool handle_fileinfo_config_variable(char *var, char *value) +{ + if (!strcmp(var, "path")) { + if (g_num_fileinfo_paths >= MAX_FILEINFO_ENTRIES) { + fprintf(stderr, "Sorry, only %d entries in [fileinfo] are allowed.\r\n", + MAX_FILEINFO_ENTRIES); + return false; + } + g_fileinfo_path[g_num_fileinfo_paths++] = strdup(value); + return true; + } + return false; +} + // .----------------------------------------------------------------------. // | ____ _ | @@ -1863,6 +1945,8 @@ bool handle_global_config_variable(char *var, char *value) enabled_sections |= SECTION_LOCAL; else if (!strcmp(word, "mrpe")) enabled_sections |= SECTION_MRPE; + else if (!strcmp(word, "fileinfo")) + enabled_sections |= SECTION_FILEINFO; else { fprintf(stderr, "Invalid section '%s'.\r\n", word); return false; @@ -2061,6 +2145,8 @@ void read_config_file() variable_handler = handle_logwatch_config_variable; else if (!strcmp(section, "mrpe")) variable_handler = handle_mrpe_config_variable; + else if (!strcmp(section, "fileinfo")) + variable_handler = handle_fileinfo_config_variable; else { fprintf(stderr, "Invalid section [%s] in %s in line %d.\r\n", section, g_config_file, lineno); @@ -2338,6 +2424,8 @@ void output_data(SOCKET &out) section_ps(out); if (enabled_sections & SECTION_MEM) section_mem(out); + if (enabled_sections & SECTION_FILEINFO) + section_fileinfo(out); if (enabled_sections & SECTION_SERVICES) section_services(out); if (enabled_sections & SECTION_WINPERF) @@ -2359,9 +2447,14 @@ void cleanup() { if (eventlog_buffer_size > 0) delete [] eventlog_buffer; + unregister_all_eventlogs(); // frees a few bytes + while (g_num_execute_suffixes) free(g_execute_suffixes[--g_num_execute_suffixes]); + + while (g_num_fileinfo_paths) + free(g_fileinfo_path[--g_num_fileinfo_paths]); } void show_version() diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe index e2e4994..ce77e13 100755 Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe differ
12 years, 6 months
1
0
0
0
Check_MK Git: check_mk: First version of always-OK fileinfo check
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 2e232526027b5d6fb018db5c5a408697998eaec0 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2e232526027b5d…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Mon Dec 12 16:34:15 2011 +0100 First version of always-OK fileinfo check --- agents/windows/check_mk.ini | 2 + agents/windows/check_mk_agent.cc | 7 +++- agents/windows/check_mk_agent.exe | Bin 102912 -> 102912 bytes agents/windows/crash.exe | Bin 20024 -> 20024 bytes checks/fileinfo | 56 +++++++++++++++++++++++++++++++++++++ 5 files changed, 63 insertions(+), 2 deletions(-) diff --git a/agents/windows/check_mk.ini b/agents/windows/check_mk.ini index 0f94b3d..5b82eb1 100644 --- a/agents/windows/check_mk.ini +++ b/agents/windows/check_mk.ini @@ -14,6 +14,7 @@ # Just output certain sections (e.g. for upper hosts) # sections = check_mk plugins df + sections = fileinfo [winperf] @@ -43,3 +44,4 @@ [fileinfo] # path = C:\Programs\Foo\*.log # path = M:\Bar Test\*.* + path = M:\*.* diff --git a/agents/windows/check_mk_agent.cc b/agents/windows/check_mk_agent.cc index be2c8dc..2cc1083 100755 --- a/agents/windows/check_mk_agent.cc +++ b/agents/windows/check_mk_agent.cc @@ -1308,7 +1308,7 @@ void output_fileinfo(SOCKET &out, const char *basename, WIN32_FIND_DATA *data); void section_fileinfo(SOCKET &out) { - output(out, "<<<fileinfo(sep:124)>>>\n"); + output(out, "<<<fileinfo:sep(124)>>>\n"); output(out, "%.0f\n", current_time()); for (unsigned i=0; i<g_num_fileinfo_paths; i++) { output_fileinfos(out, g_fileinfo_path[i]); @@ -1330,10 +1330,13 @@ void output_fileinfos(SOCKET &out, const char *path) output_fileinfo(out, basename, &data); while (FindNextFile(h, &data)) output_fileinfo(out, basename, &data); + if (end) + *end = '\\'; // repair string FindClose(h); } else { - output(out, "%s|missing\n", path); + DWORD e = GetLastError(); + output(out, "%s|missing|%d\n", path, e); } } diff --git a/agents/windows/check_mk_agent.exe b/agents/windows/check_mk_agent.exe index ce77e13..b912cbd 100755 Binary files a/agents/windows/check_mk_agent.exe and b/agents/windows/check_mk_agent.exe differ diff --git a/agents/windows/crash.exe b/agents/windows/crash.exe index a33e770..b69d1ae 100755 Binary files a/agents/windows/crash.exe and b/agents/windows/crash.exe differ diff --git a/checks/fileinfo b/checks/fileinfo new file mode 100644 index 0000000..93cd915 --- /dev/null +++ b/checks/fileinfo @@ -0,0 +1,56 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2012 mk(a)mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# This file is part of Check_MK. +# The official homepage is at
http://mathias-kettner.de/check_mk
. +# +# check_mk is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation in version 2. check_mk is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more de- +# ails. You should have received a copy of the GNU General Public +# License along with GNU Make; see the file COPYING. If not, write +# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA. + +# Example output: +# <<<fileinfo(sep:124)>>> +# 12968175080 +# M:\check_mk.ini|missing +# M:\check_mk.ini|1390|12968174867 +# M:\check_mk_agent.cc|86277|12968174554 +# M:\Makefile|1820|12964010975 +# M:\check_mk_agent.exe|102912|12968174364 +# M:\crash.cc|1672|12964010975 +# M:\crash.exe|20024|12968154426 + +def inventory_fileinfo(info): + return [(line[0], None) for line in info[1:] if len(line) >= 3] + +def check_fileinfo(item, params, info): + reftime = int(info[0][0]) + for line in info[1:]: + if item == line[0]: + if line[1] == "missing": + return (3, "File is missing") + state = 0 + size = int(line[1]) + age = reftime - int(line[2]) + infotext = " - size is %s" % get_bytes_human_readable(size) + perfdata = [ ("size", size), ("age", age) ] + return (state, nagios_state_names[state] + infotext, perfdata) + return (3, "UNKNOWN - File missing in agent output") + + +check_info["fileinfo"] = (check_fileinfo, "File %s", 1, inventory_fileinfo)
12 years, 6 months
1
0
0
0
Check_MK Git: check_mk: MobileUI: Changed id to class attribute to prevent multipe id Attributes at one page
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 957115fa57bf7a5c20eedc754037aa82b32bc28f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=957115fa57bf7a…
Author: Bastian Kuhn <bk(a)mathias-kettner.de> Date: Mon Dec 12 13:11:12 2011 +0100 MobileUI: Changed id to class attribute to prevent multipe id Attributes at one page --- web/htdocs/mobile.py | 21 ++++++++------------- 1 files changed, 8 insertions(+), 13 deletions(-) diff --git a/web/htdocs/mobile.py b/web/htdocs/mobile.py index 172797c..e6d6715 100755 --- a/web/htdocs/mobile.py +++ b/web/htdocs/mobile.py @@ -71,21 +71,16 @@ def jqm_page_navfooter(items, current, page_id): '<div data-role="footer" data-id="%s" data-position="fixed">\n' '<div data-role="navbar">\n' '<ul>\n' % page_id) - for href, title, icon, obj_id in items: - #Is there an html id attribute - if obj_id != False: - obj_id = ' id="%s"' % obj_id - else: - obj_id = '' - + for href, title, icon, custom_css in items: + if custom_css == False: + custom_css = "" if current == href: - active = ' class="ui-state-persist ui-btn-active"' + custom_css += ' ui-state-persist ui-btn-active' else: - active = '' - html.write('<li><a data-transition="slide" %s ' + html.write('<li><a class="%s" data-transition="slide"' 'data-icon="%s" data-iconpos="bottom" ' - 'href="%s"%s>%s</a></li>\n' % - (obj_id, icon, href, active, title)) + 'href="%s">%s</a></li>\n' % + (custom_css, icon, href, title)) html.write( '</ul>\n' '</div>\n' @@ -267,7 +262,7 @@ def show_filter_form(show_filters): # itself and first switch to that page... html.javascript(""" $(document).ready(function() { - $('#results_button').live('click', function(e) { + $('.results_button').live('click', function(e) { e.preventDefault(); var view_div = $("#view_results"); view_div.empty();
12 years, 6 months
1
0
0
0
Check_MK Git: check_mk: MobileUI: Finished all basic functions
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 4a747b1ef3d48ae6ae7bb3420dc0d243b24d9a3b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4a747b1ef3d48a…
Author: Bastian Kuhn <bk(a)mathias-kettner.de> Date: Mon Dec 12 15:18:45 2011 +0100 MobileUI: Finished all basic functions --- web/htdocs/mobile.py | 136 ++++++++++++++++++++++++++------------------------ 1 files changed, 71 insertions(+), 65 deletions(-) diff --git a/web/htdocs/mobile.py b/web/htdocs/mobile.py index e6d6715..a2cb7ae 100755 --- a/web/htdocs/mobile.py +++ b/web/htdocs/mobile.py @@ -71,7 +71,9 @@ def jqm_page_navfooter(items, current, page_id): '<div data-role="footer" data-id="%s" data-position="fixed">\n' '<div data-role="navbar">\n' '<ul>\n' % page_id) + for href, title, icon, custom_css in items: + href = html.makeuri([("page", href),("search", "Search")]) if custom_css == False: custom_css = "" if current == href: @@ -146,31 +148,37 @@ def page_index(): for view_name, view in html.available_views.items(): if view.get("mobile") and not view.get("hidden"): url = "mobile_view.py?view_name=%s" % view_name - count = views.show_view(view, only_count = True) if view.get("mustsearch"): - url += "#filter" - items.append((url, '%s <span class="ui-li-count">%d</span>' % (view["title"], count))) + count = "" + else: + count = views.show_view(view, only_count = True) + count = '<span class="ui-li-count">%d</span>' % count + items.append((url, '%s %s' % (view["title"], count))) jqm_page_index(_("Check_MK Mobile"), items) jqm_page_footer() mobile_html_foot() + def page_view(): views.load_views() view_name = html.var("view_name") if not view_name: return page_index() - + view = html.available_views.get(view_name) title = views.view_title(view) mobile_html_head(title) + try: - views.show_view(view, show_heading = False, show_buttons = False, - show_footer = False, render_function = render_view) - pass + views.show_view(view, show_heading = False, show_buttons = False, + show_footer = False, render_function = render_view) + pass except Exception, e: - if config.debug: - raise - html.write("ERROR showing view: %s" % e) + if config.debug: + raise + html.write("ERROR showing view: %s" % e) + + mobile_html_foot() def render_view(view, rows, datasource, group_painters, painters, @@ -179,12 +187,19 @@ def render_view(view, rows, datasource, group_painters, painters, browser_reload): home=("mobile.py", "Home", "home") + + page = html.var("page") + if not page: + if view.get("mustsearch"): + page = "filter" + else: + page = "data" title = views.view_title(view) - navbar = [ ( "#data", _("Results"), "grid", 'results_button'), - ( "#filter", _("Filter"), "search", False )] + navbar = [ ( "data", _("Results"), "grid", 'results_button'), + ( "filter", _("Filter"), "search", False )] if config.may("act"): - navbar.append(( "#commands", _("Commands"), "gear", False )) + navbar.append(( "commands", _("Commands"), "gear", False )) # Should we show a page with context links? context_links = [ @@ -192,49 +207,52 @@ def render_view(view, rows, datasource, group_painters, painters, if e[0].get("mobile") ] if context_links: - navbar.append(( "#context", _("Context"), "arrow-r", False)) + navbar.append(( "context", _("Context"), "arrow-r", False)) page_id = "view_" + view["name"] - # Page: data rows of view - jqm_page_header(title, left_button=home, right_button=("javascript:document.location.reload();", _("Reload"), "refresh"), id="data") - html.write('<div id="view_results">') - if len(rows) == 0: - html.write(_("No hosts/services found.")) - else: - try: - # TODO: special limit for mobile UI - html.check_limit(rows, views.get_limit()) - layout["render"](rows, view, group_painters, painters, num_columns, - show_checkboxes and not html.do_actions()) - except Exception, e: - html.write(_("Error showing view: %s" % e)) - html.write("</div>") - jqm_page_navfooter(navbar, '#data', page_id) - - # Page: Commands - if len(rows) > 0 and config.may("act"): - jqm_page_header(_("Commands"), left_button=home, id="commands") - show_commands = True - if html.has_var("_do_actions"): - try: - show_commands = do_commands(view, datasource["infos"][0], rows) - except MKUserError, e: - html.show_error(e.message) - show_commands = True - if show_commands: - show_command_form(view, datasource, rows) - jqm_page_navfooter(navbar, '#commands', page_id) - - # Page: Filters - jqm_page_header(_("Filter / Search"), left_button=home, id="filter") - show_filter_form(show_filters) - jqm_page_navfooter(navbar, '#filter', page_id) + if page == "filter": + jqm_page_header(_("Filter / Search"), left_button=home, id="filter") + show_filter_form(show_filters) + jqm_page_navfooter(navbar, 'filter', page_id) + + elif page == "commands": + # Page: Commands + if config.may("act"): + jqm_page_header(_("Commands"), left_button=home, id="commands") + show_commands = True + if html.has_var("_do_actions"): + try: + show_commands = do_commands(view, datasource["infos"][0], rows) + except MKUserError, e: + html.show_error(e.message) + show_commands = True + if show_commands: + show_command_form(view, datasource, rows) + jqm_page_navfooter(navbar, 'commands', page_id) + + elif page == "data": + # Page: data rows of view + jqm_page_header(title, left_button=home, right_button=("javascript:document.location.reload();", _("Reload"), "refresh"), id="data") + html.write('<div id="view_results">') + if len(rows) == 0: + html.write(_("No hosts/services found.")) + else: + try: + # TODO: special limit for mobile UI + html.check_limit(rows, views.get_limit()) + layout["render"](rows, view, group_painters, painters, num_columns, + show_checkboxes and not html.do_actions()) + except Exception, e: + html.write(_("Error showing view: %s" % e)) + html.write("</div>") + jqm_page_navfooter(navbar, 'data', page_id) + # Page: Context buttons if context_links: jqm_page_header(_("Context"), left_button=home, id="context") show_context_links(context_links) - jqm_page_navfooter(navbar, '#context', page_id) + jqm_page_navfooter(navbar, 'context', page_id) def show_filter_form(show_filters): @@ -254,25 +272,13 @@ def show_filter_form(show_filters): html.write("</ul>\n") html.hidden_fields() html.write('<input type="hidden" name="search" value="Search">') + html.write('<input type="hidden" name="page" value="data">') html.end_form() - # Make the tab 'b' not simply switch to the results page - # but submit the form and fetch new data. This is done by overriding - # that buttons click function to submit the form. Note: We need to - # remove the ancor in href. Otherwise jQuery will do some magic - # itself and first switch to that page... html.javascript(""" - $(document).ready(function() { - $('.results_button').live('click', function(e) { + $('.results_button').live('click',function(e) { e.preventDefault(); - var view_div = $("#view_results"); - view_div.empty(); - $.get('view.py',$('#form_filter').serialize()+"&mobile=1&display_options=htbfcodezr",function(antwort){ - view_div.html(antwort); - $.mobile.changePage( "#data" ); - $('#data').trigger('create'); - }); + $('#form_filter').submit(); }); - }); """) def show_command_form(view, datasource, rows): @@ -288,7 +294,7 @@ def show_command_form(view, datasource, rows): for command in views.multisite_commands: if what in command["tables"] and config.may(command["permission"]): html.write('<li data-role="fieldcontain">\n') - html.write('<fieldset data-role="controlgroup">\n') + html.write('<fieldset data-role="controlgroup" data-type="horizontal">\n') html.write('<div role="heading" class="ui-controlgroup-label">%s</div>' % command["title"]) html.write('<div class="ui-controlgroup-controls">') command["render"]()
12 years, 6 months
1
0
0
0
Check_MK Git: check_mk: MobileUI: Making filters work
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 97bdf9b1e3f19e3e53aaa6a9ff0cfabab745be22 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=97bdf9b1e3f19e…
Author: Bastian Kuhn <bk(a)mathias-kettner.de> Date: Mon Dec 12 12:30:07 2011 +0100 MobileUI: Making filters work --- web/htdocs/js/mobile.js | 5 +++-- web/htdocs/mobile.py | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/web/htdocs/js/mobile.js b/web/htdocs/js/mobile.js index 6f9442e..17107cd 100644 --- a/web/htdocs/js/mobile.js +++ b/web/htdocs/js/mobile.js @@ -24,11 +24,12 @@ /* Disable data-ajax per default, as it makes problems in most of our cases */ -$( function () { + +$(document).ready(function() { $("a").attr("data-ajax", "false"); $("form").attr("data-ajax", "false"); $("div.error").addClass("ui-shadow"); $("div.success").addClass("ui-shadow"); $("div.really").addClass("ui-shadow"); $("div.warning").addClass("ui-shadow"); -}) +}); \ No newline at end of file diff --git a/web/htdocs/mobile.py b/web/htdocs/mobile.py index de0e758..172797c 100755 --- a/web/htdocs/mobile.py +++ b/web/htdocs/mobile.py @@ -202,6 +202,7 @@ def render_view(view, rows, datasource, group_painters, painters, # Page: data rows of view jqm_page_header(title, left_button=home, right_button=("javascript:document.location.reload();", _("Reload"), "refresh"), id="data") + html.write('<div id="view_results">') if len(rows) == 0: html.write(_("No hosts/services found.")) else: @@ -212,6 +213,7 @@ def render_view(view, rows, datasource, group_painters, painters, show_checkboxes and not html.do_actions()) except Exception, e: html.write(_("Error showing view: %s" % e)) + html.write("</div>") jqm_page_navfooter(navbar, '#data', page_id) # Page: Commands @@ -264,10 +266,18 @@ def show_filter_form(show_filters): # remove the ancor in href. Otherwise jQuery will do some magic # itself and first switch to that page... html.javascript(""" - $('#results_button').live('click',function(e){ + $(document).ready(function() { + $('#results_button').live('click', function(e) { e.preventDefault(); - $('form[name="filter"]').submit(); + var view_div = $("#view_results"); + view_div.empty(); + $.get('view.py',$('#form_filter').serialize()+"&mobile=1&display_options=htbfcodezr",function(antwort){ + view_div.html(antwort); + $.mobile.changePage( "#data" ); + $('#data').trigger('create'); + }); }); + }); """) def show_command_form(view, datasource, rows):
12 years, 6 months
1
0
0
0
Check_MK Git: check_mk: Multisite: Added name based id attribute to form tag
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 5618a48d59a24479b17009fa9f7930c51d7d6853 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5618a48d59a244…
Author: Bastian Kuhn <bk(a)mathias-kettner.de> Date: Mon Dec 12 13:10:13 2011 +0100 Multisite: Added name based id attribute to form tag --- web/htdocs/htmllib.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index baafac5..109f48f 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -236,8 +236,8 @@ class html: onsubmit = ' onsubmit="%s"' % onsubmit else: onsubmit = '' - self.write('<form name=%s class=%s action="%s" method="%s"%s%s>\n' % - (name, name, action, method, enctype, onsubmit)) + self.write('<form id="form_%s" name="%s" class="%s" action="%s" method="%s"%s%s>\n' % + (name, name, name, action, method, enctype, onsubmit)) self.hidden_field("filled_in", name) if add_transid: self.hidden_field("_transid", str(self.current_transid()))
12 years, 6 months
1
0
0
0
Check_MK Git: check_mk: Merge branch 'master' of ssh://mathias-kettner.de/ check_mk
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: af5070d17aa7b00873484f63e5564612bc294894 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=af5070d17aa7b0…
Author: Bastian Kuhn <bk(a)mathias-kettner.de> Date: Mon Dec 12 15:18:58 2011 +0100 Merge branch 'master' of ssh://mathias-kettner.de/check_mk ---
12 years, 6 months
1
0
0
0
Check_MK Git: check_mk: orable_tablespaces: fix output marker for crit/warn
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 27f0b7afd54a9ac1ca622c874d9d60d699d3be33 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27f0b7afd54a9a…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Mon Dec 12 10:05:53 2011 +0100 orable_tablespaces: fix output marker for crit/warn --- checks/oracle_tablespaces | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/checks/oracle_tablespaces b/checks/oracle_tablespaces index 8a01132..f13a002 100644 --- a/checks/oracle_tablespaces +++ b/checks/oracle_tablespaces @@ -139,16 +139,16 @@ def check_oracle_tablespaces(item, params, info): # Check increment size, should not be set to default (1) if oracle_tablespaces_check_default_increment: if uses_default_increment: - infotext += ", DEFAULT INCREMENT!" + infotext += ", DEFAULT INCREMENT(!)" status = 1 # Check autoextend status if parameter not set to None if autoext != None: if autoext and num_extensible == 0: - infotext += ", AUTOEXTEND!!" + infotext += ", AUTOEXTEND(!!)" status = 2 elif not autoext and num_extensible > 0: - infotext += ", NO AUTOTEXTEND!!" + infotext += ", NO AUTOTEXTEND(!!)" status = 2 elif num_extensible > 0: infotext += ", autoextend"
12 years, 6 months
1
0
0
0
Check_MK Git: check_mk: Updated bug entries #0489, #0490
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 3cd68c1957ba861d2ffc8588b8cc5e7a6a0c5014 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3cd68c1957ba86…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Dec 9 15:54:57 2011 +0100 Updated bug entries #0489, #0490 --- .bugs/489 | 15 +++++++++++++++ .bugs/490 | 11 +++++++++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/.bugs/489 b/.bugs/489 new file mode 100644 index 0000000..3a51d2e --- /dev/null +++ b/.bugs/489 @@ -0,0 +1,15 @@ +Title: Doku example for dual tcp/snmp monitoring +Component: docu +Benefit: 1 +State: open +Cost: 1 +Date: 2011-12-09 11:40:51 +Targetversion: future +Class: todo + +The following example rule could be proposed for solving +the duplicate check problem: + +ignored_checks += [ + ( [ "hr_fs", "hr_mem", "hr_cpu" ], [ "snmp", "tcp" ], ALL_HOSTS ) +] diff --git a/.bugs/490 b/.bugs/490 new file mode 100644 index 0000000..f586de8 --- /dev/null +++ b/.bugs/490 @@ -0,0 +1,11 @@ +Title: cmk -I on cluster should work +Component: core +Benefit: 1 +State: open +Cost: 1 +Date: 2011-12-09 14:27:05 +Targetversion: future +Class: feature + +When doing inventory on a cluster we could simply +replace the cluster name by the node names.
12 years, 6 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
34
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
Results per page:
10
25
50
100
200