Module: check_mk
Branch: master
Commit: 84776aa08638776b06d6a9f21ea2bad781849a3f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=84776aa0863877…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Nov 6 11:56:10 2010 +0100
check for duplicate service descriptions
---
ChangeLog | 3 +++
LIESMICH.zutun | 3 ---
modules/check_mk.py | 23 +++++++++++++++++++++++
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0d46dd5..53c5e4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,9 @@
is called from another directory)
* ALL_SERVICES: Instead of [ "" ] you can now write ALL_SERVICES
* debug_log: also output Check_MK version, check item and check parameters
+ * Make sure, host has no duplicate service - this is possible e.g. by
+ monitoring via agent and snmp in parallel. duplicate services will
+ make Nagios reject the configuration.
Checks & Agents:
* megaraid_pdisks: Using the real enclosure number as check item now
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index b955bd2..6e83eb1 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -4,9 +4,6 @@ Doku: Check_MK und OMD: Installieren von MKPs, local-Hierarchie
--------------------------------------------------------------------------------
BUGS beheben ab 1.1.9i1
--------------------------------------------------------------------------------
-Wenn zwei Checks mit dem gleichen Namen existieren bei einem Host
-soll mit einem Fehler abgebrochen werden.
-
ich bin mir nicht sicher ob das nun ein Thruk Problem oder ein Livestatus Problem ist. Vermutlich beides :-)
Wenn ich im Thruk im Suchfenster einfach Enter drücke, kommt folgende Query bei raus:
GET services
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 8da1029..5f75973 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1292,7 +1292,19 @@ def create_nagios_servicedefs(outfile, hostname):
aggregated_services_conf = set([])
do_aggregation = host_is_aggregated(hostname)
have_at_least_one_service = False
+ used_descriptions = {}
for ((checkname, item), (params, description, deps)) in host_checks:
+ # Make sure, the service description is unique on this host
+ if description in used_descriptions:
+ cn, it = used_descriptions[description]
+ raise MKGeneralException(
+ "ERROR: Duplicate service description '%s' for host '%s'!\n"
+ " - 1st occurrance: checktype = %s, item = %r\n"
+ " - 2nd occurrance: checktype = %s, item = %r\n" %
+ (description, hostname, cn, it, checkname, item))
+
+ else:
+ used_descriptions[description] = ( checkname, item )
if have_perfdata(checkname):
template = passive_service_template_perf
else:
@@ -1420,6 +1432,17 @@ define servicedependency {
if len(legchecks) > 0:
outfile.write("\n\n# Legacy checks\n")
for command, description, has_perfdata in legchecks:
+ if description in used_descriptions:
+ cn, it = used_descriptions[description]
+ raise MKGeneralException(
+ "ERROR: Duplicate service description (legacy check) '%s' for host '%s'!\n"
+ " - 1st occurrance: checktype = %s, item = %r\n"
+ " - 2nd occurrance: checktype = legacy(%s), item = None\n" %
+ (description, hostname, cn, it, command))
+
+ else:
+ used_descriptions[description] = ( "legacy(" + command + ")", item )
+
extraconf = extra_service_conf_of(hostname, description)
if has_perfdata:
template = "check_mk_perf,"
Module: check_mk
Branch: master
Commit: 3d768877d284ad19bc836315220224306421b99e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d768877d284ad…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Nov 6 11:09:08 2010 +0100
snmp_communites now must be a dict
---
ChangeLog | 2 ++
LIESMICH.zutun | 4 ----
modules/check_mk.py | 20 ++++++++------------
3 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8f924a9..34c5822 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
* aggregation_output_format now defaults to "multiline"
* Removed non_bulkwalk_hosts. You can use bulkwalk_hosts with NEGATE
instead (see docu)
+ * snmp_communites is now initialized with [], not with {}. It cannot
+ be a dict any longer.
Core, Setup, etc.:
* Improve error handling: if hosts are monitored with SNMP *and* TCP,
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index a4235f5..b955bd2 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -94,10 +94,6 @@ auftritt.
nur noch ohne MIB-Dateien. Das würde das ganze deutlich vereinfachen!
Direct rrd updates ganz entfernen.
-snmp_communities: dictionary nicht mehr verwenden, aus Doku raus, Defaultwert
-leere Liste, aus Code raus, Hinweis im ChangeLog. Evtl einen Test mit
-Abbruch, wenn immer noch type ist dict. Gleiches für bulkwalk_hosts
-
IDEE: Scan-Modus: Wenn man einen Host per SNMP scannt und *keine*
Antwort kommt, dann probiert man einfach alle SNMP-Checks aus.
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 111336e..cf8ebc2 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -214,7 +214,7 @@ max_num_processes = 50
# SNMP communities
snmp_default_community = 'public'
-snmp_communities = {}
+snmp_communities = []
# Inventory and inventory checks
inventory_check_interval = None # Nagios intervals (4h = 240)
@@ -587,16 +587,9 @@ def snmp_base_command(what, hostname):
# the snmp_default_community is returned (wich is preset with
# "public", but can be overridden in main.mk
def snmp_credentials_of(hostname):
- # Keep up old behaviour for a while...
- if type(snmp_communities) == dict:
- for com, hostlist in snmp_communities.items():
- if hostname in strip_tags(hostlist):
- return com
-
- else:
- communities = host_extra_conf(hostname, snmp_communities)
- if len(communities) > 0:
- return communities[0]
+ communities = host_extra_conf(hostname, snmp_communities)
+ if len(communities) > 0:
+ return communities[0]
# nothing configured for this host -> use default
return snmp_default_community
@@ -3462,8 +3455,11 @@ if opt_config_check:
if filesystem_levels != []:
sys.stderr.write("WARNING: filesystem_levels is deprecated and will be removed\n"
"any decade now. Please use check_parameters instead! Details can be\n"
- "found at http://mathias-kettner.de/checkmk_check_parameters.html.\n");
+ "found at http://mathias-kettner.de/checkmk_check_parameters.html.\n")
+ if type(snmp_communities) == dict:
+ sys.stderr.write("ERROR: snmp_communities cannot be a dict any more.\n")
+ errors += 1
if errors > 0:
sys.stderr.write("--> Found %d invalid variables\n" % errors)
Module: check_mk
Branch: master
Commit: 0e30525fcef8f1c55be4e6b418c9ec8c05b670a2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0e30525fcef8f1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Nov 6 10:37:40 2010 +0100
aggregation_output_format now defaults to multiline
---
ChangeLog | 3 ++-
LIESMICH.zutun | 2 --
modules/check_mk.py | 2 +-
3 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b0d938b..11fac0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,7 +13,8 @@
* perfdata_format now defaults to "pnp". Previous default was "standard".
You might have to change that in main.mk if you are not using PNP (only
relevant for MRPE checks)
- * inventory_check_severity default to 1 now (WARNING)
+ * inventory_check_severity defaults to 1 now (WARNING)
+ * aggregation_output_format now defaults to "multiline"
Checks & Agents:
* megaraid_pdisks: Using the real enclosure number as check item now
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 61a2842..fa64229 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -96,8 +96,6 @@ nur noch ohne MIB-Dateien. Das würde das ganze deutlich vereinfachen!
filesystem_levels rausnehmen. Hinweis, dass check_parameters verwendet
werden soll.
-aggregation_output_format: Aggregation per Default auf mehrzeilige Ausgabe
-
Direct rrd updates ganz entfernen.
snmp_communities: dictionary nicht mehr verwenden, aus Doku raus, Defaultwert
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 7289b7f..ddd8628 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -268,7 +268,7 @@ service_aggregations = []
service_dependencies = []
non_aggregated_hosts = []
aggregate_check_mk = False
-aggregation_output_format = "single" # new in 1.1.6. Possible also: "multiline"
+aggregation_output_format = "multiline" # new in 1.1.6. Possible also: "multiline"
summary_host_groups = []
summary_service_groups = [] # service groups for aggregated services
summary_service_contactgroups = [] # service contact groups for aggregated services
Module: check_mk
Branch: master
Commit: e8c6f78f1f0b5f8e03194140326ca5c56023672f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e8c6f78f1f0b5f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Nov 6 10:42:14 2010 +0100
Remove non_bulkwalk_hosts
---
ChangeLog | 15 ++++++++++-----
LIESMICH.zutun | 3 ---
modules/check_mk.py | 3 ---
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 11fac0c..94a5064 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,13 @@
1.1.9i1
+ INCOMPATIBLE CHANGES:
+ * perfdata_format now defaults to "pnp". Previous default was "standard".
+ You might have to change that in main.mk if you are not using PNP (only
+ relevant for MRPE checks)
+ * inventory_check_severity defaults to 1 now (WARNING)
+ * aggregation_output_format now defaults to "multiline"
+ * Removed non_bulkwalk_hosts. You can use bulkwalk_hosts with NEGATE
+ instead (see docu)
+
Core, Setup, etc.:
* Improve error handling: if hosts are monitored with SNMP *and* TCP,
then after an error with one of those two agents checks from the
@@ -10,11 +19,7 @@
* Inventory: Better error handling on invalid inventory result of checks
* setup.sh: fix problem with missing package_info (only appears if setup
is called from another directory)
- * perfdata_format now defaults to "pnp". Previous default was "standard".
- You might have to change that in main.mk if you are not using PNP (only
- relevant for MRPE checks)
- * inventory_check_severity defaults to 1 now (WARNING)
- * aggregation_output_format now defaults to "multiline"
+
Checks & Agents:
* megaraid_pdisks: Using the real enclosure number as check item now
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index fa64229..3cd0b66 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -104,9 +104,6 @@ Abbruch, wenn immer noch type ist dict. Gleiches für bulkwalk_hosts
[""] deprecaten, aus der Doku raus und durch ALL_SERVICES ersetzen
-non_bulkwalk_hosts rausschmeissen. Kann man mit NEGATE nachbilden
-mit bulkwalk_hosts.
-
IDEE: Scan-Modus: Wenn man einen Host per SNMP scannt und *keine*
Antwort kommt, dann probiert man einfach alle SNMP-Checks aus.
diff --git a/modules/check_mk.py b/modules/check_mk.py
index ddd8628..4d07886 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -246,7 +246,6 @@ legacy_checks = []
all_hosts = []
snmp_hosts = [ (['snmp'], ALL_HOSTS) ]
bulkwalk_hosts = None
-non_bulkwalk_hosts = None
usewalk_hosts = []
ignored_checktypes = [] # exclude from inventory
ignored_services = [] # exclude from inventory
@@ -611,8 +610,6 @@ def is_snmp_host(hostname):
def is_bulkwalk_host(hostname):
if bulkwalk_hosts:
return in_binary_hostlist(hostname, bulkwalk_hosts)
- elif non_bulkwalk_hosts:
- return not in_binary_hostlist(hostname, non_bulkwalk_hosts)
else:
return False
Module: check_mk
Branch: master
Commit: e1a1dea348ee85a687b49b0166ffd487677ea332
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e1a1dea348ee85…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Nov 6 10:53:39 2010 +0100
Allow ALL_SERVICES
---
ChangeLog | 1 +
LIESMICH.zutun | 12 ++++++++----
modules/check_mk.py | 9 +++++++++
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 94a5064..8f924a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@
* Inventory: Better error handling on invalid inventory result of checks
* setup.sh: fix problem with missing package_info (only appears if setup
is called from another directory)
+ * ALL_SERVICES: Instead of [ "" ] you can now write ALL_SERVICES
Checks & Agents:
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 3cd0b66..63e9399 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -92,10 +92,6 @@ auftritt.
--snmpwalk: Braucht man das translaten noch? Ich arbeite doch jetzt eh
nur noch ohne MIB-Dateien. Das würde das ganze deutlich vereinfachen!
-
-filesystem_levels rausnehmen. Hinweis, dass check_parameters verwendet
-werden soll.
-
Direct rrd updates ganz entfernen.
snmp_communities: dictionary nicht mehr verwenden, aus Doku raus, Defaultwert
@@ -113,6 +109,14 @@ Icons.
Host- und Serviceicons (icon_image) anzeigen.
--------------------------------------------------------------------------------
+ab 1.1.11i1
+
+filesystem_levels wirklich rausnehmen. Hinweis, dass check_parameters verwendet
+werden soll.
+
+
+--------------------------------------------------------------------------------
+--------------------------------------------------------------------------------
UNSCHOENHEITEN
--------------------------------------------------------------------------------
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 4d07886..111336e 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -195,6 +195,7 @@ else:
PHYSICAL_HOSTS = [ '@physical' ] # all hosts but not clusters
CLUSTER_HOSTS = [ '@cluster' ] # all cluster hosts
ALL_HOSTS = [ '@all' ] # physical and cluster hosts
+ALL_SERVICES = [ "" ] # optical replacement"
NEGATE = '@negate' # negation in boolean lists
# Basic Settings
@@ -3456,6 +3457,14 @@ if opt_config_check:
if name not in ignored_variables and name not in vars_before_config:
sys.stderr.write("Invalid configuration variable '%s'\n" % name)
errors += 1
+
+ # Special handling for certain deprecated variables
+ if filesystem_levels != []:
+ sys.stderr.write("WARNING: filesystem_levels is deprecated and will be removed\n"
+ "any decade now. Please use check_parameters instead! Details can be\n"
+ "found at http://mathias-kettner.de/checkmk_check_parameters.html.\n");
+
+
if errors > 0:
sys.stderr.write("--> Found %d invalid variables\n" % errors)
sys.stderr.write("If you use own helper variables, please prefix them with _.\n")
Module: check_mk
Branch: master
Commit: bf18408779489d535579763351e8deae79e68a52
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bf18408779489d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Nov 6 10:59:13 2010 +0100
deprecate filesystem_levels
---
LIESMICH.zutun | 4 ++--
checkman/df | 16 ++++++----------
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 63e9399..a4235f5 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -98,8 +98,6 @@ snmp_communities: dictionary nicht mehr verwenden, aus Doku raus, Defaultwert
leere Liste, aus Code raus, Hinweis im ChangeLog. Evtl einen Test mit
Abbruch, wenn immer noch type ist dict. Gleiches für bulkwalk_hosts
-[""] deprecaten, aus der Doku raus und durch ALL_SERVICES ersetzen
-
IDEE: Scan-Modus: Wenn man einen Host per SNMP scannt und *keine*
Antwort kommt, dann probiert man einfach alle SNMP-Checks aus.
@@ -114,6 +112,8 @@ ab 1.1.11i1
filesystem_levels wirklich rausnehmen. Hinweis, dass check_parameters verwendet
werden soll.
+[""] deprecaten, aus der Doku raus und durch ALL_SERVICES ersetzen. Das geht
+aber erst, wenn eine stabile Version das ALL_SERVICES erlaubt!
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
diff --git a/checkman/df b/checkman/df
index 135e314..65aa318 100644
--- a/checkman/df
+++ b/checkman/df
@@ -33,17 +33,17 @@ examples:
# Override warning/critical levels for all checks where
# levels are "filesystem_default_levels"
- filesystem_levels = [
+ check_parameters = [
# Hosts with tag "vms" get 85/95
- ( (85, 95), ["vms"], ALL_HOSTS, [ "" ] ),
+ ( (85, 95), ["vms"], ALL_HOSTS, [ "fs_" ] ),
# all /sapdata partitions will never be critical
- ( (101, 101), ALL_HOSTS, [ "/sapdata$" ] ),
+ ( (101, 101), ALL_HOSTS, [ "fs_/sapdata$" ] ),
# Partitions below "/var" get 80/90 with magic factor 0.5
- ( (80, 90, 0.5), ALL_HOSTS, [ "/var" ] ),
+ ( (80, 90, 0.5), ALL_HOSTS, [ "fs_/var" ] ),
# /usr and /opt on hosts zlnx01 and zlnx02
- ( (98, 99), [ "zlnx01", "zlnx02" ], [ "/usr$", "/opt$" ] ),
+ ( (98, 99), [ "zlnx01", "zlnx02" ], [ "fs_/usr$", "fs_/opt$" ] ),
# All filesystems on clusters get 80/95
- ( (80, 95), ALL_CLUSTERS, [ "" ] )
+ ( (80, 95), ALL_CLUSTERS, [ "fs_" ] )
]
# Exclude certain filesystems from being inventorized at all
@@ -81,10 +81,6 @@ filesystem_default_levels (int, int): Default levels for filesystem detected by
df_magicnumber_normsize (float): Reference filesystem size in GB. Default is 20.0.
Levels for File systems larger then that will be raised by a magic
factor < 1.0. Level for smaller filesystems will be lowered.
-filesystem_levels: Configuration list that allows you to specify
- filesystem levels for groups of hosts and mount points. The configuration
- is analogous to that of {service_contactgroups}. The list is processed from
- top to bottom. The first match wins.
df_lowest_warning_level (int): When using a magic number, the warning level will never drop
below this value. The default is {50} (percent).
df_lowest_critical_level (int): When using a magic number, the critical level will never drop
Module: check_mk
Branch: master
Commit: b53951620445a8fbb853e095e2f2eafe51745d99
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b53951620445a8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Nov 6 10:14:51 2010 +0100
Inventory checks: severity defaults to 1 now
---
ChangeLog | 1 +
LIESMICH.zutun | 2 --
modules/check_mk.py | 2 +-
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 73bc1e1..b0d938b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
* perfdata_format now defaults to "pnp". Previous default was "standard".
You might have to change that in main.mk if you are not using PNP (only
relevant for MRPE checks)
+ * inventory_check_severity default to 1 now (WARNING)
Checks & Agents:
* megaraid_pdisks: Using the real enclosure number as check item now
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 5985abe..61a2842 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -100,8 +100,6 @@ aggregation_output_format: Aggregation per Default auf mehrzeilige Ausgabe
Direct rrd updates ganz entfernen.
-Inventurchecks: severity per Default auf 1 stellen.
-
snmp_communities: dictionary nicht mehr verwenden, aus Doku raus, Defaultwert
leere Liste, aus Code raus, Hinweis im ChangeLog. Evtl einen Test mit
Abbruch, wenn immer noch type ist dict. Gleiches für bulkwalk_hosts
diff --git a/modules/check_mk.py b/modules/check_mk.py
index e9d5236..7289b7f 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -217,7 +217,7 @@ snmp_communities = {}
# Inventory and inventory checks
inventory_check_interval = None # Nagios intervals (4h = 240)
-inventory_check_severity = 2 # critical
+inventory_check_severity = 1 # warning
inventory_max_cachefile_age = 120 # secs.
always_cleanup_autochecks = False