2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
31 import cmk
.utils
.paths
33 import cmk
.gui
.sites
as sites
34 import cmk
.gui
.config
as config
35 import cmk
.gui
.watolib
as watolib
36 import cmk
.gui
.userdb
as userdb
37 import cmk
.gui
.utils
as utils
38 from cmk
.gui
.exceptions
import MKUserError
39 from cmk
.gui
.i18n
import _
41 from cmk
.gui
.valuespec
import (
70 from cmk
.gui
.plugins
.wato
import (
71 config_variable_group_registry
,
73 config_variable_registry
,
77 ConfigDomainCACertificates
,
79 rulespec_group_registry
,
88 ServiceDescriptionTranslation
,
95 from cmk
.gui
.plugins
.wato
.omd_configuration
import ConfigVariableGroupSiteManagement
96 from cmk
.gui
.plugins
.views
.icons
import icon_and_action_registry
97 from cmk
.gui
.watolib
.bulk_discovery
import vs_bulk_discovery
99 # .--Global Settings-----------------------------------------------------.
100 # | ____ _ _ _ ____ _ _ _ |
101 # | / ___| | ___ | |__ __ _| | / ___| ___| |_| |_(_)_ __ __ _ ___ |
102 # || | _| |/ _ \| '_ \ / _` | | \___ \ / _ \ __| __| | '_ \ / _` / __| |
103 # || |_| | | (_) | |_) | (_| | | ___) | __/ |_| |_| | | | | (_| \__ \ |
104 # | \____|_|\___/|_.__/ \__,_|_| |____/ \___|\__|\__|_|_| |_|\__, |___/ |
106 # +----------------------------------------------------------------------+
107 # | Global configuration settings for main.mk and multisite.mk |
108 # '----------------------------------------------------------------------'
111 @config_variable_group_registry.register
112 class ConfigVariableGroupUserInterface(ConfigVariableGroup
):
114 return _("User Interface")
116 def sort_index(self
):
120 @config_variable_registry.register
121 class ConfigVariableUITheme(ConfigVariable
):
123 return ConfigVariableGroupUserInterface
126 return ConfigDomainGUI
132 return DropdownChoice(
133 title
=_("User interface theme"),
134 help=_("Change the default user interface theme of your Check_MK installation"),
135 choices
=config
.theme_choices(),
139 @config_variable_registry.register
140 class ConfigVariableBulkDiscoveryDefaultSettings(ConfigVariable
):
142 return ConfigVariableGroupUserInterface
145 return ConfigDomainGUI
148 return "bulk_discovery_default_settings"
151 return vs_bulk_discovery()
154 @config_variable_registry.register
155 class ConfigVariableLogLevels(ConfigVariable
):
157 return ConfigVariableGroupUserInterface
160 return ConfigDomainGUI
168 help=_("This setting decides which types of messages to log into "
169 "the web log <tt>%s</tt>.") %
170 site_neutral_path(cmk
.utils
.paths
.log_dir
+ "/web.log"),
171 elements
=self
._web
_log
_level
_elements
(),
175 def _web_log_level_elements(self
):
177 for level_id
, title
, help_text
in [
178 ("cmk.web", _("Web"),
179 _("The log level for all log entries not assigned to the other "
180 "log categories on this page.")),
181 ("cmk.web.auth", _("Authentication"),
182 _("The log level for user authentication related log entries.")),
183 ("cmk.web.ldap", _("LDAP"), _("The log level for LDAP related log entries.")),
184 ("cmk.web.bi.compilation", _("BI compilation"),
185 _("If this option is enabled, Check_MK BI will create a log with details "
186 "about compiling BI aggregations. This includes statistics and "
187 "details for each executed compilation.")),
188 ("cmk.web.automations", _("Automation calls"),
189 _("Communication between different components of Check_MK (e.g. GUI and check engine) "
190 "will be logged in this log level."))
192 elements
.append((level_id
,
196 default_value
=logging
.WARNING
,
202 @config_variable_registry.register
203 class ConfigVariableDebug(ConfigVariable
):
205 return ConfigVariableGroupUserInterface
208 return ConfigDomainGUI
215 title
=_("Debug mode"),
216 label
=_("enable debug mode"),
217 help=_("When Multisite is running in debug mode, internal Python error messages "
218 "are being displayed and various debug information in other places is "
223 @config_variable_registry.register
224 class ConfigVariableGUIProfile(ConfigVariable
):
226 return ConfigVariableGroupUserInterface
229 return ConfigDomainGUI
235 return DropdownChoice(
236 title
=_("Profile requests"),
237 help=_("It is possible to profile the rendering process of Multisite pages. This "
238 "Is done using the Python module cProfile. When profiling is performed "
239 "two files are created <tt>%s</tt> and <tt>%s</tt>. By executing the later "
240 "file you can get runtime statistics about the last processed page. When "
241 "enabled by request the profiling mode is enabled by providing the HTTP "
242 "variable <tt>_profile</tt>.") %
243 (site_neutral_path(cmk
.utils
.paths
.var_dir
+ "/multisite.profile"),
244 site_neutral_path(cmk
.utils
.paths
.var_dir
+ "/multisite.profile.py")),
246 (False, _("Disable profiling")),
247 ("enable_by_var", _("Enable profiling by request")),
248 (True, _("Enable profiling for all requests")),
253 @config_variable_registry.register
254 class ConfigVariableDebugLivestatusQueries(ConfigVariable
):
256 return ConfigVariableGroupUserInterface
259 return ConfigDomainGUI
262 return "debug_livestatus_queries"
266 title
=_("Debug Livestatus queries"),
267 label
=_("enable debug of Livestatus queries"),
268 help=_("With this option turned on all Livestatus queries made by Multisite "
269 "in order to render views are being displayed."),
273 @config_variable_registry.register
274 class ConfigVariableSelectionLivetime(ConfigVariable
):
276 return ConfigVariableGroupUserInterface
279 return ConfigDomainGUI
282 return "selection_livetime"
286 title
=_('Checkbox Selection Livetime'),
288 _('This option defines the maximum age of unmodified checkbox selections stored for users. '
289 'If a user modifies the selection in a view, these selections are persisted for the currently '
290 'open view. When a view is re-opened a new selection is used. The old one remains on the '
291 'server until the livetime is exceeded.'),
296 @config_variable_registry.register
297 class ConfigVariableShowLivestatusErrors(ConfigVariable
):
299 return ConfigVariableGroupUserInterface
302 return ConfigDomainGUI
305 return "show_livestatus_errors"
309 title
=_("Show MK Livestatus error messages"),
310 label
=_("show errors"),
312 _("This option controls whether error messages from unreachable sites are shown in the output of "
313 "views. Those error messages shall alert you that not all data from all sites has been shown. "
314 "Other people - however - find those messages distracting. "),
318 @config_variable_registry.register
319 class ConfigVariableEnableSounds(ConfigVariable
):
321 return ConfigVariableGroupUserInterface
324 return ConfigDomainGUI
327 return "enable_sounds"
331 title
=_("Enable sounds in views"),
332 label
=_("enable sounds"),
333 help=_("If sounds are enabled then the user will be alarmed by problems shown "
334 "in a Multisite status view if that view has been configured for sounds. "
335 "From the views shipped in with Multisite all problem views have sounds "
340 @config_variable_registry.register
341 class ConfigVariableContextButtonsToShow(ConfigVariable
):
343 return ConfigVariableGroupUserInterface
346 return ConfigDomainGUI
349 return "context_buttons_to_show"
360 title
=_("Number of context buttons to show"),
361 label
=_("Show only most frequently used buttons"),
362 help=_("If this option is enabled, then Multisite only show the most "
363 "used context buttons and hides the rest. Which buttons are used "
364 "how often is computed separately per user."),
368 @config_variable_registry.register
369 class ConfigVariableSoftQueryLimit(ConfigVariable
):
371 return ConfigVariableGroupUserInterface
374 return ConfigDomainGUI
377 return "soft_query_limit"
381 title
=_("Soft query limit"),
382 help=_("Whenever the number of returned datasets of a view would exceed this "
383 "limit, a warning is being displayed and no further data is being shown. "
384 "A normal user can override this limit with one mouse click."),
389 @config_variable_registry.register
390 class ConfigVariableHardQueryLimit(ConfigVariable
):
392 return ConfigVariableGroupUserInterface
395 return ConfigDomainGUI
398 return "hard_query_limit"
402 title
=_("Hard query limit"),
403 help=_("Whenever the number of returned datasets of a view would exceed this "
404 "limit, an error message is shown. The normal user cannot override "
405 "the hard limit. The purpose of the hard limit is to secure the server "
406 "against useless queries with huge result sets."),
411 @config_variable_registry.register
412 class ConfigVariableQuicksearchDropdownLimit(ConfigVariable
):
414 return ConfigVariableGroupUserInterface
417 return ConfigDomainGUI
420 return "quicksearch_dropdown_limit"
424 title
=_("Number of elements to show in Quicksearch"),
425 help=_("When typing a texts in the Quicksearch snapin, a dropdown will "
426 "appear listing all matching host names containing that text. "
427 "That list is limited in size so that the dropdown will not get "
428 "too large when you have a huge number of lists. "),
433 @config_variable_registry.register
434 class ConfigVariableQuicksearchSearchOrder(ConfigVariable
):
436 return ConfigVariableGroupUserInterface
439 return ConfigDomainGUI
442 return "quicksearch_search_order"
449 title
=_("Search filter"),
451 ("h", _("Hostname")),
452 ("al", _("Hostalias")),
453 ("ad", _("Hostaddress")),
454 ("tg", _("Hosttag")),
455 ("hg", _("Hostgroup")),
456 ("sg", _("Servicegroup")),
457 ("s", _("Service Description")),
461 title
=_("Match behaviour"),
463 ("continue", _("Continue search")),
465 _("Search finished: Also show all results of previous filters")),
466 ("finished_distinct",
467 _("Search finished: Only show results of this filter")),
471 title
=_("Quicksearch search order"),
472 add_label
=_("Add search filter"),
476 @config_variable_registry.register
477 class ConfigVariableTableRowLimit(ConfigVariable
):
479 return ConfigVariableGroupUserInterface
482 return ConfigDomainGUI
485 return "table_row_limit"
489 title
=_("Limit the number of rows shown in tables"),
490 help=_("Several pages which use tables to show data in rows, like the "
491 "\"Users\" configuration page, can be configured to show "
492 "only a limited number of rows when accessing the pages."),
498 @config_variable_registry.register
499 class ConfigVariableStartURL(ConfigVariable
):
501 return ConfigVariableGroupUserInterface
504 return ConfigDomainGUI
511 title
=_("Start URL to display in main frame"),
512 help=_("When you point your browser to the Check_MK GUI, usually the dashboard "
513 "is shown in the main (right) frame. You can replace this with any other "
514 "URL you like here."),
517 validate
=utils
.validate_start_url
,
521 @config_variable_registry.register
522 class ConfigVariablePageHeading(ConfigVariable
):
524 return ConfigVariableGroupUserInterface
527 return ConfigDomainGUI
530 return "page_heading"
534 title
=_("Page title"),
535 help=_("This title will be displayed in your browser's title bar or tab. You can use "
536 "a <tt>%s</tt> to insert the alias of your monitoring site to the title."),
541 @config_variable_registry.register
542 class ConfigVariablePagetitleDateFormat(ConfigVariable
):
544 return ConfigVariableGroupUserInterface
547 return ConfigDomainGUI
550 return "pagetitle_date_format"
553 return DropdownChoice(
554 title
=_("Date format for page titles"),
555 help=_("When enabled, the headline of each page also displays "
556 "the date in addition the time."),
558 (None, _("Do not display a date")),
559 ('yyyy-mm-dd', _("YYYY-MM-DD")),
560 ('dd.mm.yyyy', _("DD.MM.YYYY")),
565 @config_variable_registry.register
566 class ConfigVariableEscapePluginOutput(ConfigVariable
):
568 return ConfigVariableGroupUserInterface
571 return ConfigDomainGUI
574 return "escape_plugin_output"
578 title
=_("Escape HTML codes in plugin output"),
579 help=_("By default, for security reasons, the GUI does not interpret any HTML "
580 "code received from external sources, like plugin output or log messages. "
581 "If you are really sure what you are doing and need to have HTML codes, like "
582 "links rendered, disable this option. Be aware, you might open the way "
583 "for several injection attacks.") + _(
584 "This setting can either be set globally or individually for selected hosts "
585 "or services using the host or service rulesets."),
586 label
=_("Prevent loading HTML from plugin output or log messages"),
590 @config_variable_registry.register
591 class ConfigVariableCrashReportTarget(ConfigVariable
):
593 return ConfigVariableGroupUserInterface
596 return ConfigDomainGUI
599 return "crash_report_target"
603 title
=_("Fallback mail address for crash reports"),
604 help=_("By default crash reports will be sent to our crash reporting server. In case "
605 "this fails for some reason, the crash reports can be sent by mail to the "
606 "address configured here."),
612 @config_variable_registry.register
613 class ConfigVariableDrawRuleIcon(ConfigVariable
):
615 return ConfigVariableGroupUserInterface
618 return ConfigDomainGUI
621 return "multisite_draw_ruleicon"
625 title
=_("Show icon linking to WATO parameter editor for services"),
626 label
=_("Show WATO icon"),
627 help=_("When enabled a rule editor icon is displayed for each "
628 "service in the multisite views. It is only displayed if the user "
629 "does have the permission to edit rules."),
633 def transform_virtual_host_trees(trees
):
634 def id_from_title(title
):
635 return re
.sub("[^-a-zA-Z0-9_]+", "", title
.lower())
637 for index
, tree
in enumerate(trees
):
638 if isinstance(tree
, tuple):
640 "id": id_from_title(tree
[0]),
642 "tree_spec": tree
[1],
645 # Transform existing dicts with old key "tag_groups"
646 if "tag_groups" in tree
:
647 tree
["tree_spec"] = tree
.pop("tag_groups")
649 return sorted(trees
, key
=lambda x
: x
["title"])
652 @config_variable_registry.register
653 class ConfigVariableVirtualHostTrees(ConfigVariable
):
655 return ConfigVariableGroupUserInterface
658 return ConfigDomainGUI
661 return "virtual_host_trees"
672 ("title", TextUnicode(
673 title
=_("Title of the tree"),
676 ("exclude_empty_tag_choices",
678 title
=_("Exclude empty tag choices"),
683 DropdownChoice(choices
=self
._virtual
_host
_tree
_choices
,),
684 title
=_("Tree levels"),
691 add_label
=_("Create new virtual host tree configuration"),
692 title
=_("Virtual Host Trees"),
694 _("Here you can define tree configurations for the snapin <i>Virtual Host-Trees</i>. "
695 "These trees organize your hosts based on their values in certain host tag groups. "
696 "Each host tag group you select will create one level in the tree."),
697 validate
=self
._validate
_virtual
_host
_trees
,
700 forth
=transform_virtual_host_trees
,
703 def _virtual_host_tree_choices(self
):
704 return self
._wato
_host
_tag
_group
_choices
() + [("foldertree:", _("WATO folder tree"))] + [
705 ("folder:%d" % l
, _("WATO folder level %d") % l
) for l
in range(1, 7)
708 def _wato_host_tag_group_choices(self
):
709 # We add to the choices:
710 # 1. All host tag groups with their id
711 # 2. All *topics* that:
712 # - consist only of checkbox tags
713 # - contain at least two entries
716 for entry
in config
.host_tag_groups():
718 topic
, tit
= watolib
.parse_hosttag_title(entry
[1])
719 choices
.append((tgid
, tit
))
720 by_topic
.setdefault(topic
, []).append(entry
)
722 # Now search for checkbox-only-topics
723 for topic
, entries
in by_topic
.items():
724 for entry
in entries
:
725 tgid
, _title
, tags
= entry
[:3]
732 _("Topic") + ": " + topic
,
737 def _validate_virtual_host_trees(self
, value
, varprefix
):
740 if tree
["id"] in tree_ids
:
741 raise MKUserError(varprefix
, _("The ID needs to be unique."))
742 tree_ids
.add(tree
["id"])
744 # Validate that each element is selected once
746 for element
in tree
["tree_spec"]:
750 _("Found '%s' a second time in tree '%s'. Each element can only be "
751 "choosen once.") % (element
, tree
["id"]))
756 @config_variable_registry.register
757 class ConfigVariableRescheduleTimeout(ConfigVariable
):
759 return ConfigVariableGroupUserInterface
762 return ConfigDomainGUI
765 return "reschedule_timeout"
769 title
=_("Timeout for rescheduling checks in Multisite"),
770 help=_("When you reschedule a check by clicking on the "arrow"-icon "
771 "then Multisite will use this number of seconds as a timeout. If the "
772 "monitoring core has not executed the check within this time, an error "
773 "will be displayed and the page not reloaded."),
776 display_format
="%.1f",
780 @config_variable_registry.register
781 class ConfigVariableSidebarShowVersionInSidebar(ConfigVariable
):
783 return ConfigVariableGroupUserInterface
786 return ConfigDomainGUI
789 return "sidebar_show_version_in_sidebar"
793 title
=_("Show Check_MK edition & version in sidebar"),
794 label
=_("Show the edition ad version"),
795 help=_("Use this option to hide the Check_MK edition and version information from "
796 "the header of the sidebar."),
800 @config_variable_registry.register
801 class ConfigVariableSidebarUpdateInterval(ConfigVariable
):
803 return ConfigVariableGroupUserInterface
806 return ConfigDomainGUI
809 return "sidebar_update_interval"
813 title
=_("Interval of sidebar status updates"),
814 help=_("The information provided by the sidebar snapins is refreshed in a regular "
815 "interval. You can change the refresh interval to fit your needs here. This "
816 "value means that all snapnis which request a regular refresh are updated "
817 "in this interval."),
820 display_format
="%.1f",
824 @config_variable_registry.register
825 class ConfigVariableSidebarNotifyInterval(ConfigVariable
):
827 return ConfigVariableGroupUserInterface
830 return ConfigDomainGUI
833 return "sidebar_notify_interval"
840 display_format
="%.1f",
842 title
=_("Interval of sidebar popup notification updates"),
844 "The sidebar can be configured to regularly check for pending popup notififcations. "
845 "This is disabled by default."),
846 none_label
=_('(disabled)'),
850 @config_variable_registry.register
851 class ConfigVariableiAdHocDowntime(ConfigVariable
):
853 return ConfigVariableGroupUserInterface
856 return ConfigDomainGUI
859 return "adhoc_downtime"
869 help=_("The duration in minutes of the adhoc downtime."),
876 title
=_("Adhoc comment"),
877 help=_("The comment which is automatically sent with an adhoc downtime"),
884 title
=_("Adhoc downtime"),
885 label
=_("Enable adhoc downtime"),
886 help=_("This setting allows to set an adhoc downtime comment and its duration. "
887 "When enabled a new button <i>Adhoc downtime for __ minutes</i> will "
888 "be available in the command form."),
892 @config_variable_registry.register
893 class ConfigVariableAuthByHTTPHeader(ConfigVariable
):
895 return ConfigVariableGroupUserInterface
898 return ConfigDomainGUI
901 return "auth_by_http_header"
906 label
=_("HTTP Header Variable"),
907 help=_("Configure the name of the environment variable to read "
908 "from the incoming HTTP requests"),
909 default_value
='REMOTE_USER',
912 title
=_("Authenticate users by incoming HTTP requests"),
913 label
=_("Activate HTTP header authentication (Warning: Only activate "
914 "in trusted environments, see help for details)"),
915 help=_("If this option is enabled, multisite reads the configured HTTP header "
916 "variable from the incoming HTTP request and simply takes the string "
917 "in this variable as name of the authenticated user. "
918 "Be warned: Only allow access from trusted ip addresses "
919 "(Apache <tt>Allow from</tt>), like proxy "
920 "servers, to this webpage. A user with access to this page could simply fake "
921 "the authentication information. This option can be useful to "
922 " realize authentication in reverse proxy environments."),
924 none_label
=_("Don't use HTTP header authentication"),
929 @config_variable_registry.register
930 class ConfigVariableStalenessThreshold(ConfigVariable
):
932 return ConfigVariableGroupUserInterface
935 return ConfigDomainGUI
938 return "staleness_threshold"
942 title
=_('Staleness value to mark hosts / services stale'),
944 'The staleness value of a host / service is calculated by measuring the '
945 'configured check intervals a check result is old. A value of 1.5 means the '
946 'current check result has been gathered one and a half check intervals of an object. '
947 'This would mean 90 seconds in case of a check which is checked each 60 seconds.'),
952 @config_variable_registry.register
953 class ConfigVariableLoginScreen(ConfigVariable
):
955 return ConfigVariableGroupUserInterface
958 return ConfigDomainGUI
961 return "login_screen"
965 title
=_("Customize login screen"),
970 title
=_("Hide Check_MK version"),
971 totext
=_("Hide the Check_MK version from the login box"),
975 title
=_("Show a login message"),
977 _("You may use this option to give your users an informational text before logging in."
985 TextUnicode(title
=_("Title"),),
993 ("_blank", _("Load in a new window / tab")),
994 ("_top", _("Load in current window / tab")),
998 orientation
="horizontal",
1000 totext
=_("%d links"),
1001 title
=_("Custom footer links"),
1008 @config_variable_registry.register
1009 class ConfigVariableUserLocalizations(ConfigVariable
):
1011 return ConfigVariableGroupUserInterface
1014 return ConfigDomainGUI
1017 return "user_localizations"
1019 def valuespec(self
):
1024 TextUnicode(title
=_("Original Text"), size
=40),
1026 title
=_("Translations"),
1027 elements
=lambda: [(l
or "en", TextUnicode(title
=a
, size
=32))
1028 for (l
, a
) in cmk
.gui
.i18n
.get_languages()],
1032 title
=_("Custom localizations"),
1034 totext
=_("%d translations"),
1036 forth
=lambda d
: sorted(d
.items()),
1041 @config_variable_registry.register
1042 class ConfigVariableUserIconsAndActions(ConfigVariable
):
1044 return ConfigVariableGroupUserInterface
1047 return ConfigDomainGUI
1050 return "user_icons_and_actions"
1052 def valuespec(self
):
1060 ('icon', IconSelector(
1064 ('title', TextUnicode(title
=_('Title'),)),
1073 _('This URL is opened when clicking on the action / icon. You '
1074 'can use some macros within the URL which are dynamically '
1075 'replaced for each object. These are:<br>'
1077 '<li>$HOSTNAME$: Contains the name of the host</li>'
1078 '<li>$HOSTNAME_URL_ENCODED$: Same as above but URL encoded</li>'
1079 '<li>$SERVICEDESC$: Contains the service description '
1080 '(in case this is a service)</li>'
1081 '<li>$SERVICEDESC_URL_ENCODED$: Same as above but URL encoded</li>'
1082 '<li>$HOSTADDRESS$: Contains the network address of the host</li>'
1083 '<li>$HOSTADDRESS_URL_ENCODED$: Same as above but URL encoded</li>'
1084 '<li>$USER_ID$: The user ID of the currently active user</li>'
1091 ("_blank", _("Load in a new window / tab")),
1093 _("Load in current content area (keep sidebar)"
1095 ("_top", _("Load as new page (hide sidebar)")),
1100 forth
=lambda x
: not isinstance(x
, tuple) and (x
, "_self") or x
,
1105 title
=_('Show in column'),
1106 totext
=_('Directly show the action icon in the column'),
1107 help=_('Makes the icon appear in the column instead '
1108 'of the dropdown menu.'),
1112 title
=_('Sort index'),
1114 _('You can use the sort index to control the order of the '
1115 'elements in the column and the menu. The elements are sorted '
1116 'from smaller to higher numbers. The action menu icon '
1117 'has a sort index of <tt>10</tt>, the graph icon a sort index '
1118 'of <tt>20</tt>. All other default icons have a sort index of '
1119 '<tt>30</tt> configured.'),
1124 optional_keys
=['title', 'url', 'toplevel', 'sort_index'],
1127 title
=_("Custom icons and actions"),
1129 totext
=_("%d icons and actions"),
1131 forth
=lambda d
: sorted(d
.items()),
1136 @config_variable_registry.register
1137 class ConfigVariableUserDowntimeTimeranges(ConfigVariable
):
1139 return ConfigVariableGroupUserInterface
1142 return ConfigDomainGUI
1145 return "user_downtime_timeranges"
1147 def valuespec(self
):
1150 elements
=[('title', TextUnicode(title
=_('Title'),)),
1156 title
=_("Duration"),
1157 display
=["minutes", "hours", "days"],
1162 ('next_day', _("Start of next day")),
1163 ('next_week', _("Start of next week")),
1164 ('next_month', _("Start of next month")),
1165 ('next_year', _("Start of next year")),
1167 default_value
="next_day",
1171 default_value
=24 * 60 * 60,
1175 title
=_("Custom Downtime Timeranges"),
1177 totext
=_("%d timeranges"),
1181 @config_variable_registry.register
1182 class ConfigVariableBuiltinIconVisibility(ConfigVariable
):
1184 return ConfigVariableGroupUserInterface
1187 return ConfigDomainGUI
1190 return "builtin_icon_visibility"
1192 def valuespec(self
):
1199 choices
=self
._get
_builtin
_icons
,
1206 title
=_('Show in column'),
1207 label
=_('Directly show the action icon in the column'),
1208 help=_('Makes the icon appear in the column instead '
1209 'of the dropdown menu.'),
1214 title
=_('Sort index'),
1216 _('You can use the sort index to control the order of the '
1217 'elements in the column and the menu. The elements are sorted '
1218 'from smaller to higher numbers. The action menu icon '
1219 'has a sort index of <tt>10</tt>, the graph icon a sort index '
1220 'of <tt>20</tt>. All other default icons have a sort index of '
1221 '<tt>30</tt> configured.'),
1225 optional_keys
=['toplevel', 'sort_index'],
1228 title
=_("Builtin icon visibility"),
1230 totext
=_("%d icons customized"),
1231 help=_("You can use this option to change the default visibility "
1232 "options of the builtin icons. You can change whether or not "
1233 "the icons are shown in the popup menu or on top level and "
1234 "change the sorting of the icons."),
1236 forth
=lambda d
: sorted(d
.items()),
1240 def _get_builtin_icons(self
):
1241 return [(id_
, id_
) for id_
in icon_and_action_registry
.keys()]
1244 @config_variable_registry.register
1245 class ConfigVariableServiceViewGrouping(ConfigVariable
):
1247 return ConfigVariableGroupUserInterface
1250 return ConfigDomainGUI
1253 return "service_view_grouping"
1255 def valuespec(self
):
1259 ('title', TextUnicode(title
=_('Title to show for the group'),)),
1262 title
=_('Grouping expression'),
1263 help=_('This regular expression is used to match the services to be put '
1264 'into this group. This is a prefix match regular expression.'),
1265 mode
=RegExpUnicode
.prefix
,
1269 title
=_('Minimum number of items to create a group'),
1270 help=_('When less than these items are found for a group, the services '
1271 'are not shown grouped together.'),
1278 title
=_("Grouping of services in table views"),
1280 "You can use this option to make the service table views fold services matching "
1281 "the given patterns into groups. Only services in state <i>OK</i> will be folded "
1282 "together. Groups of only one service will not be rendered. If multiple patterns "
1283 "match a service, the service will be added to the first matching group."),
1284 add_label
=_("Add new grouping definition"),
1288 @config_variable_registry.register
1289 class ConfigVariableTopologyDefaultFilterGroup(ConfigVariable
):
1291 return ConfigVariableGroupUserInterface
1294 return ConfigDomainGUI
1297 return "topology_default_filter_group"
1299 def valuespec(self
):
1302 choices
=lambda: sites
.all_groups("host"),
1305 title
=_("Network Topology: Default Filter Group"),
1307 "By default the network topology view shows you the parent / child relations "
1308 "of all hosts within your local site. The list can be filtered based on hostgroup "
1309 "memberships by the users. You can define a default group to use for filtering "
1310 "which is used when a user opens the network topology view."),
1311 none_label
=_("Show all hosts when opening the network topology view"),
1315 @config_variable_registry.register
1316 class ConfigVariableViewActionDefaults(ConfigVariable
):
1318 return ConfigVariableGroupUserInterface
1321 return ConfigDomainGUI
1324 return "view_action_defaults"
1326 def valuespec(self
):
1328 title
=_("View action defaults"),
1330 ("ack_sticky", Checkbox(
1337 title
=_("Send notification"),
1343 title
=_("Persistent comment"),
1345 default_value
=False,
1349 title
=_("Expire acknowledgement after"),
1350 display
=["days", "hours", "minutes"],
1358 @config_variable_registry.register
1359 class ConfigVariableTrustedCertificateAuthorities(ConfigVariable
):
1361 return ConfigVariableGroupSiteManagement
1364 return ConfigDomainCACertificates
1367 return "trusted_certificate_authorities"
1369 def valuespec(self
):
1371 title
=_("Trusted certificate authorities for SSL"),
1372 help=_("Whenever a server component of Check_MK opens a SSL connection it uses the "
1373 "certificate authorities configured here for verifying the SSL certificate of "
1374 "the destination server. This is used for example when performing WATO "
1375 "replication to slave sites or when special agents are communicating via HTTPS. "
1376 "The CA certificates configured here will be written to the CA bundle %s.") %
1377 site_neutral_path(ConfigDomainCACertificates
.trusted_cas_file
),
1379 ("use_system_wide_cas",
1381 title
=_("Use system wide CAs"),
1382 help=_("All supported linux distributions provide a mechanism of managing "
1383 "trusted CAs. Depending on your linux distributions the paths where "
1384 "these CAs are stored and the commands to manage the CAs differ. "
1385 "Please checko out the documentation of your linux distribution "
1386 "in case you want to customize trusted CAs system wide. You can "
1387 "choose here to trust the system wide CAs here. Check_MK will search "
1388 "these directories for system wide CAs: %s") % ", ".join(
1389 ConfigDomainCACertificates
.system_wide_trusted_ca_search_paths
),
1390 label
=_("Trust system wide configured CAs"),
1392 ("trusted_cas", ListOfCAs(
1393 title
=_("Check_MK specific"),
1397 optional_keys
=False,
1402 # .--WATO----------------------------------------------------------------.
1403 # | __ ___ _____ ___ |
1404 # | \ \ / / \|_ _/ _ \ |
1405 # | \ \ /\ / / _ \ | || | | | |
1406 # | \ V V / ___ \| || |_| | |
1407 # | \_/\_/_/ \_\_| \___/ |
1409 # +----------------------------------------------------------------------+
1410 # | Global Configuration for WATO |
1411 # '----------------------------------------------------------------------'
1414 @config_variable_group_registry.register
1415 class ConfigVariableGroupWATO(ConfigVariableGroup
):
1417 return _("Administration Tool (WATO)")
1419 def sort_index(self
):
1423 @config_variable_registry.register
1424 class ConfigVariableWATOMaxSnapshots(ConfigVariable
):
1426 return ConfigVariableGroupWATO
1429 return ConfigDomainGUI
1432 return "wato_max_snapshots"
1434 def valuespec(self
):
1436 title
=_("Number of configuration snapshots to keep"),
1437 help=_("Whenever you successfully activate changes a snapshot of the configuration "
1438 "will be created. You can also create snapshots manually. WATO will delete old "
1439 "snapshots when the maximum number of snapshots is reached."),
1444 @config_variable_registry.register
1445 class ConfigVariableWATOActivationMethod(ConfigVariable
):
1447 return ConfigVariableGroupWATO
1450 return ConfigDomainGUI
1453 return "wato_activation_method"
1455 def valuespec(self
):
1456 return DropdownChoice(
1457 title
=_("WATO restart mode for Nagios"),
1458 help=_("Should WATO restart or reload Nagios when activating changes"),
1460 ('restart', _("Restart")),
1461 ('reload', _("Reload")),
1466 @config_variable_registry.register
1467 class ConfigVariableWATOLegacyEval(ConfigVariable
):
1469 return ConfigVariableGroupWATO
1472 return ConfigDomainGUI
1475 return "wato_legacy_eval"
1477 def valuespec(self
):
1479 title
=_("Use unsafe legacy encoding for distributed WATO"),
1481 _("The current implementation of WATO uses a Python module called <tt>ast</tt> for the "
1482 "communication between sites. Previous versions of Check_MK used an insecure encoding "
1483 "named <tt>pickle</tt>. Even in the current version WATO falls back to <tt>pickle</tt> "
1484 "if your Python version is not recent enough. This is at least the case for RedHat/CentOS 5.X "
1485 "and Debian 5.0. In a mixed environment you can force using the legacy <tt>pickle</tt> format "
1486 "in order to create compatibility."),
1490 @config_variable_registry.register
1491 class ConfigVariableWATOHideFilenames(ConfigVariable
):
1493 return ConfigVariableGroupWATO
1496 return ConfigDomainGUI
1499 return "wato_hide_filenames"
1501 def valuespec(self
):
1503 title
=_("Hide internal folder names in WATO"),
1504 label
=_("hide folder names"),
1505 help=_("When enabled, then the internal names of WATO folder in the filesystem "
1506 "are not shown. They will automatically be derived from the name of the folder "
1507 "when a new folder is being created. Disable this option if you want to see and "
1508 "set the filenames manually."),
1512 @config_variable_registry.register
1513 class ConfigVariableWATOUploadInsecureSnapshots(ConfigVariable
):
1515 return ConfigVariableGroupWATO
1518 return ConfigDomainGUI
1521 return "wato_upload_insecure_snapshots"
1523 def valuespec(self
):
1525 title
=_("Allow upload of insecure WATO snapshots"),
1526 label
=_("upload insecure snapshots"),
1528 _("When enabled, insecure snapshots are allowed. Please keep in mind that the upload "
1529 "of unverified snapshots represents a security risk, since the content of a snapshot is executed "
1530 "during runtime. Any manipulations in the content - either willingly or unwillingly (XSS attack) "
1531 "- pose a serious security risk."),
1535 @config_variable_registry.register
1536 class ConfigVariableWATOHideHosttags(ConfigVariable
):
1538 return ConfigVariableGroupWATO
1541 return ConfigDomainGUI
1544 return "wato_hide_hosttags"
1546 def valuespec(self
):
1548 title
=_("Hide hosttags in WATO folder view"),
1549 label
=_("hide hosttags"),
1550 help=_("When enabled, hosttags are no longer shown within the WATO folder view"),
1554 @config_variable_registry.register
1555 class ConfigVariableWATOHideVarnames(ConfigVariable
):
1557 return ConfigVariableGroupWATO
1560 return ConfigDomainGUI
1563 return "wato_hide_varnames"
1565 def valuespec(self
):
1567 title
=_("Hide names of configuration variables"),
1568 label
=_("hide variable names"),
1569 help=_("When enabled, internal configuration variable names of Check_MK are hidden "
1570 "from the user (for example in the rule editor)"),
1574 @config_variable_registry.register
1575 class ConfigVariableHideHelpInLists(ConfigVariable
):
1577 return ConfigVariableGroupWATO
1580 return ConfigDomainGUI
1583 return "wato_hide_help_in_lists"
1585 def valuespec(self
):
1587 title
=_("Hide help text of rules in list views"),
1588 label
=_("hide help text"),
1589 help=_("When disabled, WATO shows the help texts of rules also in the list views."),
1593 @config_variable_registry.register
1594 class ConfigVariableWATOUseGit(ConfigVariable
):
1596 return ConfigVariableGroupWATO
1599 return ConfigDomainGUI
1602 return "wato_use_git"
1604 def valuespec(self
):
1606 title
=_("Use GIT version control for WATO"),
1607 label
=_("enable GIT version control"),
1609 "When enabled, all changes of configuration files are tracked with the "
1610 "version control system GIT. You need to make sure that git is installed "
1611 "on your monitoring server. The version history currently cannot be viewed "
1612 "via the web GUI. Please use git command line tools within your Check_MK "
1613 "configuration directory. If you want easier tracking of configuration file changes "
1614 "simply enable the global settings option <tt>Pretty print configuration files</tt>"
1619 @config_variable_registry.register
1620 class ConfigVariableWATOPrettyPrintConfig(ConfigVariable
):
1622 return ConfigVariableGroupWATO
1625 return ConfigDomainGUI
1628 return "wato_pprint_config"
1630 def valuespec(self
):
1632 title
=_("Pretty-Print configuration files"),
1633 label
=_("pretty-print configuration files"),
1635 _("When enabled, most of the configuration files are pretty printed and easier to read. "
1636 "On the downside, however, pretty printing bigger configurations can be quite slow - "
1637 "so the overall WATO GUI performance will decrease."),
1641 @config_variable_registry.register
1642 class ConfigVariableWATOHideFoldersWithoutReadPermissions(ConfigVariable
):
1644 return ConfigVariableGroupWATO
1647 return ConfigDomainGUI
1650 return "wato_hide_folders_without_read_permissions"
1652 def valuespec(self
):
1654 title
=_("Hide folders without read permissions"),
1655 label
=_("hide folders without read permissions"),
1657 "When enabled, a subfolder is not shown, when the user does not have sufficient "
1658 "permissions to this folder and all of its subfolders. However, the subfolder is "
1659 "shown if the user has permissions to any of its subfolder."),
1663 @config_variable_registry.register
1664 class ConfigVariableWATOIconCategories(ConfigVariable
):
1666 return ConfigVariableGroupWATO
1669 return ConfigDomainGUI
1672 return "wato_icon_categories"
1674 def valuespec(self
):
1679 TextUnicode(title
=_("Title"),),
1681 orientation
="horizontal",
1683 title
=_("Icon categories"),
1684 help=_("You can customize the list of icon categories to be able to assign "
1685 "your <a href=\"?mode=icons\">custom icons</a> to these categories. "
1686 "They will then be shown under this category in the icon selector."),
1691 # .--User Management-----------------------------------------------------.
1693 # | | | | |___ ___ _ __ | \/ | __ _ _ __ ___ | |_ |
1694 # | | | | / __|/ _ \ '__| | |\/| |/ _` | '_ ` _ \| __| |
1695 # | | |_| \__ \ __/ | | | | | (_| | | | | | | |_ |
1696 # | \___/|___/\___|_| |_| |_|\__, |_| |_| |_|\__| |
1698 # +----------------------------------------------------------------------+
1699 # | Global settings for users and LDAP connector. |
1700 # '----------------------------------------------------------------------'
1703 @config_variable_group_registry.register
1704 class ConfigVariableGroupUserManagement(ConfigVariableGroup
):
1706 return _("User Management")
1708 def sort_index(self
):
1712 @config_variable_registry.register
1713 class ConfigVariableLockOnLogonFailures(ConfigVariable
):
1715 return ConfigVariableGroupUserManagement
1718 return ConfigDomainGUI
1721 return "lock_on_logon_failures"
1723 def valuespec(self
):
1726 label
=_("Number of logon failures to lock the account"),
1731 title
=_("Lock user accounts after N logon failures"),
1732 label
=_("Activate automatic locking of user accounts"),
1733 help=_("This options enables automatic locking of user accounts after "
1734 "the configured number of consecutive invalid login attempts. "
1735 "Once the account is locked only an admin user can unlock it. "
1736 "Beware: Also the admin users will be locked that way. You need "
1737 "to manually edit <tt>etc/htpasswd</tt> and remove the <tt>!</tt> "
1738 "in case you are locked out completely."),
1742 @config_variable_registry.register
1743 class ConfigVariablePasswordPolicy(ConfigVariable
):
1745 return ConfigVariableGroupUserManagement
1748 return ConfigDomainGUI
1751 return "password_policy"
1753 def valuespec(self
):
1755 title
=_('Password policy for local accounts'),
1757 'You can define some rules to which each user password ahers. By default '
1758 'all passwords are accepted, even ones which are made of only a single character, '
1759 'which is obviously a bad idea. Using this option you can enforce your users '
1760 'to choose more secure passwords.'),
1762 ('min_length', Integer(
1763 title
=_("Minimum password length"),
1768 title
=_("Number of character groups to use"),
1772 "Force the user to choose a password that contains characters from at least "
1773 "this number of different character groups. "
1774 "Character groups are: <ul>"
1775 "<li>lowercase letters</li>"
1776 "<li>uppercase letters</li>"
1778 "<li>special characters such as an underscore or dash</li>"
1783 title
=_("Maximum age of passwords"),
1786 default_value
=365 * 86400,
1792 @config_variable_registry.register
1793 class ConfigVariableUserIdleTimeout(ConfigVariable
):
1795 return ConfigVariableGroupUserManagement
1798 return ConfigDomainGUI
1801 return "user_idle_timeout"
1803 def valuespec(self
):
1807 display
=["minutes", "hours", "days"],
1811 title
=_("Login session idle timeout"),
1812 label
=_("Enable a login session idle timeout"),
1813 help=_("Normally a user login session is valid until the password is changed or "
1814 "the user is locked. By enabling this option, you can apply a time limit "
1815 "to login sessions which is applied when the user stops interacting with "
1816 "the GUI for a given amount of time. When a user is exceeding the configured "
1817 "maximum idle time, the user will be logged out and redirected to the login "
1818 "screen to renew the login session. This setting can be overriden for each "
1819 "user individually in the profile of the users."),
1823 @config_variable_registry.register
1824 class ConfigVariableSingleUserSession(ConfigVariable
):
1826 return ConfigVariableGroupUserManagement
1829 return ConfigDomainGUI
1832 return "single_user_session"
1834 def valuespec(self
):
1838 display
=["minutes", "hours"],
1839 label
=_("Session timeout:"),
1843 title
=_("Limit login to single session at a time"),
1844 label
=_("Users can only login from one client at a time"),
1845 help=_("Normally a user can login to the GUI from unlimited number of clients at "
1846 "the same time. If you want to enforce your users to be able to login only once "
1847 " (from one client which means device and browser), you can enable this option. "
1848 "When the user logs out or is inactive for the configured amount of time, the "
1849 "session is invalidated automatically and the user has to log in again from the "
1850 "current or another device."),
1854 @config_variable_registry.register
1855 class ConfigVariableDefaultUserProfile(ConfigVariable
):
1857 return ConfigVariableGroupUserManagement
1860 return ConfigDomainGUI
1863 return "default_user_profile"
1865 def valuespec(self
):
1867 title
=_("Default user profile"),
1869 "With this option you can specify the attributes a user which is created during "
1870 "its initial login gets added. For example, the default is to add the role \"user\" "
1871 "to all automatically created users."),
1872 elements
=self
._default
_user
_profile
_elements
,
1876 def _default_user_profile_elements(self
):
1879 if cmk
.is_managed_edition():
1880 import cmk
.gui
.cme
.managed
as managed
1881 elements
+= managed
.customer_choice_element()
1886 title
=_('User roles'),
1887 help=_('Specify the initial roles of an automatically created user.'),
1888 default_value
=['user'],
1889 choices
=self
._list
_roles
,
1893 title
=_('Contact groups'),
1894 help=_('Specify the initial contact groups of an automatically created user.'),
1896 choices
=self
._list
_contactgroups
,
1900 title
=_("Visibility of Hosts/Services"),
1901 label
=_("Only show hosts and services the user is a contact for"),
1902 help=_("Specifiy the initial setting for an automatically created user."),
1903 default_value
=False,
1907 def _list_roles(self
):
1908 roles
= userdb
.load_roles()
1909 return [(i
, r
["alias"]) for i
, r
in roles
.items()]
1911 def _list_contactgroups(self
):
1912 contact_groups
= userdb
.load_group_information().get("contact", {})
1913 entries
= [(c
, g
['alias']) for c
, g
in contact_groups
.items()]
1914 return sorted(entries
)
1917 @config_variable_registry.register
1918 class ConfigVariableSaveUserAccessTimes(ConfigVariable
):
1920 return ConfigVariableGroupUserManagement
1923 return ConfigDomainGUI
1926 return "save_user_access_times"
1928 def valuespec(self
):
1930 title
=_("Save last access times of users"),
1931 label
=_("Save the time of the latest user activity"),
1932 help=_("When enabled, the time of the last access is stored for each user. The last "
1933 "activity is shown on the users page."),
1938 # .--Check_MK------------------------------------------------------------.
1939 # | ____ _ _ __ __ _ __ |
1940 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
1941 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
1942 # | | |___| | | | __/ (__| < | | | | . \ |
1943 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
1945 # +----------------------------------------------------------------------+
1946 # | Operation mode of Check_MK |
1947 # '----------------------------------------------------------------------'
1950 @config_variable_group_registry.register
1951 class ConfigVariableGroupCheckExecution(ConfigVariableGroup
):
1953 return _("Execution of checks")
1955 def sort_index(self
):
1959 @config_variable_registry.register
1960 class ConfigVariableUseNewDescriptionsFor(ConfigVariable
):
1962 return ConfigVariableGroupCheckExecution
1965 return ConfigDomainCore
1968 return "use_new_descriptions_for"
1970 def valuespec(self
):
1972 title
=_("Use new service descriptions"),
1974 "In order to make Check_MK more consistent, "
1975 "the descriptions of several services have been renamed in newer "
1976 "Check_MK versions. One example is the filesystem services that have "
1977 "been renamed from <tt>fs_</tt> into <tt>Filesystem</tt>. But since renaming "
1978 "of existing services has many implications - including existing rules, performance "
1979 "data and availability history - these renamings are disabled per default for "
1980 "existing installations. Here you can switch to the new descriptions for "
1981 "selected check types"),
1983 ("df", _("Used space in filesystems")),
1984 ("df_netapp", _("NetApp Filers: Used Space in Filesystems")),
1985 ("df_netapp32", _("NetApp Filers: Used space in Filesystem Using 32-Bit Counters")),
1986 ("esx_vsphere_datastores", _("VMWare ESX host systems: Used space")),
1987 ("hr_fs", _("Used space in filesystems via SNMP")),
1988 ("vms_diskstat.df", _("Disk space on OpenVMS")),
1989 ("zfsget", _("Used space in ZFS pools and filesystems")),
1990 ("ps", _("State and Count of Processes")),
1991 ("ps.perf", _("State and Count of Processes (with additional performance data)")),
1992 ("wmic_process", _("Resource consumption of windows processes")),
1993 ("services", _("Windows Services")),
1994 ("logwatch", _("Check logfiles for relevant new messages")),
1995 ("logwatch.groups", _("Check logfile groups")),
1996 ("cmk-inventory", _("Monitor hosts for unchecked services (Check_MK Discovery)")),
1997 ("hyperv_vms", _("Hyper-V Server: State of VMs")),
1998 ("ibm_svc_mdiskgrp",
1999 _("IBM SVC / Storwize V3700 / V7000: Status and Usage of MDisksGrps")),
2000 ("ibm_svc_system", _("IBM SVC / V7000: System Info")),
2001 ("ibm_svc_systemstats.diskio",
2002 _("IBM SVC / V7000: Disk Throughput for Drives/MDisks/VDisks in Total")),
2003 ("ibm_svc_systemstats.iops",
2004 _("IBM SVC / V7000: IO operations/sec for Drives/MDisks/VDisks in Total")),
2005 ("ibm_svc_systemstats.disk_latency",
2006 _("IBM SVC / V7000: Latency for Drives/MDisks/VDisks in Total")),
2007 ("ibm_svc_systemstats.cache", _("IBM SVC / V7000: Cache Usage in Total")),
2008 ("casa_cpu_temp", _("Casa module: CPU temperature")),
2009 ("cmciii.temp", _("Rittal CMC-III Units: Temperatures")),
2010 ("cmciii.psm_current", _("Rittal CMC-III Units: Current")),
2011 ("cmciii_lcp_airin", _("Rittal CMC-III LCP: Air In and Temperature")),
2012 ("cmciii_lcp_airout", _("Rittal CMC-III LCP: Air Out Temperature")),
2013 ("cmciii_lcp_water", _("Rittal CMC-III LCP: Water In/Out Temperature")),
2014 ("etherbox.temp", _("Etherbox / MessPC: Sensor Temperature")),
2015 ("liebert_bat_temp", _("Liebert UPS Device: Temperature sensor")),
2016 ("nvidia.temp", _("Temperatures of NVIDIA graphics card")),
2017 ("ups_bat_temp", _("Generic UPS Device: Temperature sensor")),
2018 ("innovaphone_temp", _("Innovaphone Gateway: Current Temperature")),
2019 ("enterasys_temp", _("Enterasys Switch: Temperature")),
2020 ("raritan_emx", _("Raritan EMX Rack: Temperature")),
2021 ("raritan_pdu_inlet", _("Raritan PDU: Input Phases")),
2022 ("mknotifyd", _("Notification Spooler")),
2023 ("mknotifyd.connection", _("Notification Spooler Connection")),
2024 ("postfix_mailq", _("Postfix: Mail Queue")),
2025 ("nullmailer_mailq", _("Nullmailer: Mail Queue")),
2026 ("barracuda_mailqueues", _("Barracuda: Mail Queue")),
2027 ("qmail_stats", _("Qmail: Mail Queue")),
2028 ("http", _("Check HTTP: Use HTTPS instead of HTTP for SSL/TLS connections")),
2029 ("mssql_backup", _("MSSQL Backup")),
2030 ("mssql_counters.cache_hits", _("MSSQL Cache Hits")),
2031 ("mssql_counters.transactions", _("MSSQL Transactions")),
2032 ("mssql_counters.locks", _("MSSQL Locks")),
2033 ("mssql_counters.sqlstats", _("MSSQL SQL Stats")),
2034 ("mssql_counters.pageactivity", _("MSSQL Page Activity")),
2035 ("mssql_counters.locks_per_batch", _("MSSQL Locks per Batch")),
2036 ("mssql_counters.file_sizes", _("MSSQL File Sizes")),
2037 ("mssql_databases", _("MSSQL Database")),
2038 ("mssql_datafiles", _("MSSQL Datafile")),
2039 ("mssql_tablespaces", _("MSSQL Tablespace")),
2040 ("mssql_transactionlogs", _("MSSQL Transactionlog")),
2041 ("mssql_versions", _("MSSQL Version")),
2042 ("mssql_blocked_sessions", _("MSSQL Blocked Sessions")),
2044 render_orientation
="vertical",
2048 @config_variable_registry.register
2049 class ConfigVariableTCPConnectTimeout(ConfigVariable
):
2051 return ConfigVariableGroupCheckExecution
2054 return ConfigDomainCore
2057 return "tcp_connect_timeout"
2059 def valuespec(self
):
2061 title
=_("Agent TCP connect timeout"),
2063 "Timeout for TCP connect to agent in seconds. If the connection "
2064 "to the agent cannot be established within this time, it is considered to be unreachable. "
2065 "Note: This does <b>not</b> limit the time the agent needs to "
2066 "generate its output."),
2072 @config_variable_registry.register
2073 class ConfigVariableSimulationMode(ConfigVariable
):
2075 return ConfigVariableGroupCheckExecution
2078 return ConfigDomainCore
2081 return "simulation_mode"
2083 def valuespec(self
):
2085 title
=_("Simulation mode"),
2086 label
=_("Run in simulation mode"),
2087 help=_("This boolean variable allows you to bring check_mk into a dry run mode. "
2088 "No hosts will be contacted, no DNS lookups will take place and data is read "
2089 "from cache files that have been created during normal operation or have "
2090 "been copied here from another monitoring site."),
2094 @config_variable_registry.register
2095 class ConfigVariableRestartLocking(ConfigVariable
):
2097 return ConfigVariableGroupCheckExecution
2100 return ConfigDomainCore
2103 return "restart_locking"
2105 def valuespec(self
):
2106 return DropdownChoice(
2107 title
=_("Simultanous activation of changes"),
2108 help=_("When two users simultanously try to activate the changes then "
2109 "you can decide to abort with an error (default) or have the requests "
2110 "serialized. It is also possible - but not recommended - to turn "
2111 "off locking altogether."),
2113 ('abort', _("Abort with an error")),
2114 ('wait', _("Wait until the other has finished")),
2115 (None, _("Disable locking")),
2120 @config_variable_registry.register
2121 class ConfigVariableAgentSimulator(ConfigVariable
):
2123 return ConfigVariableGroupCheckExecution
2126 return ConfigDomainCore
2129 return "agent_simulator"
2131 def valuespec(self
):
2133 title
=_("SNMP Agent Simulator"),
2134 label
=_("Process stored SNMP walks with agent simulator"),
2135 help=_("When using stored SNMP walks you can place inline code generating "
2136 "dynamic simulation data. This feature can be activated here. There "
2137 "is a big chance that you will never need this feature..."),
2141 @config_variable_registry.register
2142 class ConfigVariableDelayPrecompile(ConfigVariable
):
2144 return ConfigVariableGroupCheckExecution
2147 return ConfigDomainCore
2150 return "delay_precompile"
2152 def valuespec(self
):
2154 title
=_("Delay precompiling of host checks"),
2155 label
=_("delay precompiling"),
2157 "If you enable this option, then Check_MK will not directly Python-bytecompile "
2158 "all host checks when activating the configuration and restarting Nagios. "
2159 "Instead it will delay this to the first "
2160 "time the host is actually checked being by Nagios.<p>This reduces the time needed "
2161 "for the operation, but on the other hand will lead to a slightly higher load "
2162 "of Nagios for the first couple of minutes after the restart. "),
2166 @config_variable_registry.register
2167 class ConfigVariableClusterMaxCachefileAge(ConfigVariable
):
2169 return ConfigVariableGroupCheckExecution
2172 return ConfigDomainCore
2175 return "cluster_max_cachefile_age"
2177 def valuespec(self
):
2179 title
=_("Maximum cache file age for clusters"),
2181 help=_("The number of seconds a cache file may be old if check_mk should "
2182 "use it instead of getting information from the target hosts while "
2183 "checking a cluster. Per default this is enabled and set to 90 seconds. "
2184 "If your check cycle is set to a larger value than one minute then "
2185 "you should increase this accordingly."),
2189 @config_variable_registry.register
2190 class ConfigVariablePiggybackMaxCachefileAge(ConfigVariable
):
2192 return ConfigVariableGroupCheckExecution
2195 return ConfigDomainCore
2198 return "piggyback_max_cachefile_age"
2200 def valuespec(self
):
2202 title
=_("Maximum age for piggyback files"),
2204 "The maximum age for piggy back data from another host to be valid for monitoring. "
2205 "Older files are deleted before processing them. Please make sure that this age is "
2206 "at least as large as you normal check interval for piggy hosts."),
2210 @config_variable_registry.register
2211 class ConfigVariableCheckMKPerfdataWithTimes(ConfigVariable
):
2213 return ConfigVariableGroupCheckExecution
2216 return ConfigDomainCore
2219 return "check_mk_perfdata_with_times"
2221 def valuespec(self
):
2223 title
=_("Check_MK with times performance data"),
2224 label
=_("Return process times within performance data"),
2225 help=_("Enabling this option results in additional performance data "
2226 "for the Check_MK output, giving information regarding the process times. "
2227 "It provides the following fields: user_time, system_time, children_user_time "
2228 "and children_system_time"),
2232 @config_variable_registry.register
2233 class ConfigVariableUseDNSCache(ConfigVariable
):
2235 return ConfigVariableGroupCheckExecution
2238 return ConfigDomainCore
2241 return "use_dns_cache"
2243 def valuespec(self
):
2245 title
=_("Use DNS lookup cache"),
2246 label
=_("Prevent DNS lookups by use of a cache file"),
2248 "When this option is enabled (which is the default), then Check_MK tries to "
2249 "prevent IP address lookups during the configuration generation. This can speed "
2250 "up this process greatly when you have a larger number of hosts. The cache is stored "
2251 "in a simple file. Note: when the cache is enabled then changes of the IP address "
2252 "of a host in your name server will not be detected immediately. If you need an "
2253 "immediate update then simply disable the cache once, activate the changes and "
2254 "enabled it again. OMD based installations automatically update the cache once "
2259 @config_variable_registry.register
2260 class ConfigVariableUseInlineSNMP(ConfigVariable
):
2262 return ConfigVariableGroupCheckExecution
2265 return ConfigDomainCore
2268 return "use_inline_snmp"
2270 def valuespec(self
):
2272 title
=_("Use Inline SNMP"),
2273 label
=_("Enable inline SNMP (directly use net-snmp libraries)"),
2275 "By default Check_MK uses command line calls of Net-SNMP tools like snmpget or "
2276 "snmpwalk to gather SNMP information. For each request a new command line "
2277 "program is being executed. It is now possible to use the inline SNMP implementation "
2278 "which calls the net-snmp libraries directly via its python bindings. This "
2279 "should increase the performance of SNMP checks in a significant way. The inline "
2280 "SNMP mode is a feature which improves the performance for large installations and "
2281 "only available via our subscription."),
2285 @config_variable_registry.register
2286 class ConfigVariableRecordInlineSNMPStats(ConfigVariable
):
2288 return ConfigVariableGroupCheckExecution
2291 return ConfigDomainCore
2294 return "record_inline_snmp_stats"
2296 def valuespec(self
):
2298 title
=_("Record statistics of Inline SNMP"),
2299 label
=_("Enable recording of Inline SNMP statistics"),
2301 "When you have enabled Inline SNMP, you can use this flag to enable recording of "
2302 "some performance related values. The recorded values are stored in a single file "
2303 "at <tt>var/check_mk/snmp.stats</tt>.<br><br>"
2304 "<i>Please note:</i> Only enable this for a short period, because it will "
2305 "decrease the performance of your monitoring."),
2309 @config_variable_registry.register
2310 class ConfigVariableHTTPProxies(ConfigVariable
):
2312 return ConfigVariableGroupCheckExecution
2315 return ConfigDomainCore
2318 return "http_proxies"
2320 def valuespec(self
):
2324 title
=_("HTTP proxy"),
2328 title
=_("Unique ID"),
2330 "The ID must be a unique text. It will be used as an internal key "
2331 "when objects refer to this object."),
2337 help=_("The title of the %s. It will be used as display name.") %
2342 ("proxy_url", HTTPProxyInput()),
2346 title
=_("HTTP proxies"),
2348 totext
=_("%d HTTP proxy servers configured"),
2349 help=_("Use this option to configure one or several proxy servers that can then be "
2350 "used in different places to establish connections to services using these "
2352 validate
=self
._validate
_proxies
,
2354 forth
=lambda v
: v
.values(),
2355 back
=lambda v
: {p
["ident"]: p
for p
in v
},
2358 def _validate_proxies(self
, value
, varprefix
):
2359 seen_idents
, seen_titles
= [], []
2360 for http_proxy
in value
:
2361 if http_proxy
["ident"] in seen_idents
:
2364 _("Found multiple proxies using the ID '%s'") % http_proxy
["ident"])
2365 seen_idents
.append(http_proxy
["ident"])
2367 if http_proxy
["title"] in seen_titles
:
2370 _("Found multiple proxies using the title '%s'") % http_proxy
["title"])
2371 seen_titles
.append(http_proxy
["title"])
2374 @config_variable_group_registry.register
2375 class ConfigVariableGroupServiceDiscovery(ConfigVariableGroup
):
2377 return _("Service discovery")
2379 def sort_index(self
):
2383 @config_variable_registry.register
2384 class ConfigVariableInventoryCheckInterval(ConfigVariable
):
2386 return ConfigVariableGroupServiceDiscovery
2389 return ConfigDomainCore
2392 return "inventory_check_interval"
2394 def valuespec(self
):
2397 title
=_("Perform service discovery check every"),
2401 title
=_("Enable regular service discovery checks (deprecated)"),
2402 help=_("If enabled, Check_MK will create one additional service per host "
2403 "that does a regular check, if the service discovery would find new services "
2404 "currently un-monitored. <b>Note:</b> This option is deprecated and has been "
2405 "replaced by the rule set <a href='%s'>Periodic Service Discovery</a>, "
2406 "which allows a per-host configuration and additional features such as "
2407 "automatic rediscovery. Rules in that rule set will override the global "
2408 "settings done here.") % "wato.py?mode=edit_ruleset&varname=periodic_discovery",
2412 @config_variable_registry.register
2413 class ConfigVariableInventoryCheckSeverity(ConfigVariable
):
2415 return ConfigVariableGroupServiceDiscovery
2418 return ConfigDomainCore
2421 return "inventory_check_severity"
2423 def valuespec(self
):
2424 return DropdownChoice(
2425 title
=_("Severity of failed service discovery check"),
2426 help=_("Please select which alarm state the service discovery check services "
2427 "shall assume in case that un-monitored services are found."),
2429 (0, _("OK - do not alert, just display")),
2437 @config_variable_registry.register
2438 class ConfigVariableInventoryCheckDoScan(ConfigVariable
):
2440 return ConfigVariableGroupServiceDiscovery
2443 return ConfigDomainCore
2446 return "inventory_check_do_scan"
2448 def valuespec(self
):
2449 return DropdownChoice(
2450 title
=_("Service discovery check for SNMP devices"),
2452 (True, _("Perform full SNMP scan always, detect new check types")),
2453 (False, _("Just rely on existing check files, detect new items only")),
2458 @config_variable_registry.register
2459 class ConfigVariableInventoryCheckAutotrigger(ConfigVariable
):
2461 return ConfigVariableGroupServiceDiscovery
2464 return ConfigDomainCore
2467 return "inventory_check_autotrigger"
2469 def valuespec(self
):
2471 title
=_("Service discovery triggers service discovery check"),
2473 "Automatically schedule service discovery check after service configuration changes"
2475 help=_("When this option is enabled then after each change of the service "
2476 "configuration of a host via WATO - may it be via manual changes or a bulk "
2477 "discovery - the service discovery check is automatically rescheduled in order "
2478 "to reflect the new service state correctly immediately."),
2483 # .--Rulesets------------------------------------------------------------.
2485 # | | _ \ _ _| | ___ ___ ___| |_ ___ |
2486 # | | |_) | | | | |/ _ \/ __|/ _ \ __/ __| |
2487 # | | _ <| |_| | | __/\__ \ __/ |_\__ \ |
2488 # | |_| \_\\__,_|_|\___||___/\___|\__|___/ |
2490 # +----------------------------------------------------------------------+
2491 # | Rulesets for hosts and services except check parameter rules. |
2492 # '----------------------------------------------------------------------'
2495 @rulespec_group_registry.register
2496 class RulespecGroupGrouping(RulespecGroup
):
2503 return _("Grouping")
2507 return _("Assignment of host & services to host, service and contacts groups.")
2511 RulespecGroupGrouping
,
2515 title
=_("Assignment of hosts to host groups"),
2516 help=_("Hosts can be grouped together into host groups. The most common use case "
2517 "is to put hosts which belong together in a host group to make it possible "
2518 "to get them listed together in the status GUI.")),
2522 RulespecGroupGrouping
,
2524 GroupSelection("service", title
=_("Assignment of services to service groups")),
2529 RulespecGroupGrouping
,
2530 "host_contactgroups",
2531 GroupSelection("contact", title
=_("Assignment of hosts to contact groups")),
2535 RulespecGroupGrouping
,
2536 "service_contactgroups",
2537 GroupSelection("contact", title
=_("Assignment of services to contact groups")),
2542 @rulespec_group_registry.register
2543 class RulespecGroupMonitoringConfiguration(RulespecGroup
):
2550 return _("Monitoring Configuration")
2555 "Intervals for checking, retries, clustering, configuration for inventory and similar")
2558 @rulespec_group_registry.register
2559 class RulespecGroupMonitoringConfigurationServiceChecks(RulespecSubGroup
):
2561 def main_group(self
):
2562 return RulespecGroupMonitoringConfiguration
2565 def sub_group_name(self
):
2566 return "service_checks"
2570 return _("Service Checks")
2574 RulespecGroupMonitoringConfigurationServiceChecks
,
2575 "extra_service_conf:max_check_attempts",
2577 title
=_("Maximum number of check attempts for service"),
2578 help=_("The maximum number of failed checks until a service problem state will "
2579 "be considered as <u>hard</u>. Only hard state trigger notifications. "),
2584 RulespecGroupMonitoringConfigurationServiceChecks
,
2585 "extra_service_conf:check_interval",
2587 Age(minvalue
=1, default_value
=60),
2588 forth
=lambda v
: int(v
* 60),
2589 back
=lambda v
: float(v
) / 60.0,
2590 title
=_("Normal check interval for service checks"),
2591 help=_("Check_MK usually uses an interval of one minute for the active Check_MK "
2592 "check and for legacy checks. Here you can specify a larger interval. Please "
2593 "note, that this setting only applies to active checks (those with the "
2594 "reschedule button). If you want to change the check interval of "
2595 "the Check_MK service only, specify <tt><b>Check_MK$</b></tt> in the list "
2601 RulespecGroupMonitoringConfigurationServiceChecks
,
2602 "extra_service_conf:retry_interval",
2604 Age(minvalue
=1, default_value
=60),
2605 forth
=lambda v
: int(v
* 60),
2606 back
=lambda v
: float(v
) / 60.0,
2607 title
=_("Retry check interval for service checks"),
2608 help=_("This setting is relevant if you have set the maximum number of check "
2609 "attempts to a number greater than one. In case a service check is not OK "
2610 "and the maximum number of check attempts is not yet reached, it will be "
2611 "rescheduled with this interval. The retry interval is usually set to a smaller "
2612 "value than the normal interval.<br><br>This setting only applies to "
2617 RulespecGroupMonitoringConfigurationServiceChecks
,
2618 "extra_service_conf:check_period",
2619 TimeperiodSelection(
2620 title
=_("Check period for active services"),
2621 help=_("If you specify a notification period for a service then active checks "
2622 "of that service will only be done in that period. Please note, that the "
2623 "checks driven by Check_MK are passive checks and are not affected by this "
2624 "rule. You can use the rule for the active Check_MK check, however.")),
2628 RulespecGroupMonitoringConfigurationServiceChecks
,
2630 TimeperiodSelection(
2631 title
=_("Check period for passive Check_MK services"),
2632 help=_("If you specify a notification period for a Check_MK service then "
2633 "results will be processed only within this period.")),
2637 RulespecGroupMonitoringConfigurationServiceChecks
,
2638 "extra_service_conf:process_perf_data",
2640 title
=_("Enable/disable processing of perfdata for services"),
2641 help=_("This setting allows you to disable the processing of perfdata for a "
2642 "service completely."),
2643 choices
=[("1", _("Enable processing of perfdata")),
2644 ("0", _("Disable processing of perfdata"))],
2649 RulespecGroupMonitoringConfigurationServiceChecks
,
2650 "extra_service_conf:passive_checks_enabled",
2652 title
=_("Enable/disable passive checks for services"),
2653 help=_("This setting allows you to disable the processing of passiv check results for a "
2655 choices
=[("1", _("Enable processing of passive check results")),
2656 ("0", _("Disable processing of passive check results"))],
2661 RulespecGroupMonitoringConfigurationServiceChecks
,
2662 "extra_service_conf:active_checks_enabled",
2664 title
=_("Enable/disable active checks for services"),
2665 help=_("This setting allows you to disable or enable "
2666 "active checks for a service."),
2667 choices
=[("1", _("Enable active checks")), ("0", _("Disable active checks"))],
2672 @rulespec_group_registry.register
2673 class RulespecGroupMonitoringConfigurationHostChecks(RulespecSubGroup
):
2675 def main_group(self
):
2676 return RulespecGroupMonitoringConfiguration
2679 def sub_group_name(self
):
2680 return "host_checks"
2684 return _("Host Checks")
2688 RulespecGroupMonitoringConfigurationHostChecks
, "extra_host_conf:max_check_attempts",
2690 title
=_("Maximum number of check attempts for host"),
2691 help=_("The maximum number of failed host checks until the host will be considered "
2692 "in a hard down state"),
2696 RulespecGroupMonitoringConfigurationHostChecks
, "extra_host_conf:check_interval",
2698 Age(minvalue
=1, default_value
=60),
2699 forth
=lambda v
: int(v
* 60),
2700 back
=lambda v
: float(v
) / 60.0,
2701 title
=_("Normal check interval for host checks"),
2703 "The default interval is set to 6 seconds for smart ping and one minute for all other. Here you can specify a larger "
2704 "interval. The host is contacted in this interval on a regular base. The host "
2705 "check is also being executed when a problematic service state is detected to check "
2706 "wether or not the service problem is resulting from a host problem.")))
2709 RulespecGroupMonitoringConfigurationHostChecks
, "extra_host_conf:retry_interval",
2711 Age(minvalue
=1, default_value
=60),
2712 forth
=lambda v
: int(v
* 60),
2713 back
=lambda v
: float(v
) / 60.0,
2714 title
=_("Retry check interval for host checks"),
2716 "This setting is relevant if you have set the maximum number of check "
2717 "attempts to a number greater than one. In case a host check is not UP "
2718 "and the maximum number of check attempts is not yet reached, it will be "
2719 "rescheduled with this interval. The retry interval is usually set to a smaller "
2720 "value than the normal interval. The default is 6 seconds for smart ping and 60 seconds for all other."
2725 RulespecGroupMonitoringConfigurationHostChecks
,
2726 "extra_host_conf:check_period",
2727 TimeperiodSelection(
2728 title
=_("Check period for hosts"),
2729 help=_("If you specify a check period for a host then active checks of that "
2730 "host will only take place within that period. In the rest of the time "
2731 "the state of the host will stay at its last status.")),
2735 def _host_check_command_choices():
2736 if config
.user
.may('wato.add_or_modify_executables'):
2738 ("custom", _("Use a custom check plugin..."), PluginCommandLine()),
2744 ("ping", _("PING (active check with ICMP echo request)")),
2745 ("smart", _("Smart PING (only with Check_MK Micro Core)")),
2746 ("tcp", _("TCP Connect"),
2747 Integer(label
=_("to port:"), minvalue
=1, maxvalue
=65535, default_value
=80)),
2748 ("ok", _("Always assume host to be up")),
2749 ("agent", _("Use the status of the Check_MK Agent")),
2750 ("service", _("Use the status of the service..."),
2755 help=_("You can use the macro <tt>$HOSTNAME$</tt> here. It will be replaced "
2756 "with the name of the current host."),
2762 RulespecGroupMonitoringConfigurationHostChecks
,
2763 "host_check_commands",
2765 title
=_("Host Check Command"),
2766 help=_("Usually Check_MK uses a series of PING (ICMP echo request) in order to determine "
2767 "whether a host is up. In some cases this is not possible, however. With this rule "
2768 "you can specify an alternative way of determining the host's state."),
2769 choices
=_host_check_command_choices
,
2770 default_value
="ping",
2771 orientation
="horizontal",
2776 @rulespec_group_registry.register
2777 class RulespecGroupMonitoringConfigurationNotifications(RulespecSubGroup
):
2779 def main_group(self
):
2780 return RulespecGroupMonitoringConfiguration
2783 def sub_group_name(self
):
2784 return "notifications"
2788 return _("Notifications")
2792 RulespecGroupMonitoringConfigurationNotifications
, "extra_host_conf:notifications_enabled",
2794 title
=_("Enable/disable notifications for hosts"),
2795 help=_("This setting allows you to disable notifications about problems of a "
2796 "host completely. Per default all notifications are enabled. Sometimes "
2797 "it is more convenient to just disable notifications then to remove a "
2798 "host completely from the monitoring. Note: this setting has no effect "
2799 "on the notifications of service problems of a host."),
2800 choices
=[("1", _("Enable host notifications")), ("0", _("Disable host notifications"))],
2804 RulespecGroupMonitoringConfigurationNotifications
,
2805 "extra_service_conf:notifications_enabled",
2807 title
=_("Enable/disable notifications for services"),
2808 help=_("This setting allows you to disable notifications about problems of a "
2809 "service completely. Per default all notifications are enabled."),
2810 choices
=[("1", _("Enable service notifications")), ("0",
2811 _("Disable service notifications"))],
2816 RulespecGroupMonitoringConfigurationNotifications
,
2817 "extra_host_conf:notification_options",
2821 ("d", _("Host goes down")),
2822 ("u", _("Host gets unreachble")),
2823 ("r", _("Host goes up again")),
2824 ("f", _("Start or end of flapping state")),
2825 ("s", _("Start or end of a scheduled downtime")),
2827 default_value
=["d", "r", "f", "s"],
2829 title
=_("Notified events for hosts"),
2830 help=_("This ruleset allows you to restrict notifications of host problems to certain "
2831 "states, e.g. only notify on DOWN, but not on UNREACHABLE. Please select the types "
2832 "of events that should initiate notifications. Please note that several other "
2833 "filters must also be passed in order for notifications to finally being sent out."
2835 "Please note: There is a difference between the Microcore and Nagios when you have "
2836 "a host that has no matching rule in this ruleset. In this case the Microcore will "
2837 "not send out UNREACHABLE notifications while the Nagios core would send out "
2838 "UNREACHABLE notifications. To align this behaviour, create a rule matching "
2839 "all your hosts and configure it to either send UNREACHABLE notifications or not."),
2840 forth
=lambda x
: x
!= 'n' and x
.split(",") or [],
2841 back
=lambda x
: ",".join(x
) or "n",
2846 RulespecGroupMonitoringConfigurationNotifications
,
2847 "extra_service_conf:notification_options",
2851 ("w", _("Service goes into warning state")),
2852 ("u", _("Service goes into unknown state")),
2853 ("c", _("Service goes into critical state")),
2854 ("r", _("Service recovers to OK")),
2855 ("f", _("Start or end of flapping state")),
2856 ("s", _("Start or end of a scheduled downtime")),
2858 default_value
=["w", "u", "c", "r", "f", "s"],
2860 title
=_("Notified events for services"),
2861 help=_("This ruleset allows you to restrict notifications of service problems to certain "
2862 "states, e.g. only notify on CRIT, but not on WARN. Please select the types "
2863 "of events that should initiate notifications. Please note that several other "
2864 "filters must also be passed in order for notifications to finally being sent out."),
2865 forth
=lambda x
: x
!= 'n' and x
.split(",") or [],
2866 back
=lambda x
: ",".join(x
) or "n",
2871 RulespecGroupMonitoringConfigurationNotifications
,
2872 "extra_host_conf:notification_period",
2873 TimeperiodSelection(
2874 title
=_("Notification period for hosts"),
2875 help=_("If you specify a notification period for a host then notifications "
2876 "about problems of that host (not of its services!) will only be sent "
2877 "if those problems occur within the notification period. Also you can "
2878 "filter out problems in the problems views for objects not being in "
2879 "their notification period (you can think of the notification period "
2880 "as the 'service time').")),
2884 RulespecGroupMonitoringConfigurationNotifications
,
2885 "extra_service_conf:notification_period",
2886 TimeperiodSelection(
2887 title
=_("Notification period for services"),
2888 help=_("If you specify a notification period for a service then notifications "
2889 "about that service will only be sent "
2890 "if those problems occur within the notification period. Also you can "
2891 "filter out problems in the problems views for objects not being in "
2892 "their notification period (you can think of the notification period "
2893 "as the 'service time').")),
2897 def transform_float_minutes_to_age(float_minutes
):
2898 return int(float_minutes
* 60)
2901 def transform_age_to_float_minutes(age
):
2902 return float(age
) / 60.0
2906 RulespecGroupMonitoringConfigurationNotifications
,
2907 "extra_host_conf:first_notification_delay",
2913 title
=_("Delay host notifications"),
2914 help=_("This setting delays notifications about host problems by the "
2915 "specified amount of time. If the host is up again within that "
2916 "time, no notification will be sent out."),
2918 forth
=transform_float_minutes_to_age
,
2919 back
=transform_age_to_float_minutes
,
2921 factory_default
=0.0,
2925 RulespecGroupMonitoringConfigurationNotifications
,
2926 "extra_service_conf:first_notification_delay",
2933 title
=_("Delay service notifications"),
2934 help=_("This setting delays notifications about service problems by the "
2935 "specified amount of time. If the service is OK again within that "
2936 "time, no notification will be sent out."),
2938 forth
=transform_float_minutes_to_age
,
2939 back
=transform_age_to_float_minutes
,
2941 factory_default
=0.0,
2945 RulespecGroupMonitoringConfigurationNotifications
, "extra_host_conf:notification_interval",
2948 Float(minvalue
=0.05, default_value
=120.0, label
=_("Interval:"), unit
=_("minutes")),
2951 title
=_("Periodic notifications during host problems"),
2952 help=_("If you enable periodic notifications, then during a problem state "
2953 "of the host notifications will be sent out in regular intervals "
2954 "until the problem is acknowledged."),
2955 label
=_("Enable periodic notifications"),
2956 none_label
=_("disabled"),
2961 RulespecGroupMonitoringConfigurationNotifications
,
2962 "extra_service_conf:notification_interval",
2965 Float(minvalue
=0.05, default_value
=120.0, label
=_("Interval:"), unit
=_("minutes")),
2968 title
=_("Periodic notifications during service problems"),
2969 help=_("If you enable periodic notifications, then during a problem state "
2970 "of the service notifications will be sent out in regular intervals "
2971 "until the problem is acknowledged."),
2972 label
=_("Enable periodic notifications"),
2973 none_label
=_("disabled"),
2979 RulespecGroupMonitoringConfigurationNotifications
, "extra_host_conf:flap_detection_enabled",
2981 title
=_("Enable/disable flapping detection for hosts"),
2982 help=_("This setting allows you to disable the flapping detection for a "
2983 "host completely."),
2984 choices
=[("1", _("Enable flap detection")), ("0", _("Disable flap detection"))],
2988 RulespecGroupMonitoringConfigurationNotifications
,
2989 "extra_service_conf:flap_detection_enabled",
2991 title
=_("Enable/disable flapping detection for services"),
2992 help=_("This setting allows you to disable the flapping detection for a "
2993 "service completely."),
2994 choices
=[("1", _("Enable flap detection")), ("0", _("Disable flap detection"))],
2999 RulespecGroupMonitoringConfigurationNotifications
,
3000 "extra_service_conf:notes_url",
3003 title
=_("Notes URL for Services"),
3004 help=_("With this setting you can set links to documentations "
3005 "for each service"),
3011 RulespecGroupMonitoringConfigurationNotifications
,
3012 "extra_host_conf:notes_url",
3015 title
=_("Notes URL for Hosts"),
3016 help=_("With this setting you can set links to documentations "
3023 RulespecGroupMonitoringConfigurationNotifications
,
3024 "extra_service_conf:display_name",
3026 title
=_("Alternative display name for Services"),
3027 help=_("This rule set allows you to specify an alternative name "
3028 "to be displayed for certain services. This name is available as "
3029 "a column when creating new views or modifying existing ones. "
3030 "It is always visible in the details view of a service. In the "
3031 "availability reporting there is an option for using that name "
3032 "instead of the normal service description. It does <b>not</b> automatically "
3033 "replace the normal service name in all views.<br><br><b>Note</b>: The "
3034 "purpose of this rule set is to define unique names for several well-known "
3035 "services. It cannot rename services in general."),
3042 @rulespec_group_registry.register
3043 class RulespecGroupMonitoringConfigurationInventoryAndCMK(RulespecSubGroup
):
3045 def main_group(self
):
3046 return RulespecGroupMonitoringConfiguration
3049 def sub_group_name(self
):
3050 return "inventory_and_check_mk_settings"
3054 return _("Inventory and Check_MK settings")
3058 RulespecGroupMonitoringConfigurationInventoryAndCMK
,
3060 title
=_("Hosts to be monitored"),
3061 help=_("By adding rules to this ruleset you can define a subset of your hosts "
3062 "to be actually monitored. As long as the rule set is empty "
3063 "all configured hosts will be monitored. As soon as you add at least one "
3064 "rule, only hosts with a matching rule will be monitored."),
3065 optional
=True, # only_hosts is None per default
3069 RulespecGroupMonitoringConfigurationInventoryAndCMK
,
3071 title
=_("Disabled services"),
3072 help=_("Services that are declared as <u>disabled</u> by this rule set will not be added "
3073 "to a host during discovery (automatic service detection). Services that already "
3074 "exist will continued to be monitored but be marked as obsolete in the service "
3079 RulespecGroupMonitoringConfigurationInventoryAndCMK
, "ignored_checks",
3081 title
=_("Disabled checks"),
3082 help=_("This ruleset is similar to 'Disabled services', but selects checks to be disabled "
3083 "by their <b>type</b>. This allows you to disable certain technical implementations "
3084 "such as filesystem checks via SNMP on hosts that also have the Check_MK agent "
3089 RulespecGroupMonitoringConfigurationInventoryAndCMK
,
3090 "clustered_services",
3091 title
=_("Clustered services"),
3092 help=_("When you define HA clusters in WATO then you also have to specify "
3093 "which services of a node should be assigned to the cluster and "
3094 "which services to the physical node. This is done by this ruleset. "
3095 "Please note that the rule will be applied to the <i>nodes</i>, not "
3096 "to the cluster.<br><br>Please make sure that you re-inventorize the "
3097 "cluster and the physical nodes after changing this ruleset."),
3101 RulespecGroupMonitoringConfigurationInventoryAndCMK
, "periodic_discovery",
3103 title
=_("Periodic service discovery"),
3106 "check_interval": 2 * 60,
3107 "severity_unmonitored": 1,
3108 "severity_vanished": 0,
3109 "inventory_check_do_scan": True,
3114 title
=_("Do not perform periodic service discovery check"),
3115 totext
=_("no discovery check"),
3118 title
=_("Perform periodic service discovery check"),
3120 "If enabled, Check_MK will create one additional service per host "
3121 "that does a periodic check, if the service discovery would find new services "
3122 "that are currently not monitored."),
3126 Age(minvalue
=1, display
=["days", "hours", "minutes"]),
3127 forth
=lambda v
: int(v
* 60),
3128 back
=lambda v
: float(v
) / 60.0,
3129 title
=_("Perform service discovery every"),
3131 ("severity_unmonitored",
3133 title
=_("Severity of unmonitored services"),
3135 "Please select which alarm state the service discovery check services "
3136 "shall assume in case that un-monitored services are found."),
3138 (0, _("OK - do not alert, just display")),
3144 ("severity_vanished",
3146 title
=_("Severity of vanished services"),
3148 "Please select which alarm state the service discovery check services "
3149 "shall assume in case that non-existing services are being monitored."
3152 (0, _("OK - do not alert, just display")),
3158 ("inventory_check_do_scan",
3160 title
=_("Service discovery check for SNMP devices"),
3162 (True, _("Perform full SNMP scan always, detect new check types")),
3163 (False, _("Just rely on existing check files, detect new items only"))
3165 ("inventory_rediscovery",
3167 title
=_("Automatically update service configuration"),
3169 "If active the check will not only notify about un-monitored services, "
3170 "it will also automatically add/remove them as neccessary."),
3175 choices
=[(0, _("Add unmonitored services")),
3176 (1, _("Remove vanished services")),
3177 (2, _("Add unmonitored & remove vanished services")),
3178 (3, _("Refresh all services (tabula rasa)"))],
3179 orientation
="vertical",
3183 Age(title
=_("Group discovery and activation for up to"),
3185 "A delay can be configured here so that multiple "
3186 "discoveries can be activated in one go. This avoids frequent core "
3187 "restarts in situations with frequent services changes."),
3188 default_value
=15 * 60,
3189 display
=["hours", "minutes"])),
3193 _("Never do discovery or activate changes in the following time ranges"
3195 help=_("This avoids automatic changes during these times so "
3196 "that the automatic system doesn't interfere with "
3201 title
=_("Automatic activation"),
3203 (True, _("Automatically activate changes")),
3204 (False, _("Do not activate changes")),
3208 "Here you can have the changes activated whenever services "
3209 "have been added or removed."),
3211 ("service_whitelist",
3213 title
=_("Activate only services matching"),
3216 "Set service names or regular expression patterns here to "
3217 "allow only matching services to be activated automatically. "
3218 "If you set both this and \'Don't activate services matching\', "
3219 "both rules have to apply for a service to be activated."),
3221 ("service_blacklist",
3223 title
=_("Don't activate services matching"),
3226 _("Set service names or regular expression patterns here to "
3227 "prevent matching services from being activated automatically. "
3228 "If you set both this and \'Activate only services matching\', "
3229 "both rules have to apply for a service to be activated."),
3232 optional_keys
=["service_whitelist", "service_blacklist"],
3235 optional_keys
=["inventory_rediscovery"],
3240 @rulespec_group_registry.register
3241 class RulespecGroupMonitoringConfigurationVarious(RulespecSubGroup
):
3243 def main_group(self
):
3244 return RulespecGroupMonitoringConfiguration
3247 def sub_group_name(self
):
3256 RulespecGroupMonitoringConfigurationVarious
,
3257 "clustered_services_mapping",
3259 title
=_("Clustered services for overlapping clusters"),
3260 label
=_("Assign services to the following cluster:"),
3261 help=_("It's possible to have clusters that share nodes. You could say that "
3262 "such clusters "overlap". In such a case using the ruleset "
3263 "<i>Clustered services</i> is not sufficient since it would not be clear "
3264 "to which of the several possible clusters a service found on such a shared "
3265 "node should be assigned to. With this ruleset you can assign services and "
3266 "explicitely specify which cluster assign them to."),
3272 RulespecGroupMonitoringConfigurationVarious
,
3273 "extra_host_conf:service_period",
3274 TimeperiodSelection(
3275 title
=_("Service period for hosts"),
3277 "When it comes to availability reporting, you might want the report "
3278 "to cover only certain time periods, e.g. only Monday to Friday "
3279 "from 8:00 to 17:00. You can do this by specifying a service period "
3280 "for hosts or services. In the reporting you can then decide to "
3281 "include, exclude or ignore such periods und thus e.g. create a report "
3282 "of the availability just within or without these times. <b>Note</b>: Changes in the "
3283 "actual <i>definition</i> of a time period will only be reflected in "
3284 "times <i>after</i> that change. Selecting a different service period "
3285 "will also be reflected in the past.")),
3289 RulespecGroupMonitoringConfigurationVarious
,
3290 "extra_service_conf:service_period",
3291 TimeperiodSelection(
3292 title
=_("Service period for services"),
3294 "When it comes to availability reporting, you might want the report "
3295 "to cover only certain time periods, e.g. only Monday to Friday "
3296 "from 8:00 to 17:00. You can do this by specifying a service period "
3297 "for hosts or services. In the reporting you can then decide to "
3298 "include, exclude or ignore such periods und thus e.g. create a report "
3299 "of the availability just within or without these times. <b>Note</b>: Changes in the "
3300 "actual <i>definition</i> of a time period will only be reflected in "
3301 "times <i>after</i> that change. Selecting a different service period "
3302 "will also be reflected in the past.")),
3306 # .--User Interface------------------------------------------------------.
3308 # | | | | |___ ___ _ __ |_ _|_ __ | |_ ___ _ __ / _| __ _ ___ ___ |
3309 # | | | | / __|/ _ \ '__| | || '_ \| __/ _ \ '__| |_ / _` |/ __/ _ \ |
3310 # | | |_| \__ \ __/ | | || | | | || __/ | | _| (_| | (_| __/ |
3311 # | \___/|___/\___|_| |___|_| |_|\__\___|_| |_| \__,_|\___\___| |
3313 # +----------------------------------------------------------------------+
3314 # | User interface specific rule sets |
3315 # '----------------------------------------------------------------------'
3318 @rulespec_group_registry.register
3319 class RulespecGroupUserInterface(RulespecGroup
):
3322 return "user_interface"
3326 return _("User Interface")
3330 return _("Settings concerning the user interface of Check_MK")
3334 RulespecGroupUserInterface
, "extra_host_conf:icon_image",
3337 title
=_("Icon image for hosts in status GUI"),
3338 help=_("You can assign icons to hosts for the status GUI. "
3339 "Put your images into <tt>%s</tt>. ") %
3340 (cmk
.utils
.paths
.omd_root
+ "/local/share/check_mk/web/htdocs/images/icons"),
3342 forth
=lambda v
: v
and (v
.endswith('.png') and v
[:-4]) or v
,
3346 RulespecGroupUserInterface
,
3347 "extra_service_conf:icon_image",
3350 title
=_("Icon image for services in status GUI"),
3351 help=_("You can assign icons to services for the status GUI. "
3352 "Put your images into <tt>%s</tt>. ") %
3353 (cmk
.utils
.paths
.omd_root
+ "/local/share/check_mk/web/htdocs/images/icons"),
3355 forth
=lambda v
: v
and (v
.endswith('.png') and v
[:-4]) or v
,
3360 RulespecGroupUserInterface
,
3361 "host_icons_and_actions",
3363 title
=_("Custom icons or actions for hosts in status GUI"),
3364 help=_("You can assign icons or actions to hosts for the status GUI.")),
3369 RulespecGroupUserInterface
,
3370 "service_icons_and_actions",
3372 title
=_("Custom icons or actions for services in status GUI"),
3373 help=_("You can assign icons or actions to services for the status GUI."),
3380 RulespecGroupUserInterface
, "extra_host_conf:_ESCAPE_PLUGIN_OUTPUT",
3382 title
=_("Escape HTML codes in host output"),
3383 help=_("By default, for security reasons, the GUI does not interpret any HTML "
3384 "code received from external sources, like plugin output or log messages. "
3385 "If you are really sure what you are doing and need to have HTML codes, like "
3386 "links rendered, disable this option. Be aware, you might open the way "
3387 "for several injection attacks.") + _(
3388 "This setting can either be set globally or individually for selected hosts "
3389 "or services using the host or service rulesets."),
3391 ("1", _("Escape HTML codes")),
3392 ("0", _("Don't escape HTML codes (insecure)")),
3398 RulespecGroupUserInterface
,
3399 "extra_service_conf:_ESCAPE_PLUGIN_OUTPUT",
3401 title
=_("Escape HTML codes in service output"),
3402 help=_("By default, for security reasons, the GUI does not interpret any HTML "
3403 "code received from external sources, like plugin output or log messages. "
3404 "If you are really sure what you are doing and need to have HTML codes, like "
3405 "links rendered, disable this option. Be aware, you might open the way "
3406 "for several injection attacks.") + _(
3407 "This setting can either be set globally or individually for selected hosts "
3408 "or services using the host or service rulesets."),
3410 ("1", _("Escape HTML codes")),
3411 ("0", _("Don't escape HTML codes (insecure)")),
3419 @rulespec_group_registry.register
3420 class RulespecGroupAgent(RulespecGroup
):
3427 return _("Access to Agents")
3431 return _("Settings concerning the connection to the Check_MK and SNMP agents")
3434 @rulespec_group_registry.register
3435 class RulespecGroupAgentGeneralSettings(RulespecSubGroup
):
3437 def main_group(self
):
3438 return RulespecGroupAgent
3441 def sub_group_name(self
):
3442 return "general_settings"
3446 return _("General Settings")
3450 RulespecGroupAgentGeneralSettings
,
3452 title
=_("Hosts with dynamic DNS lookup during monitoring"),
3453 help=_("This ruleset selects host for dynamic DNS lookup during monitoring. Normally "
3454 "the IP addresses of hosts are statically configured or looked up when you "
3455 "activate the changes. In some rare cases DNS lookups must be done each time "
3456 "a host is connected to, e.g. when the IP address of the host is dynamic "
3460 RulespecGroupAgentGeneralSettings
, "primary_address_family",
3463 ("ipv4", _("IPv4")),
3464 ("ipv6", _("IPv6")),
3466 title
=_("Primary IP address family of dual-stack hosts"),
3467 help=_("When you configure dual-stack host (IPv4 + IPv6) monitoring in Check_MK, "
3468 "normally IPv4 is used as primary address family to communicate with this "
3469 "host. The other family, IPv6, is just being pinged. You can use this rule "
3470 "to invert this behaviour to use IPv6 as primary address family.")))
3473 @rulespec_group_registry.register
3474 class RulespecGroupAgentSNMP(RulespecSubGroup
):
3476 def main_group(self
):
3477 return RulespecGroupAgent
3480 def sub_group_name(self
):
3489 RulespecGroupAgentSNMP
, "snmp_communities",
3491 title
=_("SNMP credentials of monitored hosts"),
3493 _("By default Check_MK uses the community \"public\" to contact hosts via SNMP v1/v2. This rule "
3494 "can be used to customize the the credentials to be used when contacting hosts via SNMP."
3499 RulespecGroupAgentSNMP
,
3500 "management_board_config",
3502 title
=_("Management board config"),
3504 ("snmp", _("SNMP"), SNMPCredentials()),
3505 ("ipmi", _("IPMI"), IPMIParameters()),
3511 RulespecGroupAgentSNMP
, "snmp_character_encodings",
3513 title
=_("Output text encoding settings for SNMP devices"),
3514 help=_("Some devices send texts in non-ASCII characters. Check_MK"
3515 " always assumes UTF-8 encoding. You can declare other "
3516 " other encodings here"),
3518 ("utf-8", _("UTF-8")),
3519 ("latin1", _("latin1")),
3520 ("cp437", _("cp437")),
3524 RulespecGroupAgentSNMP
,
3526 title
=_("Bulk walk: Hosts using bulk walk (enforces SNMP v2c)"),
3528 "Most SNMP hosts support SNMP version 2c. However, Check_MK defaults to version 1, "
3529 "in order to support as many devices as possible. Please use this ruleset in order "
3530 "to configure SNMP v2c for as many hosts as possible. That version has two advantages: "
3531 "it supports 64 bit counters, which avoids problems with wrapping counters at too "
3532 "much traffic. And it supports bulk walk, which saves much CPU and network resources. "
3533 "Please be aware, however, that there are some broken devices out there, that support "
3534 "bulk walk but behave very bad when it is used. When you want to enable v2c while not using "
3535 "bulk walk, please use the rule set snmpv2c_hosts instead."))
3538 RulespecGroupAgentSNMP
,
3541 title
=_("Bulk walk: Number of OIDs per bulk"),
3542 label
=_("Number of OIDs to request per bulk: "),
3547 help=_("This variable allows you to configure the numbr of OIDs Check_MK should request "
3548 "at once. This rule only applies to SNMP hosts that are configured to be bulk walk "
3550 "You may want to use this rule to tune SNMP performance. Be aware: A higher value "
3551 "is not always better. It may decrease the transactions between Check_MK and the "
3552 "target system, but may increase the OID overhead in case you only need a small "
3557 RulespecGroupAgentSNMP
,
3558 "snmp_without_sys_descr",
3559 title
=_("Hosts without system description OID"),
3560 help=_("Devices which do not publish the system description OID "
3561 ".1.3.6.1.2.1.1.1.0 are normally ignored by the SNMP inventory. "
3562 "Use this ruleset to select hosts which should nevertheless "
3566 RulespecGroupAgentSNMP
,
3568 title
=_("Legacy SNMP devices using SNMP v2c"),
3570 _("There exist a few devices out there that behave very badly when using SNMP v2c and bulk walk. "
3571 "If you want to use SNMP v2c on those devices, nevertheless, you need to configure this device as "
3572 "legacy snmp device and upgrade it to SNMP v2c (without bulk walk) with this rule set. One reason is enabling 64 bit counters. "
3573 "Note: This rule won't apply if the device is already configured as SNMP v2c device."))
3576 RulespecGroupAgentSNMP
,
3579 title
=_("Timing settings for SNMP access"),
3580 help=_("This rule decides about the number of retries and timeout values "
3581 "for the SNMP access to devices."),
3586 title
=_("Response timeout for a single query"),
3588 "After a request is sent to the remote SNMP agent we will wait up to this "
3589 "number of seconds until assuming the answer get lost and retrying."),
3600 title
=_("Number of retries"),
3613 RulespecGroupAgentSNMP
,
3614 "non_inline_snmp_hosts",
3615 title
=_("Hosts not using Inline-SNMP"),
3616 help=_("Check_MK has an efficient SNMP implementation called Inline SNMP which reduces the "
3617 "load produced by SNMP monitoring on the monitoring host significantly. This option is "
3618 "enabled by default for all SNMP hosts and it is a good idea to keep this default "
3619 "setting. However, there are SNMP devices which have problems with this SNMP "
3620 "implementation. You can use this rule to disable Inline SNMP for these hosts."))
3623 RulespecGroupAgentSNMP
,
3625 title
=_("Simulating SNMP by using a stored SNMP walk"),
3626 help=_("This ruleset helps in test and development. You can create stored SNMP "
3627 "walks on the command line with cmk --snmpwalk HOSTNAME. A host that "
3628 "is configured with this ruleset will then use the information from that "
3629 "file instead of using real SNMP. "))
3632 RulespecGroupAgentSNMP
,
3634 Integer(minvalue
=1, maxvalue
=65535, default_value
=161),
3635 title
=_("UDP port used for SNMP"),
3636 help=_("This variable allows you to customize the UDP port to "
3637 "be used to communicate via SNMP on a per-host-basis."),
3641 @rulespec_group_registry.register
3642 class RulespecGroupAgentCMKAgent(RulespecSubGroup
):
3644 def main_group(self
):
3645 return RulespecGroupAgent
3648 def sub_group_name(self
):
3649 return "check_mk_agent"
3653 return _("Check_MK Agent")
3657 RulespecGroupAgentCMKAgent
,
3659 Integer(minvalue
=1, maxvalue
=65535, default_value
=6556),
3660 title
=_("TCP port for connection to Check_MK agent"),
3661 help=_("This variable allows to specify the TCP port to "
3662 "be used to connect to the agent on a per-host-basis. "),
3666 RulespecGroupAgentCMKAgent
,
3667 "tcp_connect_timeouts",
3673 title
=_("Agent TCP connect timeout"),
3675 "Timeout for TCP connect to the Check_MK agent in seconds. If the connection "
3676 "to the agent cannot be established within this time, it is considered to be unreachable. "
3677 "Note: This does <b>not</b> limit the time the agent needs to "
3678 "generate its output. "
3679 "This rule can be used to specify a timeout on a per-host-basis."),
3683 RulespecGroupAgentCMKAgent
,
3687 ("passphrase", PasswordSpec(title
=_("Encryption secret"), allow_empty
=False)),
3690 title
=_("Encryption for Agent"),
3691 help=_("Choose if the agent agents encrypt packages. This controls whether "
3692 "baked agents encrypt their output and whether check_mk expects "
3693 "encrypted output. "
3694 "Please note: If you opt to enforce encryption, "
3695 "agents that don't support encryption will not work any more. "
3696 "Further note: This only affects regular agents, not special agents "
3697 "aka datasource programs."),
3698 default_value
="disable",
3699 choices
=[("enforce", _("Enforce (drop unencrypted data)")),
3700 ("allow", _("Enable (accept encrypted and unencrypted data)")),
3701 ("disable", _("Disable (drop encrypted data)"))])),
3704 title
=_("Encryption for Realtime Updates"),
3705 help=_("Choose if realtime updates are sent/expected encrypted"),
3706 default_value
="enforce",
3707 choices
=[("enforce", _("Enforce (drop unencrypted data)")),
3708 ("allow", _("Enable (accept encrypted and unencrypted data)")),
3709 ("disable", _("Disable (drop encrypted data)"))])),
3712 title
=_("Encryption"),
3713 help=_("Control encryption of data sent from agent to host."),
3717 def _common_check_mk_exit_status_elements():
3721 MonitoringState(default_value
=2, title
=_("State in case of empty output")),
3725 MonitoringState(default_value
=2, title
=_("State in case of connection problems")),
3729 MonitoringState(default_value
=2, title
=_("State in case of a timeout")),
3733 MonitoringState(default_value
=3, title
=_("State in case of unhandled exception")),
3738 def transform_exit_code_spec(p
):
3741 return {"overall": p
}
3745 RulespecGroupAgentCMKAgent
,
3746 "check_mk_exit_status",
3752 title
=_("Overall status"),
3753 elements
=_common_check_mk_exit_status_elements() + [
3757 default_value
=1, title
=_("State in case of wrong agent version")),
3763 title
=_("State if just <i>some</i> agent sections are missing")),
3766 "specific_missing_sections",
3772 _('Beside of setting the generic "Missing sections" state above '
3773 'you can specify a regex pattern to match specific section names and '
3774 'give them an individual state in case they are missing. '
3775 'Note that the first match is used.'),
3776 mode
=RegExpUnicode
.prefix
),
3779 orientation
="horizontal"),
3780 title
=_("State if specific sections are missing"),
3786 title
=_("Individual states per data source"),
3791 elements
=_common_check_mk_exit_status_elements() + [
3796 title
=_("State in case of wrong agent version")),
3801 title
=_("Programs"),
3802 elements
=_common_check_mk_exit_status_elements())),
3805 title
=_("Programs"),
3806 elements
=_common_check_mk_exit_status_elements())),
3809 title
=_("SNMP"), elements
=_common_check_mk_exit_status_elements())),
3812 title
=_("SNMP Management Board"),
3813 elements
=_common_check_mk_exit_status_elements())),
3816 title
=_("IPMI Management Board"),
3817 elements
=_common_check_mk_exit_status_elements())),
3820 title
=_("Piggyback"),
3821 elements
=_common_check_mk_exit_status_elements())),
3824 optional_keys
=["individual"],
3826 forth
=transform_exit_code_spec
),
3829 "missing_sections": 1,
3834 title
=_("Status of the Check_MK services"),
3835 help=_("This ruleset specifies the total status of the Check_MK services <i>Check_MK</i>, "
3836 "<i>Check_MK Discovery</i> and <i>Check_MK HW/SW Inventory</i> in case of various "
3837 "error situations. One use case is the monitoring of hosts that are not always up. "
3838 "You can have Check_MK an OK status here if the host is not reachable. Note: the "
3839 "<i>Timeout</i> setting only works when using the Check_MK Micro Core."),
3844 RulespecGroupAgentCMKAgent
,
3845 "check_mk_agent_target_versions",
3848 title
=_("Check for correct version of Check_MK agent"),
3849 help=_("Here you can make sure that all of your Check_MK agents are running"
3850 " one specific version. Agents running "
3851 " a different version return a non-OK state."),
3853 ("ignore", _("Ignore the version")),
3854 ("site", _("Same version as the monitoring site")),
3855 ("specific", _("Specific version"), TextAscii(allow_empty
=False,)),
3856 ("at_least", _("At least"),
3857 Dictionary(elements
=[
3858 ('release', TextAscii(
3859 title
=_('Official Release version'),
3862 ('daily_build', TextAscii(
3863 title
=_('Daily build'),
3868 default_value
="ignore",
3870 # In the past, this was a OptionalDropdownChoice() which values could be strings:
3871 # ignore, site or a custom string representing a version number.
3872 forth
=lambda x
: isinstance(x
, str) and x
not in ["ignore", "site"] and ("specific", x
) or x
,
3876 @rulespec_group_registry.register
3877 class RulespecGroupMonitoringAgents(RulespecGroup
):
3884 return _("Monitoring Agents")
3888 return _("Configuration of monitoring agents for Linux, Windows and Unix")
3891 @rulespec_group_registry.register
3892 class RulespecGroupMonitoringAgentsGenericOptions(RulespecSubGroup
):
3894 def main_group(self
):
3895 return RulespecGroupMonitoringAgents
3898 def sub_group_name(self
):
3899 return "generic_options"
3903 return _("Generic Options")
3907 RulespecGroupMonitoringAgentsGenericOptions
,
3908 "agent_config:only_from",
3910 valuespec
=IPNetwork(),
3911 title
=_("Allowed agent access via IP address"),
3912 help=_("This rule allows you to restrict the access to the "
3913 "Check_MK agent to certain IP addresses and networks. "
3914 "Usually you configure just the IP addresses of your "
3915 "Check_MK servers here. You can enter either IP addresses "
3916 "in the form <tt>1.2.3.4</tt> or networks in the style "
3917 "<tt>1.2.0.0/16</tt>. If you leave this configuration empty "
3918 "or create no rule then <b>all</b> addresses are allowed to "
3919 "access the agent. IPv6 addresses and networks are also allowed."),
3924 RulespecGroupAgentGeneralSettings
,
3925 "piggyback_translation",
3926 HostnameTranslation(
3927 title
=_("Hostname translation for piggybacked hosts"),
3929 "Some agents or agent plugins send data not only for the queried host but also "
3930 "for other hosts "piggyback" with their own data. This is the case "
3931 "for the vSphere special agent and the SAP R/3 plugin, for example. The hostnames "
3932 "that these agents send must match your hostnames in your monitoring configuration. "
3933 "If that is not the case, then with this rule you can define a hostname translation. "
3934 "Note: This rule must be configured for the "pig" - i.e. the host that the "
3935 "agent is running on. It is not applied to the translated piggybacked hosts."),
3940 RulespecGroupAgentGeneralSettings
,
3941 "service_description_translation",
3942 ServiceDescriptionTranslation(
3943 title
=_("Translation of service descriptions"),
3945 "Within this ruleset service descriptions can be translated similar to the ruleset "
3946 "<tt>Hostname translation for piggybacked hosts</tt>. Services such as "
3947 "<tt>Check_MK</tt>, <tt>Check_MK Agent</tt>, <tt>Check_MK Discovery</tt>, "
3948 "<tt>Check_MK inventory</tt>, and <tt>Check_MK HW/SW Inventory</tt> are excluded. "
3949 "<b>Attention:</b><ul>"
3950 "<li>Downtimes and other configured rules which match these "
3951 "services have to be adapted.</li>"
3952 "<li>Performance data and graphs will begin from scratch for translated services.</li>"
3953 "<li>Especially configured check parameters keep their functionality further on.</li>"
3954 "<li>This new ruleset translates also the item part of a service description. "
3955 "This means that after such a translation the item may be gone but is used in the "
3956 "conditions of the parameters further on if any parameters are configured. "
3957 "This might be confusing.</li></ul>"
3958 "This rule should only be configured in the early stages."),
3963 def get_snmp_checktypes():
3964 checks
= watolib
.check_mk_local_automation("get-check-information")
3965 types
= [(cn
, (c
['title'] != cn
and '%s: ' % cn
or '') + c
['title'])
3966 for (cn
, c
) in checks
.items()
3969 return [(None, _('All SNMP Checks'))] + types
3972 def get_snmp_section_names():
3973 checks
= watolib
.check_mk_local_automation("get-check-information")
3974 return [(None, _('All SNMP Checks'))] + sorted(
3975 [(cn
, cn
) for (cn
, c
) in checks
.items() if c
['snmp']])
3979 RulespecGroupAgentSNMP
,
3980 "snmp_check_interval",
3982 title
=_('Check intervals for SNMP checks'),
3983 help=_('This rule can be used to customize the check interval of each SNMP based check. '
3984 'With this option it is possible to configure a longer check interval for specific '
3985 'checks, than then normal check interval.'),
3990 help=_("You can only configure \"section names\" here and not choose all "
3991 "individual SNMP based checks here. It is only possible to define "
3992 "SNMP check intervals for main checks and all the related sub "
3993 "checks together. The reason for this is that the data of the "
3994 "main check and it's sub checks is defined for the whole group "
3995 "of checks in the main check and also fetched for all these "
3996 "checks together."),
3997 choices
=get_snmp_section_names
,
3999 # Transform check types to section names
4000 forth
=lambda e
: e
.split(".")[0] if e
is not None else None,
4003 title
=_("Do check every"),
4011 RulespecGroupAgentSNMP
, "snmpv3_contexts",
4013 title
=_('SNMPv3 contexts to use in requests'),
4014 help=_('By default Check_MK does not use a specific context during SNMPv3 queries, '
4015 'but some devices are offering their information in different SNMPv3 contexts. '
4016 'This rule can be used to configure, based on hosts and check type, which SNMPv3 '
4017 'contexts Check_MK should ask for when getting information via SNMPv3.'),
4020 title
=_("Checktype"),
4021 choices
=get_snmp_checktypes
,
4024 title
=_("SNMP Context IDs"),