2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # .------------------------------------------------------------------------.
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
11 # | | ____|_ __ | |_ ___ _ __ _ __ _ __(_)___ ___ |
12 # | | _| | '_ \| __/ _ \ '__| '_ \| '__| / __|/ _ \ |
13 # | | |___| | | | || __/ | | |_) | | | \__ \ __/ |
14 # | |_____|_| |_|\__\___|_| | .__/|_| |_|___/\___| |
17 # | | ____|__| (_) |_(_) ___ _ __ |
18 # | | _| / _` | | __| |/ _ \| '_ \ |
19 # | | |__| (_| | | |_| | (_) | | | | |
20 # | |_____\__,_|_|\__|_|\___/|_| |_| |
22 # | mathias-kettner.com mathias-kettner.de |
23 # '------------------------------------------------------------------------'
24 # This file is part of the Check_MK Enterprise Edition (CEE).
25 # Copyright by Mathias Kettner and Mathias Kettner GmbH. All rights reserved.
27 # Distributed under the Check_MK Enterprise License.
29 # You should have received a copy of the Check_MK Enterprise License
30 # along with Check_MK. If not, email to mk@mathias-kettner.de
31 # or write to the postal address provided at www.mathias-kettner.de
36 def section_name_of(check_plugin_name
):
37 return check_plugin_name
.split(".")[0]
40 def is_snmp_check(check_plugin_name
):
41 cache
= cmk_base
.runtime_cache
.get_dict("is_snmp_check")
43 return cache
[check_plugin_name
]
45 snmp_checks
= cmk_base
.runtime_cache
.get_set("check_type_snmp")
46 result
= section_name_of(check_plugin_name
) in snmp_checks
47 cache
[check_plugin_name
] = result
51 def is_tcp_check(check_plugin_name
):
52 cache
= cmk_base
.runtime_cache
.get_dict("is_tcp_check")
54 return cache
[check_plugin_name
]
56 tcp_checks
= cmk_base
.runtime_cache
.get_set("check_type_tcp")
57 result
= section_name_of(check_plugin_name
) in tcp_checks
58 cache
[check_plugin_name
] = result