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
February 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
186 discussions
Start a n
N
ew thread
Check_MK Git: check_mk: Fixed downtime handling
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: c1ecdcb1b7684c16c53079e1dc0a55a1c393fefc URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c1ecdcb1b7684c…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Feb 4 16:30:49 2011 +0100 Fixed downtime handling --- ChangeLog | 1 + web/htdocs/htmllib.py | 16 ++++++++++++++++ web/htdocs/views.py | 17 +++++------------ web/plugins/views/builtin.py | 35 +++++++++++++++++++---------------- web/plugins/views/painters.py | 14 +++++++++++++- 5 files changed, 54 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5aefdb9..ebd7d87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ send notification and persisten comment * Downtimes: allow to specify fixed/flexible downtime * new display_options d/D for switching on/off the tab "Display" + * Improved builtin views for downtimes WATO: * Fixed problem appearing at restart on older Python version (RH) diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 13f6a1c..14d800f 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -346,6 +346,22 @@ class html: "Please enter the date/time in the format YYYY-MM-DD HH:MM") return int(time.mktime(br)) + def get_time_input(self, varname, what): + t = self.var(varname) + if not t: + raise MKUserError(varname, "Please specify %s" % what) + + try: + h, m = t.split(":") + m = int(m) + h = int(h) + if m < 0 or m > 59 or h < 0: + raise Exception() + except: + raise MKUserError(varname, "Please enter the time in the format HH:MM") + return m * 60 + h * 3600 + + def html_head(self, title): if not self.req.header_sent: self.req.write( diff --git a/web/htdocs/views.py b/web/htdocs/views.py index 79ffab0..e696b8c 100644 --- a/web/htdocs/views.py +++ b/web/htdocs/views.py @@ -1632,9 +1632,9 @@ def show_host_service_actions(what): html.write("</td></tr>") html.write("<tr><td class=content>") html.checkbox("_down_flexible", False) - html.write(" flexible (automatically end downtime as soon as %s is %s again)" % - (what, what == "host" and "up" or "OK")) - html.write("</td></tr>\n") + html.write(" flexible with max. duration ") + html.time_input("_down_duration", 2, 0) + html.write(" (HH:MM)</td></tr>\n") html.write("<tr><td class=content><div class=textinputlegend>Comment:</div>\n") html.text_input("_down_comment") @@ -1786,12 +1786,6 @@ def nagios_host_service_action_command(what, dataset): time.asctime(time.localtime(down_from)), time.asctime(time.localtime(down_to))) - # handle hidden field (added for NagStaMon) - elif html.var("_down_duration") and config.may("action.downtimes"): - duration = int(html.var("_down_duration")) - down_to = down_from + duration - title = "<b>schedule a downtime from now lasting for %d seconds</b> on " % duration - elif html.var("_down_remove") and config.may("action.downtimes"): downtime_ids = [] for id in dataset[prefix + "downtimes"]: @@ -1812,11 +1806,10 @@ def nagios_host_service_action_command(what, dataset): raise MKUserError("_down_comment", "You need to supply a comment for your downtime.") if html.var("_down_flexible"): fixed = 0 + duration = html.get_time_input("_down_duration", "the duration") else: fixed = 1 - duration = down_to - down_from - if fixed == 0 and abs(down_from - time.time()) > 80: - raise MKUserError("_down_from", "When creating flexible downtimes the start time must be now.") + duration = 0 command = (("SCHEDULE_" + cmdtag + "_DOWNTIME;%s;" % spec) \ + ("%d;%d;%d;0;%d;%s;" % (down_from, down_to, fixed, duration, html.req.user)) \ + comment) diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py index 2a60cee..1e7b55f 100644 --- a/web/plugins/views/builtin.py +++ b/web/plugins/views/builtin.py @@ -237,12 +237,16 @@ multisite_builtin_views = { 'name': 'downtimes', 'num_columns': 1, 'owner': '', - 'painters': [('host', None), - ('service_description', None), + 'painters': [('host', 'host'), + ('service_description', 'service'), + ('downtime_author', None), + ('downtime_entry_time', None), ('downtime_start_time', None), ('downtime_end_time', None), - ('downtime_author', None), + ('downtime_fixed', None), + ('downtime_duration', None), ('downtime_comment', None)], + 'public': True, 'show_filters': ['service_scheduled_downtime_depth', 'hostregex', @@ -264,12 +268,12 @@ multisite_builtin_views = { 'num_columns': 1, 'owner': '', 'painters': [('downtime_author', None), - ('downtime_entry_time', None), - ('downtime_comment', None), - ('downtime_start_time', None), - ('downtime_end_time', None), - ('downtime_id', None), - ('downtime_fixed', None)], + ('downtime_entry_time', None), + ('downtime_start_time', None), + ('downtime_end_time', None), + ('downtime_fixed', None), + ('downtime_duration', None), + ('downtime_comment', None)], 'public': True, 'show_filters': [], 'sorters': [], @@ -289,13 +293,12 @@ multisite_builtin_views = { 'num_columns': 1, 'owner': '', 'painters': [('downtime_author', None), - ('downtime_entry_time', None), - ('downtime_comment', None), - ('downtime_start_time', None), - ('downtime_end_time', None), - ('downtime_id', None), - ('downtime_fixed', None), - ('svc_in_downtime', None)], + ('downtime_entry_time', None), + ('downtime_start_time', None), + ('downtime_end_time', None), + ('downtime_fixed', None), + ('downtime_duration', None), + ('downtime_comment', None)], 'public': True, 'show_filters': [], 'sorters': [], diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py index 256110b..c2e826d 100644 --- a/web/plugins/views/painters.py +++ b/web/plugins/views/painters.py @@ -1370,7 +1370,7 @@ multisite_painters["downtime_fixed"] = { "title" : "Downtime is fixed", "short" : "Fixed", "columns" : ["downtime_fixed"], - "paint" : lambda row: (None, row["downtime_fixed"] == "0" and "flexible" or "fixed") + "paint" : lambda row: (None, row["downtime_fixed"] == 0 and "flexible" or "fixed") } multisite_painters["downtime_what"] = { "title" : "Downtime type (host/service)", @@ -1406,6 +1406,18 @@ multisite_painters["downtime_end_time"] = { "options" : [ "ts_format", "ts_date" ], "paint" : lambda row: paint_age(row["downtime_end_time"], True, 3600) } +def paint_downtime_duration(row): + if row["downtime_fixed"] == 1: + return None, "" + else: + return None, "%02d:%02d" % divmod(row["downtime_duration"] / 60, 60) + +multisite_painters["downtime_duration"] = { + "title" : "Downtime duration (if flexible)", + "short" : "Duration", + "columns" : ["downtime_duration", "downtime_fixed"], + "paint" : paint_downtime_duration +} # _ # | | ___ __ _
13 years, 4 months
1
0
0
0
Check_MK Git: check_mk: Added special view for NagStaMon
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 438bd90b9dc348b65425eadda72e3ec1a11f3972 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=438bd90b9dc348…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Feb 4 16:33:45 2011 +0100 Added special view for NagStaMon --- web/plugins/views/builtin.py | 114 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 114 insertions(+), 0 deletions(-) diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py index 1e7b55f..4058ae6 100644 --- a/web/plugins/views/builtin.py +++ b/web/plugins/views/builtin.py @@ -1802,4 +1802,118 @@ multisite_builtin_views = { ('svcdescr', False)], 'title': 'Alert Statistics', 'topic': 'Problems'}, + +# Special views for NagStaMon +'nagstamon_hosts': {'browser_reload': 30, + 'column_headers': 'pergroup', + 'datasource': 'hosts', + 'description': 'The view is intended for NagStaMon as web service.', + 'group_painters': [('host_state', None)], + 'hard_filters': ['summary_host'], + 'hard_filtervars': [('is_host_scheduled_downtime_depth', + '-1'), + ('is_host_active_checks_enabled', + '-1'), + ('hst0', 'on'), + ('hst1', 'on'), + ('hst2', 'on'), + ('hstp', 'on'), + ('is_host_acknowledged', '-1'), + ('is_host_notifications_enabled', + '-1'), + ('is_summary_host', '0')], + 'hidden': True, + 'hide_filters': [], + 'hidebutton': True, + 'layout': 'table', + 'linktitle': 'Host problems for NagStaMon', + 'mustsearch': False, + 'name': 'nagstamon_hosts', + 'num_columns': 1, + 'owner': 'omdadmin', + 'painters': [('host', 'hoststatus', ''), + ('host_icons', None, ''), + ('host_check_age', None, ''), + ('host_state_age', None, ''), + ('host_attempt', None, ''), + ('host_state', None, ''), + ('host_plugin_output', None, ''), + ('host_in_downtime', None, ''), + ('host_acknowledged', None, ''), + ('host_address', None, ''), + ('sitename_plain', None, '')], + 'play_sounds': False, + 'public': True, + 'show_filters': ['host_scheduled_downtime_depth', + 'host_active_checks_enabled', + 'hoststate', + 'host_acknowledged', + 'host_notifications_enabled'], + 'sorters': [], + 'title': 'Host problems for NagStaMon', + 'topic': 'NagStaMon'}, + 'nagstamon_svc': {'browser_reload': 30, + 'column_headers': 'pergroup', + 'datasource': 'services', + 'description': 'This view is intended for usage as web service for NagStaMon.', + 'group_painters': [('service_state', None)], + 'hard_filters': ['summary_host'], + 'hard_filtervars': [('is_service_in_notification_period', + '-1'), + ('is_service_notifications_enabled', + '-1'), + ('hst0', 'on'), + ('hst1', 'on'), + ('hst2', 'on'), + ('hstp', 'on'), + ('is_service_acknowledged', '-1'), + ('is_service_active_checks_enabled', + '-1'), + ('is_host_notifications_enabled', + '-1'), + ('is_summary_host', '0'), + ('st0', ''), + ('st1', 'on'), + ('st2', 'on'), + ('st3', 'on'), + ('stp', ''), + ('is_in_downtime', '-1')], + 'hidden': True, + 'hide_filters': [], + 'hidebutton': True, + 'layout': 'table', + 'linktitle': 'Service problems for NagStaMon', + 'mustsearch': False, + 'name': 'nagstamon_svc', + 'num_columns': 1, + 'owner': 'omdadmin', + 'painters': [('host', 'hoststatus', ''), + ('service_description', 'service', ''), + ('service_icons', None, ''), + ('service_state', None, ''), + ('svc_check_age', None, ''), + ('svc_state_age', None, ''), + ('svc_attempt', None, ''), + ('svc_plugin_output', None, ''), + ('svc_flapping', None, ''), + ('svc_notifications_enabled', None, ''), + ('svc_is_active', None, ''), + ('sitename_plain', None, ''), + ('host_address', None, ''), + ('svc_check_command', None, '')], + 'play_sounds': True, + 'public': True, + 'show_filters': ['service_in_notification_period', + 'service_notifications_enabled', + 'hoststate', + 'service_acknowledged', + 'service_active_checks_enabled', + 'host_notifications_enabled', + 'svcstate', + 'in_downtime'], + 'sorters': [('svcstate', True), + ('stateage', False), + ('svcdescr', False)], + 'title': 'Service problems for NagStaMon', + 'topic': 'NagStaMon'}, }
13 years, 4 months
1
0
0
0
Check_MK Git: check_mk: Updated ChangeLog
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 670a68afe1e7e151a4b8d5ad050565406e2f9102 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=670a68afe1e7e1…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Feb 4 16:54:34 2011 +0100 Updated ChangeLog --- ChangeLog | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebd7d87..faecd95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ Python objects. This allows to connect with NagStaMon (requires patch in NagStaMon). Simply add &output_format=json or &output_format=python to your view URL. + * Added two builtin views for NagStaMon. * Acknowledgement of problem now has checkboxes for sticky, send notification and persisten comment * Downtimes: allow to specify fixed/flexible downtime
13 years, 4 months
1
0
0
0
Check_MK Git: check_mk: Cleaned up obsolete files
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 5fd3b4c70391247177ff05cf954b5d3c8bcdf0ec URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5fd3b4c7039124…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Feb 4 17:00:23 2011 +0100 Cleaned up obsolete files --- LIESMICH.wato | 14 ------- main.mk.test | 120 --------------------------------------------------------- mw | 5 -- 3 files changed, 0 insertions(+), 139 deletions(-) diff --git a/LIESMICH.wato b/LIESMICH.wato deleted file mode 100644 index 7f1b8da..0000000 --- a/LIESMICH.wato +++ /dev/null @@ -1,14 +0,0 @@ - -SNMP Hosts *müssen* das Tag snmp bekommen - sonst geht garnichts. Keine Inventur. -Auch nicht mit expliziten Checks. Nichts. - -* Doku - -* Logfiles pro Dateiname -* Berechtigungen für nicht-OMD bzw. OMD 'shared' - * check_mk --automation als welcher Benutzer? - * check_mk -R ==> check_mk --automation restart - * Rechte für die conf.d/hirni.mk - - - diff --git a/main.mk.test b/main.mk.test deleted file mode 100644 index b5efa43..0000000 --- a/main.mk.test +++ /dev/null @@ -1,120 +0,0 @@ -# Hey emacs, this is -*- python -*- - -# Put your host names here -all_hosts = [ 'localhost|test'] # , 'tt', 'Subversion', 'Localhost', "10.10.0.105" ] - -_munic_hosts = [ - "eins|hirn|muc", - "zwei|test|muc", - "drei|muc|prod", -] - -parents = [ - ( "hirn", ['muc'], ALL_HOSTS ), - ( "sepp", ['zwei', 'drei'] ), -] - - -all_hosts += _munic_hosts - -# Disable direct RRD updates, if no Python-Module rrdtool -# is available -do_rrd_update = False - -datasource_programs = [ -# ( all_hosts, "true" ) -] - -clusters = { - "cluster1|test" : [ 'tt', 'localhost' ], - "cluster2|prod|hirn" : [ 'Localhost', 'eins' ], -} - -host_groups = [ - ( "muc1", [], _munic_hosts ), - ( "muc2", ["muc"], _munic_hosts ), - ( "ohnecluster", PHYSICAL_HOSTS ), - ( "echt_alle", ALL_HOSTS ) -] - -summary_host_groups = [ - ( "sum_muc1", [], _munic_hosts ), - ( "sum_muc2", ["muc"], _munic_hosts ), - ( "sum_ohnecluster", PHYSICAL_HOSTS ), - ( "sum_echt_alle", ALL_HOSTS ) -] - -service_groups = [ - ( "mucfs", ["muc"], ALL_HOSTS, ["fs"] ) - ] - -summary_service_groups = [ - ( "netz", ALL_HOSTS, ["Netzwerk"]), - ] - -service_aggregations = [ - ( "Dateisystem", [ '!Localhost' ] + ALL_HOSTS, "fs" ), - ( "Netzwerk", ALL_HOSTS, "NIC "), - ( "Sonstiges", [ 'muc' ], ALL_HOSTS, "" ) - ] - -checks = [ -# ( 'cluster1', 'df', '/', ( 80, 90 ) ), -# ( 'cluster2', 'df', '/', ( 80, 90 ) ), -# ( 'cluster3', 'vms_df', '/', ( 80, 90 ) ), - ( 'localhost', 'vms_df', 'DSA101', filesystem_default_levels ), - ( 'localhost', 'df', '/media/sda2', ( 75, 85 ) ), - ( 'localhost', 'df', 'Y', filesystem_default_levels ), - ( ['localhost'], 'df', 'X', filesystem_default_levels ), - ( 'localhost', 'df_netapp', 'Z', filesystem_default_levels ), -] - -filesystem_levels = [ - ( (80, 90 ), ['localhost'], ["/media/sda1"] ), - ( (80, 90, 0.8), ['localhost'], [""] ) -] - -ignored_checktypes = [ 'kernel.util' ] - -ignored_services = [ - ( all_hosts, [ "CPU load" ] ), - ( [ "test" ], all_hosts, [ "LOG", "fs" ]) -] - -host_contactgroups = [ - ("muc", ["muc"], ALL_HOSTS ), - ("hirn", ALL_HOSTS ) - ] - -host_notification_periods = [ - ( "9x15m", [ 'test' ], _munic_hosts ), - ( "7x24m", _munic_hosts ), - ( "7x24", ALL_HOSTS ) - ] - -summary_host_notification_periods = [ - ( "s_9x15m", [ 'test' ], _munic_hosts ), - ( "s_7x24m", _munic_hosts ), - ( "s_7x24", ALL_HOSTS ) - ] - -clustered_services = [ - ( ALL_HOSTS, ["!fs_/.", "fs_/"] ) -] - -service_dependencies = [ -# ( "CPU load", ALL_HOSTS, [ "CPU uti" ] ), - ( "NIC %s link", ALL_HOSTS, [ "NIC (.*) parameter" ] ), -# ( "fs_/", ALL_HOSTS, [ "fs_.." ] ), -] - -bulkwalk_hosts = [ ( ["muc"], ALL_HOSTS) ] - -generate_hostconf = False -generate_dummy_commands = False - -# Das hier geht nicht, weil dann der Agent nicht -# als root laeuft -#datasource_programs = [ -# ( "check_mk_agent", ["localhost"] ) -#] diff --git a/mw b/mw deleted file mode 100644 index 1ae4fe5..0000000 --- a/mw +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -sudo cp web/plugins/sidebar/webconf.py ~webconf/local/share/check_mk/web/plugins/sidebar/ -sudo cp web/plugins/pages/webconf.py ~webconf/local/share/check_mk/web/plugins/pages/ -sudo cp web/htdocs/webconf.py ~webconf/local/share/check_mk/web/htdocs/ -
13 years, 4 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: 96eed53b2990c1596d5d708ef21561a1884d59b2 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=96eed53b2990c1…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sat Feb 5 09:17:08 2011 +0100 Merge branch 'master' of ssh://mathias-kettner.de/check_mk Conflicts: ChangeLog ---
13 years, 4 months
1
0
0
0
Check_MK Git: check_mk: Add missing filter for NagStaMon
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 6a02b641f1430889174d47cfca950ef122a3cfaa URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6a02b641f14308…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Feb 4 12:04:09 2011 +0100 Add missing filter for NagStaMon --- web/plugins/views/filters.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py index b9ec53b..f8c469e 100644 --- a/web/plugins/views/filters.py +++ b/web/plugins/views/filters.py @@ -314,6 +314,7 @@ declare_filter(251, FilterNagiosExpression("service", "has_performance_data", "H declare_filter(130, FilterNagiosFlag("host", "host_in_notification_period", "Host in notif. period")) declare_filter(131, FilterNagiosFlag("host", "host_acknowledged", "Host problem has been acknowledged")) +declare_filter(132, FilterNagiosFlag("host", "host_active_checks_enabled", "Host active checks enabled")) declare_filter(133, FilterNagiosFlag("host", "host_notifications_enabled", "Host notifications enabled")) declare_filter(230, FilterNagiosFlag("service", "service_acknowledged", "Problem acknowledged")) declare_filter(231, FilterNagiosFlag("service", "service_in_notification_period", "Service in notif. per."))
13 years, 4 months
1
0
0
0
Check_MK Git: check_mk: Updated ChangeLog
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 9b84930d6de0ed58d5c4bfa96dd2b39f17497b4f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b84930d6de0ed…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Feb 4 12:36:06 2011 +0100 Updated ChangeLog --- ChangeLog | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index b67ca09..b3e96d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ 1.1.9i8: + Multisite: + * New "web service" for retrieving data from views as Python + objects (similar to JSON). This allows to connect with + NagStaMon (requires patch in NagStaMon). + WATO: * Fixed problem appearing at restart on older Python version (RH)
13 years, 4 months
1
0
0
0
Check_MK Git: check_mk: Add output format JSON to web service
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 5dfcc3b372540318cc31ddd3fa152936dad82f55 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5dfcc3b3725403…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Feb 4 13:18:06 2011 +0100 Add output format JSON to web service --- ChangeLog | 7 ++++--- web/plugins/views/webservice.py | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b3e96d8..eaf520a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ 1.1.9i8: Multisite: - * New "web service" for retrieving data from views as Python - objects (similar to JSON). This allows to connect with - NagStaMon (requires patch in NagStaMon). + * New "web service" for retrieving data from views as JSON or + Python objects. This allows to connect with NagStaMon + (requires patch in NagStaMon). Simply add &output_format=json + or &output_format=python to your view URL. WATO: * Fixed problem appearing at restart on older Python version (RH) diff --git a/web/plugins/views/webservice.py b/web/plugins/views/webservice.py index 39621c7..98030ed 100644 --- a/web/plugins/views/webservice.py +++ b/web/plugins/views/webservice.py @@ -29,3 +29,28 @@ multisite_layouts["python"] = { "hide" : True, } +def render_json(data, view, group_painters, painters, num_columns): + columns, rows = data + html.write("[\n") + html.write(repr([p[0]["title"] for p in painters])) + for row in rows: + html.write(",\n[") + first = True + for p in painters: + if first: + first = False + else: + html.write(",") + tdclass, content = prepare_paint(p, row) + stripped = htmllib.strip_tags(content) + utf8 = stripped.encode("utf-8") + html.write(repr(utf8)) + html.write("]") + html.write("\n]\n") + +multisite_layouts["json"] = { + "title" : "JSON data output", + "render" : render_json, + "group" : False, + "hide" : True, +}
13 years, 4 months
1
0
0
0
Check_MK Git: check_mk: Multisite: allow to specify fixed/ flexible for downtimes
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: b1ef5b7a7dbedf47b3af6b4c567abfa81e3b0dad URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b1ef5b7a7dbedf…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Feb 4 13:52:55 2011 +0100 Multisite: allow to specify fixed/flexible for downtimes --- ChangeLog | 1 + web/htdocs/views.py | 27 +++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d7d71c..6fd9ccd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ or &output_format=python to your view URL. * Acknowledgement of problem now has checkboxes for sticky, send notification and persisten comment + * Downtimes: allow to specify fixed/flexible downtime WATO: * Fixed problem appearing at restart on older Python version (RH) diff --git a/web/htdocs/views.py b/web/htdocs/views.py index d37ea2d..fb7d019 100644 --- a/web/htdocs/views.py +++ b/web/htdocs/views.py @@ -1584,21 +1584,23 @@ def show_host_service_actions(what): html.write("</td></tr>\n") if config.may("action.acknowledge"): - html.write("<tr><td rowspan=2 class=legend>Acknowledge</td>\n") + html.write("<tr><td rowspan=3 class=legend>Acknowledge</td>\n") html.write("<td class=content><input type=submit name=_acknowledge value=\"Acknowledge\"> " - "<input type=submit name=_remove_ack value=\"Remove Acknowledgement\"></td></tr><tr>" - "<td class=content><div class=textinputlegend>Comment:</div>") - html.text_input("_ack_comment") - html.write("<br>") + "<input type=submit name=_remove_ack value=\"Remove Acknowledgement\"></td></tr>\n") + + html.write("<tr><td class=content>") html.checkbox("_ack_sticky", True) html.write(" sticky ") html.checkbox("_ack_notify", True) html.write(" send notification ") html.checkbox("_ack_persistent", False) html.write(" persistent comment") - html.write("</td></tr>\n") + html.write("<tr><td class=content><div class=textinputlegend>Comment:</div>") + html.text_input("_ack_comment") + html.write("</td></tr>\n") + if config.may("action.addcomment"): html.write("<tr><td rowspan=2 class=legend>Add comment</td>\n") html.write("<td class=content><input type=submit name=_add_comment value=\"Add comment\"></td></tr>\n" @@ -1607,7 +1609,7 @@ def show_host_service_actions(what): html.write("</td></tr>\n") if config.may("action.downtimes"): - html.write("<tr><td class=legend rowspan=3>Schedule Downtimes</td>\n" + html.write("<tr><td class=legend rowspan=4>Schedule Downtimes</td>\n" "<td class=content>\n" "<input type=submit name=_down_2h value=\"2 hours\"> " "<input type=submit name=_down_today value=\"Today\"> " @@ -1623,6 +1625,11 @@ def show_host_service_actions(what): html.write(" to ") html.datetime_input("_down_to", time.time() + 7200) html.write("</td></tr>") + html.write("<tr><td class=content>") + html.checkbox("_down_flexible", False) + html.write(" flexible (automatically end downtime as soon as %s is %s again)" % + (what, what == "host" and "up" or "OK")) + html.write("</td></tr>\n") html.write("<tr><td class=content><div class=textinputlegend>Comment:</div>\n") html.text_input("_down_comment") @@ -1792,8 +1799,12 @@ def nagios_host_service_action_command(what, dataset): comment = html.var_utf8("_down_comment") if not comment: raise MKUserError("_down_comment", "You need to supply a comment for your downtime.") + if html.var("_down_flexible"): + fixed = 0 + else: + fixed = 1 command = (("SCHEDULE_" + cmdtag + "_DOWNTIME;%s;" % spec) \ - + ("%d;%d;1;0;0;%s;" % (int(down_from), int(down_to), html.req.user)) \ + + ("%d;%d;%d;0;0;%s;" % (int(down_from), int(down_to), fixed, html.req.user)) \ + comment) nagios_command = ("[%d] " % int(time.time())) + command + "\n"
13 years, 4 months
1
0
0
0
Check_MK Git: check_mk: Multisite: Acknowledgment supports all flags now
by git@mathias-kettner.de
Module: check_mk Branch: master Commit: 715b37cfce2b46094832f391ffb5a3d55baadac5 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=715b37cfce2b46…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Feb 4 13:38:08 2011 +0100 Multisite: Acknowledgment supports all flags now --- ChangeLog | 2 ++ web/htdocs/views.py | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eaf520a..8d7d71c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ Python objects. This allows to connect with NagStaMon (requires patch in NagStaMon). Simply add &output_format=json or &output_format=python to your view URL. + * Acknowledgement of problem now has checkboxes for sticky, + send notification and persisten comment WATO: * Fixed problem appearing at restart on older Python version (RH) diff --git a/web/htdocs/views.py b/web/htdocs/views.py index 7555b7d..d37ea2d 100644 --- a/web/htdocs/views.py +++ b/web/htdocs/views.py @@ -1589,6 +1589,14 @@ def show_host_service_actions(what): "<input type=submit name=_remove_ack value=\"Remove Acknowledgement\"></td></tr><tr>" "<td class=content><div class=textinputlegend>Comment:</div>") html.text_input("_ack_comment") + html.write("<br>") + html.checkbox("_ack_sticky", True) + html.write(" sticky ") + html.checkbox("_ack_notify", True) + html.write(" send notification ") + html.checkbox("_ack_persistent", False) + html.write(" persistent comment") + html.write("</td></tr>\n") if config.may("action.addcomment"): @@ -1707,8 +1715,11 @@ def nagios_host_service_action_command(what, dataset): comment = html.var_utf8("_ack_comment") if not comment: raise MKUserError("_ack_comment", "You need to supply a comment.") - command = "ACKNOWLEDGE_" + cmdtag + "_PROBLEM;%s;2;1;0;%s" % \ - (spec, html.req.user) + (";%s" % comment) + sticky = html.var("_ack_sticky") and 2 or 0 + sendnot = html.var("_ack_notify") and 1 or 0 + perscomm = html.var("_ack_persistent") and 1 or 0 + command = "ACKNOWLEDGE_" + cmdtag + "_PROBLEM;%s;%d;%d;%d;%s" % \ + (spec, sticky, sendnot, perscomm, html.req.user) + (";%s" % comment) title = "<b>acknowledge the problems</b> of" elif html.var("_add_comment") and config.may("action.addcomment"):
13 years, 4 months
1
0
0
0
← Newer
1
...
13
14
15
16
17
18
19
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Results per page:
10
25
50
100
200