Module: check_mk
Branch: master
Commit: 88c69fddadc2a5eb87e03c8be4c30ee3e1dcbade
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=88c69fddadc2a5…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Thu Mar 7 15:40:54 2019 +0100
if.include: rigorously make if-scans mutually exclusive
7214 Interface checks: Introduce scan function API
In the past conflicting check plugins with services called "Interface <ITEM>"
could lead to a "duplicate services" warning on the discovery page.
To avoid this issue in the future, all scan functions for those plugins
are now located in the file "if.include".
If you add a new "Interface <ITEM>"- service, please add the corresponding
scan function to the file "if.include", and list in the dictionary
<tt>_SPECIFIC_IF_SCANS</tt>. You can then access the scan function by specifying
<tt> 'snmp_scan_function': get_snmp_if_scan_function('my_if_check')</tt>
in your check plugin.
The matching devices will then be automatically excluded from the generic if
and if64 check plugin.
7215 FIX Avoid duplicate services for if_fortigate check
This fixes the duplicate services warning displayed on the
discovery page for if/if_fortigate checks.
Services of the if checkplugin are no longer discovered if
the if_fortigate plugin already found interfaces.
Change-Id: Id6736a24fcce8f235354213bd3708527ea5b8779
---
.werks/7214 | 21 +++++++++++++++++++++
.werks/7215 | 14 ++++++++++++++
checks/if.include | 40 ++++++++++++++++++++--------------------
3 files changed, 55 insertions(+), 20 deletions(-)
diff --git a/.werks/7214 b/.werks/7214
new file mode 100644
index 0000000..640242e
--- /dev/null
+++ b/.werks/7214
@@ -0,0 +1,21 @@
+Title: Interface checks: Introduce scan function API
+Level: 1
+Component: checks
+Compatible: incomp
+Edition: cre
+Version: 1.6.0i1
+Date: 1552033415
+Class: feature
+
+In the past conflicting check plugins with services called "Interface <ITEM>"
+could lead to a "duplicate services" warning on the discovery page.
+
+To avoid this issue in the future, all scan functions for those plugins
+are now located in the file "if.include".
+If you add a new "Interface <ITEM>"- service, please add the corresponding
+scan function to the file "if.include", and list in the dictionary
+<tt>_SPECIFIC_IF_SCANS</tt>. You can then access the scan function by specifying
+<tt> 'snmp_scan_function': get_snmp_if_scan_function('my_if_check')</tt>
+in your check plugin.
+The matching devices will then be automatically excluded from the generic if
+and if64 check plugin.
diff --git a/.werks/7215 b/.werks/7215
new file mode 100644
index 0000000..38dc992
--- /dev/null
+++ b/.werks/7215
@@ -0,0 +1,14 @@
+Title: Avoid duplicate services for if_fortigate check
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1552034080
+Class: fix
+
+This fixes the duplicate services warning displayed on the
+discovery page for if/if_fortigate checks.
+
+Services of the if checkplugin are no longer discovered if
+the if_fortigate plugin already found interfaces.
diff --git a/checks/if.include b/checks/if.include
index 2bba1fc..1bebb26 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -126,24 +126,6 @@ def _snmp_scan_function_if_fortigate(oid):
return oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.12356")
-def _snmp_scan_function_if(oid):
- return if64_disabled(host_name()) or not has_ifHCInOctets(oid)
-
-
-def _if64_scan_function(oid, use_if64adm=False):
- if any((
- if64_disabled(host_name()),
- _snmp_scan_function_if_lancom(oid),
- _snmp_scan_function_if_brocade(oid),
- _snmp_scan_function_if_fortigate(oid),
- _snmp_scan_function_if64_tplink(oid),
- need_if64adm() != use_if64adm,
- )):
- return False
-
- return has_ifHCInOctets(oid)
-
-
_SPECIFIC_IF_SCANS = collections.OrderedDict({
'if_brocade': _snmp_scan_function_if_brocade,
'adva_fsp_if': _snmp_scan_function_adva_fsp_if,
@@ -156,17 +138,35 @@ _SPECIFIC_IF_SCANS = collections.OrderedDict({
})
+def is_specific(oid):
+ return any(scan(oid) for scan in _SPECIFIC_IF_SCANS.values())
+
+
def get_snmp_if_scan_function(plugin_name):
if plugin_name in _SPECIFIC_IF_SCANS:
return _SPECIFIC_IF_SCANS[plugin_name]
if plugin_name == 'if':
- return _snmp_scan_function_if
+
+ def wrapped_scan_function(oid):
+ if is_specific(oid):
+ return False
+ return if64_disabled(host_name()) or not has_ifHCInOctets(oid)
+
elif plugin_name == 'if64':
- return _if64_scan_function
+
+ def wrapped_scan_function(oid):
+ if if64_disabled(host_name()) or is_specific(oid):
+ return False
+ if need_if64adm():
+ return False
+ return has_ifHCInOctets(oid)
+
else:
raise NotImplementedError("unknown if plugin: %r" % plugin_name)
+ return wrapped_scan_function
+
def fix_if_64_highspeed(info):
for line in info:
Module: check_mk
Branch: master
Commit: 16b93365ba9f97daafe594704facc9cc906c55ef
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=16b93365ba9f97…
Author: Ronny Bruska <rb(a)mathias-kettner.de>
Date: Wed Mar 6 21:26:43 2019 +0100
7195 Jira: Notification plugin
Check_MK now supports integration with Jira.
You can create issues for Host an Service Problems and optional set a resolution on recovery notifications.
In Jira you have to add two custom fields to your project screen as described [https://confluence.atlassian.com/adminjiraserver/adding-a-custom-field-9388… here].
In Check_MK, under "WATO - Notifications", create a new notification rule and select Jira.
Parameters to set:
<i>JIRA URL<i>: The URL to your Jira environment
<i>User Name<i>: Jira username
<i>Password<i>: Jira password
<i>Project ID<i>: The Project ID the issues should be created in
<i>Issue type ID<i>: The issue type ID
<i>Host custom field ID<i>: The first custom field ID you created in Jira
<i>Service custom field ID<i>: The second custom field ID you created in Jira
<i>Monitoring URL<i>: URL of your Check_MK environment to create hyperlinks back to Check_MK (eg. https://server/site)
<i>Priority ID<i>: The priority ID (optional)
<i>Summary for host notifications<i>: The summary the created host issue should use (optional)
<i>Summary for service notifications<i>: The summary the created service issue shoud use (optional)
<i>Label<i>: Label for Jira issues. If not set, 'monitoring' will be used. (optional)
<i>Activate resultion with following resolution transistion ID<i>: If set, the created issue will be resolved with the configured resolution ID (optional)
<i>Set optional timeout for connections to JIRA<i>: Timeout in seconds, default is 10 (optional)
You need different Jira IDs to open/resolve issues. There are different ways to get this IDs:
LI: [https://confluence.atlassian.com/jirakb/how-to-get-project-id-from-the-jira… Jira_support]
LI: Retrieve with the a script (example: project_id):
F+:#!/usr/bin/env python
F+:
F+:import requests
F+:
F+:USER = "JIRA_USERNAME"
F+:PW = "JIRA_PASSWORD"
F+:PROJECT_KEY = "JIRA_PROJECT_NAME"
F+:JIRA_SERVER = "https://jira.server.your-domain.de"
F+:
F+:sess = requests.Session()
F+:sess.auth = (USER, PW)
F+:resp = sess.get("%s/rest/api/2/project" % JIRA_SERVER, verify=False)
F+:
F+:project_id = [item["id"] for item in resp.json() if item["key"] == PROJECT_KEY][0]
F+:print(project_id)
For issuetype and priority ID use:
F+:resp = sess.get("%s/rest/api/2/issuetype" % JIRA_SERVER)
F+:resp = sess.get("%s/rest/api/2/priority" % JIRA_SERVER)
More information about the Jira API can be found [https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0 here].
CMK-1185
Change-Id: I26d7fd808e1d3c3665b82741a756e806b0a0489d
---
.werks/7195 | 59 ++++++++
cmk/gui/plugins/wato/notifications.py | 126 +++++++++++++++++
cmk/notification_plugins/jira_issues.py | 155 +++++++++++++++++++++
notifications/jira_issues | 9 ++
tests/unit/cmk/gui/test_gui_config.py | 1 +
.../cmk/gui/wato/test_notification_parameters.py | 1 +
6 files changed, 351 insertions(+)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=16b93365ba…
Module: check_mk
Branch: master
Commit: 52276803ae44f7c7b903bd28df24dffab05a95c1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=52276803ae44f7…
Author: Ronny Bruska <rb(a)mathias-kettner.de>
Date: Fri Mar 8 09:27:19 2019 +0100
7198 FIX Solaris Agent: fixed wrong path for top command
The agent tried to use /usr/local/top instead of /usr/local/bin/top.
This has been fixed.
Change-Id: I9ae909a9efefc4feec1d755258242323579ffc84
---
.werks/7198 | 12 ++++++++++++
agents/check_mk_agent.solaris | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/7198 b/.werks/7198
new file mode 100644
index 0000000..03d2e40
--- /dev/null
+++ b/.werks/7198
@@ -0,0 +1,12 @@
+Title: Solaris Agent: fixed wrong path for top command
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1552033417
+Class: fix
+
+The agent tried to use /usr/local/top instead of /usr/local/bin/top.
+This has been fixed.
+
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 38dfa3d..e9ce799 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -320,11 +320,11 @@ fi
# <<<solaris_mem>>> should be used if statgrab is missing and top is available.
if ! type statgrab &>/dev/null;
then
- if [ -x /usr/bin/top ] || [ -x /usr/local/top ]
+ if [ -x /usr/bin/top ] || [ -x /usr/local/bin/top ]
then
echo "<<<solaris_mem>>>"
if [ -x /usr/bin/top ]; then /usr/bin/top | grep '^Memory:'; fi
- if [ -x /usr/local/bin/top ]; then /usr/bin/top | grep '^Memory:'; fi
+ if [ -x /usr/local/bin/top ]; then /usr/local/bin/top | grep '^Memory:'; fi
fi
fi
Module: check_mk
Branch: master
Commit: a58db71ba9826a15af782869af9009e565f8f581
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a58db71ba9826a…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Thu Mar 7 18:26:48 2019 +0100
7065 FIX k8s_stats: fix crashes regarding timestamp parsing
The Kubernetes API provides timestamps for the k8s_stats checks
in the RFC3339Nano format with different timezones and a varying
number of trailing zeros in the seconds field. This lead to
a crash of the k8s_stats.network check. To resolve this issues
the timestamps are now converted to unix timestamps in the
special agent.
Change-Id: I2869540e2b6b73b0071379c307b4e2615f6235f4
---
.werks/7065 | 15 ++++++++
checks/k8s_stats | 7 +---
cmk/special_agents/agent_kubernetes.py | 11 +++++-
.../unit/checks/generictests/datasets/k8s_stats.py | 2 +-
.../special_agents/test_agent_kubernetes_nodes.py | 43 ++++++++++++++++++++++
5 files changed, 70 insertions(+), 8 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=a58db71ba9…
Module: check_mk
Branch: master
Commit: 9263e2567b50968643dffe07fb754824d0e46399
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9263e2567b5096…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Fri Mar 8 08:08:14 2019 +0100
mk_filestats.py: fix typo in doc
Change-Id: I03fe60203e48bbaa331f5277db9b7defb49d8e6c
---
agents/plugins/mk_filestats.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agents/plugins/mk_filestats.py b/agents/plugins/mk_filestats.py
index c85a56b..be07131 100755
--- a/agents/plugins/mk_filestats.py
+++ b/agents/plugins/mk_filestats.py
@@ -96,7 +96,7 @@ described by the following four phases:
checks only require this information, we can signifficantly reduce data.
You should find an example configuration file at
-'../cfg_examples/mk_filestats.cfg' relative to this file.
+'../cfg_examples/filestats.cfg' relative to this file.
"""
import re
import os