Module: check_mk
Branch: master
Commit: 0c8dfb5f48e6df4518866eb2356b7bea93b71ec5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0c8dfb5f48e6df…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 26 23:27:40 2013 +0200
Updated some inline documentation
---
modules/check_mk.py | 48 ++++++++++++++++++++++++++----------------------
1 file changed, 26 insertions(+), 22 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index a1bc479..9611dd2 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -48,6 +48,17 @@ else:
opt_verbose = False
opt_debug = False
+#.
+# .--Pathnames-----------------------------------------------------------.
+# | ____ _ _ |
+# | | _ \ __ _| |_| |__ _ __ __ _ _ __ ___ ___ ___ |
+# | | |_) / _` | __| '_ \| '_ \ / _` | '_ ` _ \ / _ \/ __| |
+# | | __/ (_| | |_| | | | | | | (_| | | | | | | __/\__ \ |
+# | |_| \__,_|\__|_| |_|_| |_|\__,_|_| |_| |_|\___||___/ |
+# | |
+# '----------------------------------------------------------------------'
+
+
# are we running OMD? If yes, honor local/ hierarchy
omd_root = os.getenv("OMD_ROOT", None)
if omd_root:
@@ -72,15 +83,6 @@ else:
local_doc_dir = None
local_locale_dir = None
-# +----------------------------------------------------------------------+
-# | ____ _ _ |
-# | | _ \ __ _| |_| |__ _ __ __ _ _ __ ___ ___ ___ |
-# | | |_) / _` | __| '_ \| '_ \ / _` | '_ ` _ \ / _ \/ __| |
-# | | __/ (_| | |_| | | | | | | (_| | | | | | | __/\__ \ |
-# | |_| \__,_|\__|_| |_|_| |_|\__,_|_| |_| |_|\___||___/ |
-# | |
-# +----------------------------------------------------------------------+
-
# Pathnames, directories and other settings. All these settings
# should be overriden by /usr/share/check_mk/modules/defaults, which
# is created by setup.sh. The user might override those values again
@@ -185,18 +187,18 @@ else:
check_mk_basedir = default_config_dir
check_mk_configfile = default_config_dir + "/main.mk"
-
-# +----------------------------------------------------------------------+
-# | ____ _ ____ __ _ _ |
-# | / ___| ___| |_ | _ \ ___ / _| __ _ _ _| | |_ ___ |
-# | \___ \ / _ \ __| | | | |/ _ \ |_ / _` | | | | | __/ __| |
-# | ___) | __/ |_ | |_| | __/ _| (_| | |_| | | |_\__ \ |
-# | |____/ \___|\__| |____/ \___|_| \__,_|\__,_|_|\__|___/ |
+#.
+# .--Defaults------------------------------------------------------------.
+# | ____ __ _ _ |
+# | | _ \ ___ / _| __ _ _ _| | |_ ___ |
+# | | | | |/ _ \ |_ / _` | | | | | __/ __| |
+# | | |_| | __/ _| (_| | |_| | | |_\__ \ |
+# | |____/ \___|_| \__,_|\__,_|_|\__|___/ |
# | |
# +----------------------------------------------------------------------+
-
-# Before we read the configuration files we create default settings
-# for all variables. The user can easily override them.
+# | Before we read the configuration files we create default settings |
+# | for all variables. The user can easily override them. |
+# '----------------------------------------------------------------------'
# define magic keys for use in host extraconf lists
PHYSICAL_HOSTS = [ '@physical' ] # all hosts but not clusters
@@ -571,6 +573,7 @@ def aggregated_service_name(hostname, servicedesc):
return aggrname
return ""
+#.
# .--Helpers-------------------------------------------------------------.
# | _ _ _ |
# | | | | | ___| |_ __ ___ _ __ ___ |
@@ -2459,9 +2462,8 @@ def quote_nagios_string(s):
return "'" + s.replace('\\',
'\\\\').replace("'",
"'\"'\"'").replace('!', '\\!') +
"'"
-
-
-# +----------------------------------------------------------------------+
+#.
+# .--Inventory-----------------------------------------------------------.
# | ___ _ |
# | |_ _|_ ____ _____ _ __ | |_ ___ _ __ _ _ |
# | | || '_ \ \ / / _ \ '_ \| __/ _ \| '__| | | | |
@@ -2469,6 +2471,8 @@ def quote_nagios_string(s):
# | |___|_| |_|\_/ \___|_| |_|\__\___/|_| \__, | |
# | |___/ |
# +----------------------------------------------------------------------+
+# | Automatic service detection |
+# '----------------------------------------------------------------------'
def inventorable_checktypes(what): # snmp, tcp, all