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
March 2013
----- 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
209 discussions
Start a n
N
ew thread
Check_MK Git: check_mk: FIX: Fix hiliting of errors in Nagios output
by Mathias Kettner
Module: check_mk Branch: master Commit: d16f5e9273145570e2f23747f4bb2d0effcd97b3 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d16f5e92731455…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Tue Mar 12 12:28:21 2013 +0100 FIX: Fix hiliting of errors in Nagios output --- ChangeLog | 5 ++++- web/htdocs/wato.css | 10 +++++++--- web/htdocs/wato.py | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15dc4a0..00cb2d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,9 +72,12 @@ * Checks can now omit the typical "OK - " or "WARN -". This text will be added automatically if missing. - livestatus: + Livestatus: * FIX: possible crash with VERY long downtime comments + WATO: + * FIX: Fix hiliting of errors in Nagios output + 1.2.2b4: Core: * FIX: Fix output of cmk -D: datasource programs were missing diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css index 4b34f30..5580120 100644 --- a/web/htdocs/wato.css +++ b/web/htdocs/wato.css @@ -1003,14 +1003,18 @@ div.varname { vertical-align: bottom; } -.wato div.error pre div.err { +.wato div.error div.err { background-color: yellow; color: #000; font-weight: bold; width: 100%; - margin: 0; - padding: 0; + margin: 2px; + padding: 2px 5px; float: left; + border-radius: 3px; + position: relative; + left: -8px; + opacity: 0.90; } /* Logwatch pattern editor */ diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index c678911..6b95626 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -4116,7 +4116,7 @@ def check_mk_local_automation(command, args=[], indata=""): def hilite_errors(outdata): - return re.sub("\nError: *([^\n]*)", "\n<div class=err>Error: \\1</div>", outdata) + return re.sub("\nError: *([^\n]*)", "\n<div class=err><b>Error:</b> \\1</div>", outdata) #.
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: able to handle equal comment ids in host and service
by Andreas Boesl
Module: check_mk Branch: master Commit: 69275238df990f4f57888701ee022c18c60304a1 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=69275238df990f…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Mon Mar 11 17:12:31 2013 +0100 able to handle equal comment ids in host and service --- ChangeLog | 1 + livestatus/src/DownCommColumn.cc | 21 +++++++++++---------- livestatus/src/DownCommColumn.h | 5 +++-- livestatus/src/TableDownComm.cc | 27 +++++++++++++++------------ livestatus/src/TableDownComm.h | 8 +++++--- livestatus/src/TableHosts.cc | 10 +++++----- livestatus/src/TableServices.cc | 10 +++++----- 7 files changed, 45 insertions(+), 37 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=69275238df…
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: comment out new Network Topology dashboard for the while...
by Mathias Kettner
Module: check_mk Branch: master Commit: eb2e342897d1a24693d8f6cffb184b0a3aa645e0 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eb2e342897d1a2…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Mar 10 17:37:24 2013 +0100 comment out new Network Topology dashboard for the while... --- web/plugins/dashboard/builtin.py | 32 +++++++++++++++++--------------- 1 files changed, 17 insertions(+), 15 deletions(-) diff --git a/web/plugins/dashboard/builtin.py b/web/plugins/dashboard/builtin.py index dc942ff..fabfaf2 100644 --- a/web/plugins/dashboard/builtin.py +++ b/web/plugins/dashboard/builtin.py @@ -69,18 +69,20 @@ builtin_dashboards["main"] = { ] } -builtin_dashboards["topology"] = { - "title" : _("Network Topology"), - "dashlets" : [ - { - "title" : "Topology of Site " + defaults.omd_site, - "iframe" : defaults.url_prefix + 'nagvis/frontend/nagvis-js/index.php?' + \ - 'mod=Map&header_template=default&header_menu=0&label_show=1' + \ - '&sources=automap&act=view&backend_id=' + defaults.omd_site + \ - '&render_mode=undirected&url_target=main', - "reload_on_resize" : True, - "position" : (1, 0), - "size" : (GROW, GROW), - }, - ] -} +# New topology dashboard: Will be activated as soon as we have a NagVis +# version that supports this... +# builtin_dashboards["topology"] = { +# "title" : _("Network Topology"), +# "dashlets" : [ +# { +# "title" : "Topology of Site " + defaults.omd_site, +# "iframe" : defaults.url_prefix + 'nagvis/frontend/nagvis-js/index.php?' + \ +# 'mod=Map&header_template=default&header_menu=0&label_show=1' + \ +# '&sources=automap&act=view&backend_id=' + defaults.omd_site + \ +# '&render_mode=undirected&url_target=main', +# "reload_on_resize" : True, +# "position" : (1, 0), +# "size" : (GROW, GROW), +# }, +# ] +# }
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: Fix missing command check-mk-ping
by Mathias Kettner
Module: check_mk Branch: master Commit: 15e31306ef0bf01b2d7db2a0a875d21ab98f3410 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=15e31306ef0bf0…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Mar 10 17:32:52 2013 +0100 Fix missing command check-mk-ping --- check_mk_templates.cfg | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/check_mk_templates.cfg b/check_mk_templates.cfg index f20ac04..e21e65d 100644 --- a/check_mk_templates.cfg +++ b/check_mk_templates.cfg @@ -316,13 +316,13 @@ define command { } define command { - command_name check-mk-host-ping + command_name check-mk-ping command_line @CHECK_ICMP@ $ARG1$ $HOSTADDRESS$ } # Check for clusters: it is UP if at least one node is up define command { - command_name check-mk-host-ping-cluster + command_name check-mk-ping-cluster command_line @CHECK_ICMP@ -m 1 $ARG1$ $_HOSTNODEIPS$ }
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: a8736d4731869f1c63eb65ad99f674d2ce2d4ffc URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a8736d4731869f…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Mar 10 17:29:39 2013 +0100 Merge branch 'master' of ssh://mathias-kettner.de/check_mk ---
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: htmllib: new function del_all_vars()
by Mathias Kettner
Module: check_mk Branch: master Commit: b036893636d90d24e49aaa0d3fadc1b25a847cc9 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b036893636d90d…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Sun Mar 10 17:29:36 2013 +0100 htmllib: new function del_all_vars() --- web/htdocs/forms.py | 2 +- web/htdocs/htmllib.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/web/htdocs/forms.py b/web/htdocs/forms.py index a519e7f..1cee46a 100644 --- a/web/htdocs/forms.py +++ b/web/htdocs/forms.py @@ -54,7 +54,7 @@ def edit_dictionary(entries, value, focus=None, hover_help=True, validate=None, messages.append(u"%s: %s" % (vs.title(), e.message)) html.add_user_error(e.varname, e.message) - if validate: + if validate and not html.has_user_errors(): try: validate(new_value) except MKUserError, e: diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 2128ad4..dc8f8d8 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -1041,6 +1041,10 @@ class html: if varname in self.req.listvars: del self.req.listvars[varname] + def del_all_vars(self): + self.req.vars = {} + self.req.listvars = {} + def javascript(self, code): self.write("<script language=\"javascript\">\n%s\n</script>\n" % code)
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: Dashboards can now be configured to be reloaded on resizing
by Lars Michelsen
Module: check_mk Branch: master Commit: b089424b9056c5e783221ecda95e9380e7cd2eed URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b089424b9056c5…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Sat Mar 9 15:28:12 2013 +0100 Dashboards can now be configured to be reloaded on resizing (automatically adds width/height url parameters) --- ChangeLog | 2 ++ web/htdocs/dashboard.py | 15 +++++++++++++-- web/htdocs/js/dashboard.js | 17 +++++++++++++++++ web/plugins/dashboard/builtin.py | 16 ++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c12d58d..723cc7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ correctly even for multisite related settings * perfometer: Bit values now using base of 1000 * ADD: check_disk_smb pnp-template + * Dashboards can now be configured to be reloaded on resizing + (automatically adds width/height url parameters) Event Console: * New rule feature: automatically delete event after actions diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py index d124a60..d270fcc 100644 --- a/web/htdocs/dashboard.py +++ b/web/htdocs/dashboard.py @@ -213,16 +213,27 @@ def render_dashlet(nr, dashlet, wato_folder): if "view" in dashlet: dashlet["iframe"] = "view.py?view_name=%s&_display_options=HRSIXL&_body_class=dashlet" % dashlet["view"] + if dashlet.get("reload_on_resize"): + dashlet["onload"] = "dashlet_add_dimensions('dashlet_%d', this)" % nr + # The content is rendered only if it is fixed. In the # other cases the initial (re)-size will paint the content. if "content" in dashlet: # fixed content html.write(dashlet["content"]) elif "iframe" in dashlet: # fixed content containing iframe + if not dashlet.get("reload_on_resize"): + url = add_wato_folder_to_url(dashlet["iframe"], wato_folder) + else: + url = 'about:blank' + # Fix of iPad >:-P html.write('<div style="width: 100%; height: 100%; -webkit-overflow-scrolling:touch; overflow: auto;">') - html.write('<iframe allowTransparency="true" frameborder="0" width="100%%" height="100%%" src="%s"></iframe>' % - add_wato_folder_to_url(dashlet["iframe"], wato_folder)) + html.write('<iframe id="dashlet_iframe_%d" allowTransparency="true" frameborder="0" width="100%%" ' + 'height="100%%" src="%s"> </iframe>' % (nr, url)) html.write('</div>') + if dashlet.get("reload_on_resize"): + html.javascript('reload_on_resize["%d"] = "%s"' % + (nr, add_wato_folder_to_url(dashlet["iframe"], wato_folder))) html.write("</div></div>\n") # Here comes the brain stuff: An intelligent liquid layout algorithm. diff --git a/web/htdocs/js/dashboard.js b/web/htdocs/js/dashboard.js index f0b9a75..43d1338 100644 --- a/web/htdocs/js/dashboard.js +++ b/web/htdocs/js/dashboard.js @@ -22,6 +22,9 @@ // to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA. +// snapin ids and urls +var reload_on_resize = {}; + function resize_dashlets(id, code) { var resize_info = eval(code); @@ -102,6 +105,14 @@ function resize_dashlets(id, code) if (netto_height > 0) oDash.style.height = netto_height + "px"; } + + if (typeof reload_on_resize[d_number] != 'undefined') { + var base_url = reload_on_resize[d_number]; + var iframe = document.getElementById("dashlet_iframe_" + d_number); + iframe.src = base_url + '&width=' + oDash.clientWidth + + '&height=' + oDash.clientHeight; + iframe = null; + } } oDash = null; } @@ -158,3 +169,9 @@ function update_dashlet(id, code) { obj = null; } } + +//function dashlet_open_with_dimensions(id, url) { +// var dashlet = document.getElementById('dashlet_' + id); +// alert(dashlet.clientWidth); +// //iframe.src = url + '&width=' + iframe.clientWidth + '&height=' + iframe.clientHeight; +//} diff --git a/web/plugins/dashboard/builtin.py b/web/plugins/dashboard/builtin.py index ad0fef6..dc942ff 100644 --- a/web/plugins/dashboard/builtin.py +++ b/web/plugins/dashboard/builtin.py @@ -68,3 +68,19 @@ builtin_dashboards["main"] = { }, ] } + +builtin_dashboards["topology"] = { + "title" : _("Network Topology"), + "dashlets" : [ + { + "title" : "Topology of Site " + defaults.omd_site, + "iframe" : defaults.url_prefix + 'nagvis/frontend/nagvis-js/index.php?' + \ + 'mod=Map&header_template=default&header_menu=0&label_show=1' + \ + '&sources=automap&act=view&backend_id=' + defaults.omd_site + \ + '&render_mode=undirected&url_target=main', + "reload_on_resize" : True, + "position" : (1, 0), + "size" : (GROW, GROW), + }, + ] +}
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: Host check command configurable via WATO
by Mathias Kettner
Module: check_mk Branch: master Commit: 4099be80723cf8dd70035bbc2e55b9ae86af6929 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4099be80723cf8…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Mar 8 19:01:14 2013 +0100 Host check command configurable via WATO including automatic command definition for Nagios --- .f12 | 11 +++++ ChangeLog | 3 + check_mk_templates.cfg | 16 ++++++- doc/.f12 | 13 ------ modules/check_mk.py | 63 ++++++++++++++++++++++++---- web/plugins/wato/active_checks.py | 1 + web/plugins/wato/check_mk_configuration.py | 33 ++++++++++++-- 7 files changed, 111 insertions(+), 29 deletions(-) diff --git a/.f12 b/.f12 index 3871f7d..9b77ef2 100644 --- a/.f12 +++ b/.f12 @@ -1,3 +1,14 @@ +SITE=${SITE:-$(omd sites --bare | head -n 1)} +sed -e "s#@BINDIR@#/omd/sites/$SITE/bin#g" \ + -e "s#@VARDIR@#/omd/sites/$SITE/var/check_mk#g" \ + -e "s#@CHECK_ICMP@#/omd/sites/$SITE/lib/nagios/plugins/check_icmp#g" \ + -e "s#@PNPURL@#/$SITE/pnp4nagios/#g" \ + -e "s#@CGIURL@#/$SITE/nagios/cgi-bin#g" \ + < check_mk_templates.cfg > /tmp/check_mk_templates.cfg + +sudo mv /tmp/check_mk_templates.cfg /omd/sites/$SITE/etc/nagios/conf.d + +(cd doc ; bash .f12) (cd web ; bash .f12) (cd modules ; bash .f12) (cd checks ; bash .f12) diff --git a/ChangeLog b/ChangeLog index 64a5db7..f6eec15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ Core: * Agents can send data for other hosts "piggyback". This is being used by the vSphere and SAP plugins + * New variable host_check_commands, that allows the definition of + an alternative host check command (without manually defining one) Multisite: * New availability view for arbitrary host/service collections @@ -58,6 +60,7 @@ * Removed global option logwatch_forward_to_ec, moved this to the logwatch_ec ruleset. With this option the forwarding can now be enabled for each logfile on a host + * Configuration of an alternativ host check command 1.2.2b5: Core: diff --git a/check_mk_templates.cfg b/check_mk_templates.cfg index 381e585..f20ac04 100644 --- a/check_mk_templates.cfg +++ b/check_mk_templates.cfg @@ -316,16 +316,28 @@ define command { } define command { - command_name check-mk-ping + command_name check-mk-host-ping command_line @CHECK_ICMP@ $ARG1$ $HOSTADDRESS$ } # Check for clusters: it is UP if at least one node is up define command { - command_name check-mk-ping-cluster + command_name check-mk-host-ping-cluster command_line @CHECK_ICMP@ -m 1 $ARG1$ $_HOSTNODEIPS$ } +# Dummy host check that always assumes that the host is up +define command { + command_name check-mk-host-ok + command_line echo "OK - Host is always assumed to be up" +} + +define command { + command_name check-mk-host-tcp + command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ +} + + # General notification script. Details can be configured # in main.mk via notification_... options define command { diff --git a/doc/.f12 b/doc/.f12 index 64efbb0..096bb80 100644 --- a/doc/.f12 +++ b/doc/.f12 @@ -1,14 +1 @@ -#!/bin/bash -SITE=${SITE:-$(omd sites --bare | head -n 1)} -set -xe - -sed -e "s#@BINDIR@#/omd/sites/$SITE/bin#g" \ - -e "s#@VARDIR@#/omd/sites/$SITE/var/check_mk#g" \ - -e "s#@CHECK_ICMP@#/omd/sites/$SITE/lib/nagios/plugins/check_icmp#g" \ - -e "s#@PNPURL@#/$SITE/pnp4nagios/#g" \ - -e "s#@CGIURL@#/$SITE/nagios/cgi-bin#g" \ - < check_mk_templates.cfg > /tmp/check_mk_templates.cfg - -sudo mv /tmp/check_mk_templates.cfg /omd/sites/$SITE/etc/nagios/conf.d -sudo omd restart $SITE nagios sudo cp -pr * /omd/versions/default/share/doc/check_mk diff --git a/modules/check_mk.py b/modules/check_mk.py index a56ad20..24fa8c8 100755 --- a/modules/check_mk.py +++ b/modules/check_mk.py @@ -320,9 +320,11 @@ donation_command = 'mail -r checkmk(a)yoursite.de -s "Host do scanparent_hosts = [ ( ALL_HOSTS ) ] host_attributes = {} # needed by WATO, ignored by Check_MK ping_levels = [] # special parameters for host/PING check_command +host_check_commands = [] # alternative host check instead of check_icmp check_periods = [] + # global variables used to cache temporary values (not needed in check_mk_base) ip_to_hostname_cache = None @@ -1268,6 +1270,43 @@ def extra_conf_of(confdict, hostname, service): result += format % (key, values[0]) return result +def host_check_command(hostname, ip, is_clust): + # Check dedicated host check command + values = host_extra_conf(hostname, host_check_commands) + if values: + value = values[0] + else: + value = "ping" + + if value == "ping": + ping_args = check_icmp_arguments(hostname) + if is_clust and ip: # Do check cluster IP address if one is there + return "check-mk-host-ping!%s" % ping_args + elif ping_args and is_clust: # use check_icmp in cluster mode + return "check-mk-host-ping-cluster!%s" % ping_args + elif ping_args: # use special arguments + return "check-mk-host-ping!%s" % ping_args + else: + return None + + elif value == "ok": + return "check-mk-host-ok" + + elif value == "agent" or value[0] == "service": + service = value == "agent" and "Check_MK" or value[1] + command = "check-mk-host-custom-%d" % (len(hostcheck_commands_to_define) + 1) + hostcheck_commands_to_define.append((command, + 'echo "$SERVICEOUTPUT:%s:%s$" && exit $SERVICESTATEID:%s:%s$' % (hostname, service, hostname, service))) + return command + + elif value[0] == "tcp": + return "check-mk-host-tcp!" + str(value[1]) + + raise MKGeneralException("Invalid value %r for host_check_command of host %s." % ( + value, hostname)) + + + def check_icmp_arguments(hostname): values = host_extra_conf(hostname, ping_levels) levels = {} @@ -1499,6 +1538,8 @@ def create_nagios_config(outfile = sys.stdout, hostnames = None): active_checks_to_define = set([]) global custom_commands_to_define custom_commands_to_define = set([]) + global hostcheck_commands_to_define + hostcheck_commands_to_define = [] if host_notification_periods != []: raise MKGeneralException("host_notification_periods is not longer supported. Please use extra_host_conf['notification_period'] instead.") @@ -1571,15 +1612,10 @@ def create_nagios_hostdefs(outfile, hostname): outfile.write(" address\t\t\t%s\n" % (ip and make_utf8(ip) or "0.0.0.0")) outfile.write(" _TAGS\t\t\t\t%s\n" % " ".join(tags_of_host(hostname))) - # Levels for host check - ping_args = check_icmp_arguments(hostname) - if is_clust and ip: # Do check cluster IP address if one is there - outfile.write(" check_command\t\t\tcheck-mk-ping!%s\n" % ping_args) - elif ping_args and is_clust: # use check_icmp in cluster mode - outfile.write(" check_command\t\t\tcheck-mk-ping-cluster!%s\n" % ping_args) - elif ping_args: # use special arguments - outfile.write(" check_command\t\t\tcheck-mk-ping!%s\n" % ping_args) - + # Host check command might differ from default + command = host_check_command(hostname, ip, is_clust) + if command: + outfile.write(" check_command\t\t\t%s\n" % command) # WATO folder path path = host_paths.get(hostname) @@ -2093,6 +2129,15 @@ def create_nagios_config_commands(outfile): """ % command_name) + # custom host checks + for command_name, command_line in hostcheck_commands_to_define: + outfile.write("""define command { + command_name\t\t\t%s + command_line\t\t\t%s +} + +""" % (command_name, command_line)) + def create_nagios_config_timeperiods(outfile): if len(timeperiods) > 0: diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py index e18d2de..4a1b3d0 100644 --- a/web/plugins/wato/active_checks.py +++ b/web/plugins/wato/active_checks.py @@ -892,3 +892,4 @@ register_rule(group, match = 'all' ) + diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py index 528ed29..0a9fcf2 100644 --- a/web/plugins/wato/check_mk_configuration.py +++ b/web/plugins/wato/check_mk_configuration.py @@ -1153,15 +1153,38 @@ register_rule(group, "the state of the host will stay at its last status.")), ) +register_rule( + group, + "host_check_commands", + CascadingDropdown( + title = _("Host Check Command"), + help = _("Usually Check_MK uses a series of PING (ICMP echo request) in order to determine " + "whether a host is up. In some cases this is not possible, however. With this rule " + "you can specify an alternative way of determining the host's state."), + choices = [ + ( "ping", _("PING (ICMP echo request)") ), + ( "tcp" , _("TCP Connect"), Integer(label = _("to port:"), minvalue=1, maxvalue=65535, default_value=80 )), + ( "ok", _("Always assume host to be up") ), + ( "agent", _("Use the status of the Check_MK Agent") ), + ( "service", _("Use the status of the service..."), TextUnicode(label = ":", size=32, allow_empty=False )), + ], + default_value = "ping", + html_separator = " ", + ), + match = 'first' +) + + register_rule(group, "extra_host_conf:check_command", TextAscii( + title = _("Internal Command for Hosts Check"), label = _("Command:"), - title = _("Check Command for Hosts Check"), - help = _("This parameter changes the default check_command for " - "a host check"), - ), - ) + help = _("This ruleset is deprecated and will be removed soon: " + "it changes the default check_command for a host check. You need to " + "define that command manually in your monitoring configuration."), + ), +) group = "monconf/" + _("Notifications") register_rule(group,
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: 32e6f6b361f2b725de13a54a8c60d84ba44fffaa URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=32e6f6b361f2b7…
Author: Mathias Kettner <mk(a)mathias-kettner.de> Date: Fri Mar 8 19:01:18 2013 +0100 Merge branch 'master' of ssh://mathias-kettner.de/check_mk ---
11 years, 3 months
1
0
0
0
Check_MK Git: check_mk: fixed typo: Unsed rulesets
by Andreas Boesl
Module: check_mk Branch: master Commit: 7cdb1e29d440bf95fecf397e6a33e3c8dca4339b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7cdb1e29d440bf…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Fri Mar 8 17:08:51 2013 +0100 fixed typo: Unsed rulesets --- web/htdocs/wato.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 5c81dc7..c678911 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -9868,7 +9868,7 @@ def mode_edit_ruleset(phase): make_link([("mode", "rulesets"), ("group", group), ("host", hostname)]), "back") html.context_button(_("Used Rulesets"), make_link([("mode", "rulesets"), ("group", "used"), ("host", hostname)]), "usedrulesets") - html.context_button(_("Unsed Rulesets"), + html.context_button(_("Unused Rulesets"), make_link([("mode", "rulesets"), ("group", "unused")]), "usedrulesets") if hostname: html.context_button(_("Services"),
11 years, 3 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
21
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
Results per page:
10
25
50
100
200