Module: check_mk
Branch: master
Commit: d4f837b3d371b2658a95b880a8273a8629b116c3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d4f837b3d371b2…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Nov 8 08:47:17 2018 +0100
moved get_omd_config to cmk_base.config
Change-Id: I283e32a2c2ad74344f6eec03ad0d8fa1a1a2df7a
---
cmk/notification_plugins/mail.py | 19 +++----------------
cmk/site.py | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 16 deletions(-)
diff --git a/cmk/notification_plugins/mail.py b/cmk/notification_plugins/mail.py
index a25a07b..376660b 100644
--- a/cmk/notification_plugins/mail.py
+++ b/cmk/notification_plugins/mail.py
@@ -44,6 +44,7 @@ from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from cmk.notification_plugins import utils
+import cmk.site as site
def tmpl_head_html(html_section):
@@ -711,7 +712,7 @@ def render_cmk_graphs(context):
svc_desc = context["SERVICEDESC"]
url = "http://localhost:%d/%s/check_mk/ajax_graph_images.py?host=%s&service=%s" % \
- (get_apache_port(), os.environ["OMD_SITE"],
+ (site.get_apache_port(), os.environ["OMD_SITE"],
urllib.quote(context["HOSTNAME"]), urllib.quote(svc_desc))
try:
@@ -734,22 +735,8 @@ def render_cmk_graphs(context):
return map(base64.b64decode, base64_strings)
-def get_omd_config(key):
- for l in file(os.environ["OMD_ROOT"] + "/etc/omd/site.conf"):
- if l.startswith(key + "="):
- return l.split("=")[-1].strip("'\n")
- return None
-
-
-def get_apache_port():
- port = get_omd_config("CONFIG_APACHE_TCP_PORT")
- if port is None:
- return 80
- return int(port)
-
-
def use_cmk_graphs():
- return get_omd_config("CONFIG_CORE") == "cmc"
+ return site.get_omd_config("CONFIG_CORE") == "cmc"
def render_performance_graphs(context):
diff --git a/cmk/site.py b/cmk/site.py
new file mode 100644
index 0000000..7a62211
--- /dev/null
+++ b/cmk/site.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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-
+# tails. 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.
+
+import os
+
+def get_omd_config(key):
+ for l in file(os.environ["OMD_ROOT"] + "/etc/omd/site.conf"):
+ if l.startswith(key + "="):
+ return l.split("=")[-1].strip("'\n")
+ return None
+
+
+def get_apache_port():
+ port = get_omd_config("CONFIG_APACHE_TCP_PORT")
+ if port is None:
+ return 80
+ return int(port)
Module: check_mk
Branch: master
Commit: d67f9fb6d7f4a5cdbc7813cc55988d5c210ea076
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d67f9fb6d7f4a5…
Author: Alex Zurhake <az(a)mathias-kettner.de>
Date: Wed Nov 7 11:03:31 2018 +0100
Update nagios core from 3.5.0 to 3.5.1
Change-Id: I6a5384f8e228c1b80bcd2d72e47201b6725093e2
---
omd/packages/nagios/Makefile | 4 +-
omd/packages/nagios/nagios-3.5.0.tar.gz | Bin 1789376 -> 0 bytes
omd/packages/nagios/nagios-3.5.1.tar.gz | Bin 0 -> 1798614 bytes
.../patches/0004-remove-updateversioninfo.dif | 6 +--
.../patches/0008-fix-encoding-after-2-reloads.dif | 10 ----
...-comparison-operator-in-service-freshness-c.dif | 13 -----
...-445-Adding-triggered-downtime-for-child-ho.dif | 58 ---------------------
7 files changed, 4 insertions(+), 87 deletions(-)
diff --git a/omd/packages/nagios/Makefile b/omd/packages/nagios/Makefile
index ad664de..df03dd7 100644
--- a/omd/packages/nagios/Makefile
+++ b/omd/packages/nagios/Makefile
@@ -1,7 +1,7 @@
include ../../Makefile.omd
NAME = nagios
-VERSION = 3.5.0
+VERSION = 3.5.1
DIR = $(NAME)-$(VERSION)
# Configure options for Nagios. Since we want to compile
@@ -31,8 +31,6 @@ compile:
unpack:
rm -rf $(DIR)
tar xzf $(DIR).tar.gz
- mv nagios $(DIR)
-
patch:
set -e ; for p in patches/*.dif ; do \
diff --git a/omd/packages/nagios/nagios-3.5.0.tar.gz b/omd/packages/nagios/nagios-3.5.0.tar.gz
deleted file mode 100644
index 4f1a996..0000000
Binary files a/omd/packages/nagios/nagios-3.5.0.tar.gz and /dev/null differ
diff --git a/omd/packages/nagios/nagios-3.5.1.tar.gz b/omd/packages/nagios/nagios-3.5.1.tar.gz
new file mode 100644
index 0000000..5142fe4
Binary files /dev/null and b/omd/packages/nagios/nagios-3.5.1.tar.gz differ
diff --git a/omd/packages/nagios/patches/0004-remove-updateversioninfo.dif b/omd/packages/nagios/patches/0004-remove-updateversioninfo.dif
index f3c7316..0ec9604 100644
--- a/omd/packages/nagios/patches/0004-remove-updateversioninfo.dif
+++ b/omd/packages/nagios/patches/0004-remove-updateversioninfo.dif
@@ -2,9 +2,9 @@
+++ nagios.b/html/main.php 2013-03-24 13:55:49.000000000 +0100
@@ -40,38 +40,10 @@
<div class="product">Nagios<sup><span style="font-size: small;">®</span></sup> Core<sup><span style="font-size: small;">™</span></sup></div>
- <div class="version">Version 3.5.0</div>
- <div class="releasedate">March 15, 2013</div>
--<div class="checkforupdates"><a href="http://www.nagios.org/checkforupdates/?version=3.5.0&product=nagioscore" target="_blank">Check for updates</a></div>
+ <div class="version">Version 3.5.1</div>
+ <div class="releasedate">August 30, 2013</div>
+-<div class="checkforupdates"><a href="http://www.nagios.org/checkforupdates/?version=3.5.1&product=nagioscore" target="_blank">Check for updates</a></div>
<!--<div class="whatsnew"><a href="http://go.nagios.com/nagioscore/whatsnew">Read what's new in Nagios Core 3</a></div>-->
</div>
diff --git a/omd/packages/nagios/patches/0008-fix-encoding-after-2-reloads.dif b/omd/packages/nagios/patches/0008-fix-encoding-after-2-reloads.dif
deleted file mode 100644
index 45ee157..0000000
--- a/omd/packages/nagios/patches/0008-fix-encoding-after-2-reloads.dif
+++ /dev/null
@@ -1,10 +0,0 @@
---- nagios-3.5.0/common/macros.c.orig 2013-06-07 15:11:04.327006405 +0200
-+++ nagios-3.5.0/common/macros.c 2013-06-07 15:11:23.603004838 +0200
-@@ -2585,6 +2585,7 @@
- for(x = 0; x < MACRO_X_COUNT; x++) {
- macro_keys[x].code = x;
- macro_keys[x].name = macro_x_names[x];
-+ macro_keys[x].clean_options = 0;
-
- /* host/service output/perfdata and author/comment macros should get cleaned */
- if((x >= 16 && x <= 19) || (x >= 49 && x <= 52) || (x >= 99 && x <= 100) || (x >= 124 && x <= 127)) {
diff --git a/omd/packages/nagios/patches/0009-Corrected-comparison-operator-in-service-freshness-c.dif b/omd/packages/nagios/patches/0009-Corrected-comparison-operator-in-service-freshness-c.dif
deleted file mode 100644
index 5d529f0..0000000
--- a/omd/packages/nagios/patches/0009-Corrected-comparison-operator-in-service-freshness-c.dif
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/base/checks.c b/base/checks.c
---- a/base/checks.c
-+++ b/base/checks.c
-@@ -2086,7 +2086,7 @@ int is_service_result_fresh(service *temp_service, time_t current_time, int log_
- */
- if(temp_service->check_type == SERVICE_CHECK_PASSIVE) {
- if(temp_service->last_check < event_start &&
-- event_start - last_program_stop < freshness_threshold * 0.618) {
-+ event_start - last_program_stop > freshness_threshold * 0.618) {
- expiration_time = event_start + freshness_threshold;
- }
- }
-
diff --git a/omd/packages/nagios/patches/0010-Fixed-bug-445-Adding-triggered-downtime-for-child-ho.dif b/omd/packages/nagios/patches/0010-Fixed-bug-445-Adding-triggered-downtime-for-child-ho.dif
deleted file mode 100644
index 1f683f4..0000000
--- a/omd/packages/nagios/patches/0010-Fixed-bug-445-Adding-triggered-downtime-for-child-ho.dif
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/common/downtime.c b/common/downtime.c
---- a/common/downtime.c
-+++ b/common/downtime.c
-@@ -360,6 +360,14 @@ int register_downtime(int type, unsigned long downtime_id) {
- }
- }
-
-+ /* If the downtime is triggered and was in effect, mark it as not in
-+ effect so it gets scheduled correctly */
-+ if((temp_downtime->triggered_by != 0) &&
-+ (TRUE == temp_downtime->is_in_effect)) {
-+ was_in_effect = temp_downtime->is_in_effect;
-+ temp_downtime->is_in_effect = FALSE;
-+ }
-+
- if((FALSE == temp_downtime->fixed) && (FALSE == was_in_effect)) {
- /* increment pending flex downtime counter */
- if(temp_downtime->type == HOST_DOWNTIME)
-@@ -1111,6 +1119,39 @@ int add_downtime(int downtime_type, char *host_name, char *svc_description, time
- static int downtime_compar(const void *p1, const void *p2) {
- scheduled_downtime *d1 = *(scheduled_downtime **)p1;
- scheduled_downtime *d2 = *(scheduled_downtime **)p2;
-+
-+ /*
-+ If the start times of two downtimes are equal and one is triggered but
-+ but the other is not, the triggered downtime should be later in the
-+ list than the untriggered one. This is so they are written to the
-+ retention.dat and status.dat in the correct order.
-+
-+ Previously the triggered downtime always appeared before its
-+ triggering downtime in those files. When the downtimes were read
-+ from those files, either on a core restart or by the CGIs, the
-+ triggered downtime would be discarded because the triggering
-+ downtime did not yet exist.
-+
-+ The most common case for this is when a downtime is created and
-+ the option is selected to create triggered downtimes on all child
-+ objects. This change in the sort order does NOT resolve the
-+ case where a manually created, triggered downtime is created with
-+ a start time earlier than the triggering downtime.
-+
-+ This would need to be resolved by comparing the triggered_by value
-+ with the downtime ID regardless of the start time. However, this
-+ should be a relatively rare case and only caused by intentional
-+ scheduling by a human. This change was not implemented because it
-+ would cause the downtime list to be out of time order and the
-+ implications of this were not well understood.
-+ */
-+
-+ if(d1->start_time == d2->start_time) {
-+ if(( d1->triggered_by == 0 && d2->triggered_by != 0) ||
-+ ( d1->triggered_by != 0 && d2->triggered_by == 0)) {
-+ return d1->triggered_by == 0 ? -1 : 1;
-+ }
-+ }
- return (d1->start_time < d2->start_time) ? -1 : (d1->start_time - d2->start_time);
- }
-