Module: check_mk
Branch: master
Commit: eaefee9909057fbf3daacca1119c0688f3c08f47
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eaefee9909057f…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Sep 19 09:47:54 2013 +0200
Updated bug entries #1057
---
.bugs/1057 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/.bugs/1057 b/.bugs/1057
new file mode 100644
index 0000000..e4d27f3
--- /dev/null
+++ b/.bugs/1057
@@ -0,0 +1,10 @@
+Title: Beim Clicken auf Vorschau wird neue Angebotsnummer generiert
+Component: wato
+State: open
+Date: 2013-09-19 09:39:02
+Targetversion: future
+Class: bug
+
+Klicken man beim Erstellen eines Angebots auf den Vorschau-Button, wird anscheinend immer
+eine neue Angebotsnummer erzeugt. Sinnvoll vermutlich, dass nur das erste Mal eine Angebotsnummer
+erzeugt wird.
Module: check_mk
Branch: master
Commit: 736ef415552ccb4fef22f3967bc8b5a52a89727b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=736ef415552ccb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 19 09:25:36 2013 +0200
snapshot removal: only try to remove snapshot files
---
ChangeLog | 6 ++++--
web/htdocs/wato.py | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d8b89fd..95702e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -188,6 +188,8 @@
Host/Service/Contact Groups, Timeperiods and Roles
* Removed "do not connect" option from site socket editor. Use the
checkbox "Disable" to disable the site for multisite.
+ * ADD: Rule to check state of physical switch (currently used by etherbox check)
+ * ADD: new ruleset cisco_wlc: Allows to configure handling of missing AP
* FIX: do validation of check items in rule editor
* FIX: More consistent handling of folderpath select in rule editor
* FIX: Now correctly handling depends_on_tags on page rendering for
@@ -196,10 +198,10 @@
large" error messages during submitting forms
* FIX: automation snmp scan now adhere rules for shoddy snmp devices
which have no sys description
- * ADD: Rule to check state of physical switch (currently used by etherbox check)
* FIX: Cisco ruleset "Cisco WLC WiFi client connections" has been generalized to
"WLC WiFi client connections"
- * ADD: new ruleset cisco_wlc: Allows to configure handling of missing AP
+ * FIX: Snapshot handling is a little more robust agains manually created
+ files in snapshot directory now
Notifications:
* Flexible Notification can now filter service levels
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index d3f409a..40aba20 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5292,7 +5292,8 @@ def create_snapshot():
# Maintenance, remove old snapshots
snapshots = []
for f in os.listdir(snapshot_dir):
- snapshots.append(f)
+ if f.startswith('wato-snapshot-') and f.endswith('.tar.gz'):
+ snapshots.append(f)
snapshots.sort(reverse=True)
while len(snapshots) > config.wato_max_snapshots:
log_audit(None, "snapshot-removed", _("Removed snapshot %s") % snapshots[-1])
Module: check_mk
Branch: master
Commit: 084e128c035fda5d6cb8b6c784068869dcb83cb1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=084e128c035fda…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Wed Sep 18 13:52:14 2013 +0200
help text for service freshness modified to explain relation to the new feature service staleness
---
web/plugins/wato/active_checks.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index e978655..2562b65 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -873,8 +873,14 @@ register_rule(group,
Dictionary(
title = _("Check freshness"),
help = _("Freshness checking is only useful for passive checks. It makes sure that passive "
- "check results are submitted on a regular base. If not, the check is being set to "
- "warning, critical or unknown."),
+ "check results are submitted on a regular basis. If not, the check is being set to "
+ "warning, critical or unknown.<br>"
+ "The freshness checking works in addition to the staleness feature. The latter grays "
+ "out passive checks for which no data were received after an interval. The interval "
+ "is calculated from the staleness value in <tt>Global Settings</tt> multiplied by "
+ "the normal check interval defined in a separate rule (default is 60sec). If you use "
+ "freshness checking you might want to modify the normal check interval for your check "
+ "as well."),
optional_keys = False,
elements = [
( "interval",
Module: check_mk
Branch: master
Commit: 86a8123ae52bff6491e18aee3b2d6b7b23e9e7f2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=86a8123ae52bff…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Sep 18 12:36:08 2013 +0200
Implement DNS caching. This can be disabled with use_dns_cache = False
---
ChangeLog | 1 +
modules/check_mk.py | 48 +++++++++++++++++++++++-----
web/plugins/wato/check_mk_configuration.py | 18 +++++++++++
3 files changed, 59 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8176726..d8b89fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
* Preparations for significant SNMP monitoring performance improvement
(It's named Inline SNMP, which is available as special feature via subscriptions)
* Allow to specify custom host check via WATO (arbitrary command line)
+ * Implement DNS caching. This can be disabled with use_dns_cache = False
Livestatus:
* new service column staleness: indicator for outdated service checks
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 1246046..7267c4e 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -211,6 +211,7 @@ agent_port = 6556
agent_ports = []
snmp_ports = [] # UDP ports used for SNMP
tcp_connect_timeout = 5.0
+use_dns_cache = True # prevent DNS by using own cache file
delay_precompile = False # delay Python compilation to Nagios execution
restart_locking = "abort" # also possible: "wait", None
check_submission = "file" # alternative: "pipe"
@@ -1153,25 +1154,38 @@ def lookup_ipaddress(hostname):
if hostname in g_dns_cache:
return g_dns_cache[hostname]
+ # Prepare file based fall-back DNS cache in case resolution fails
init_ip_lookup_cache()
+ cached_ip = g_ip_lookup_cache.get(hostname)
+ if cached_ip and use_dns_cache:
+ g_dns_cache[hostname] = cached_ip
+ return cached_ip
+
# Now do the actual DNS lookup
try:
ipa = socket.gethostbyname(hostname)
- # Cache the result (persistant) when resolving succeeded
- if ipa != g_ip_lookup_cache.get(hostname):
+ # Update our cached address if that has changed or was missing
+ if ipa != cached_ip:
+ if opt_verbose:
+ print "Updating DNS cache for %s: %s" % (hostname, ipa)
g_ip_lookup_cache[hostname] = ipa
write_ip_lookup_cache()
+
+ g_dns_cache[hostname] = ipa # Update in-memory-cache
+ return ipa
+
except:
- # Initialize the lookup cache when called for the first time
- if hostname in g_ip_lookup_cache:
- ipa = g_ip_lookup_cache[hostname]
+ # DNS failed. Use cached IP address if present, even if caching
+ # is disabled.
+ if cached_ip:
+ g_dns_cache[hostname] = cached_ip
+ return cached_ip
else:
g_dns_cache[hostname] = None
raise
- g_dns_cache[hostname] = ipa
- return ipa
+
def init_ip_lookup_cache():
global g_ip_lookup_cache
@@ -1184,6 +1198,20 @@ def init_ip_lookup_cache():
def write_ip_lookup_cache():
file(var_dir + '/ipaddresses.cache', 'w').write(repr(g_ip_lookup_cache))
+def do_update_dns_cache():
+ # Temporarily disable *use* of cache, we want to force an update
+ global use_dns_cache
+ use_dns_cache = False
+
+ if opt_verbose:
+ print "Updating DNS cache..."
+ for hostname in all_active_hosts() + all_active_clusters():
+ # Use intelligent logic. This prevents DNS lookups for hosts
+ # with statically configured addresses, etc.
+ lookup_ipaddress(hostname)
+
+
+
def agent_port_of(hostname):
ports = host_extra_conf(hostname, agent_ports)
if len(ports) == 0:
@@ -4305,6 +4333,7 @@ def usage():
cmk -D, --dump [H1 H2 ..] dump all or some hosts
cmk -d HOSTNAME|IPADDRESS show raw information from agent
cmk --check-inventory HOSTNAME check for items not yet checked
+ cmk --update-dns-cache update IP address lookup cache
cmk --list-hosts [G1 G2 ...] print list of hosts
cmk --list-tag TAG1 TAG2 ... list hosts having certain tags
cmk -L, --list-checks list all available check types
@@ -5270,7 +5299,7 @@ if __name__ == "__main__":
"no-cache", "update", "restart", "reload", "dump", "fake-dns=",
"man", "nowiki", "config-check", "backup=", "restore=",
"check-inventory=", "paths", "cleanup-autochecks", "checks=",
- "cmc-file=", "browse-man", "list-man" ]
+ "cmc-file=", "browse-man", "list-man", "update-dns-cache" ]
non_config_options = ['-L', '--list-checks', '-P', '--package', '-M', '--notify',
'--man', '-V', '--version' ,'-h', '--help', '--automation']
@@ -5390,6 +5419,9 @@ if __name__ == "__main__":
elif o == '--donate':
do_donation()
done = True
+ elif o == '--update-dns-cache':
+ do_update_dns_cache()
+ done = True
elif o == '--snmpwalk':
do_snmpwalk(args)
done = True
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 68d5706..ec25642 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -950,6 +950,24 @@ register_configvar(group,
need_restart = True)
register_configvar(group,
+ "use_dns_cache",
+ Checkbox(
+ title = _("Use DNS lookup cache"),
+ label = _("Prevent DNS lookups by use of a cache file"),
+ help = _("When this option is enabled (which is the default), then Check_MK tries to "
+ "prevent IP address lookups during the configuration generation. This can speed "
+ "up this process greatly when you have a larger number of hosts. The cache is stored "
+ "in a simple file. Note: when the cache is enabled then changes of the IP address "
+ "of a host in your name server will not be detected immediately. If you need an "
+ "immediate update then simply disable the cache once, activate the changes and "
+ "enabled it again. OMD based installations automatically update the cache once "
+ "a day."),
+ default_value = True,
+ ),
+ need_restart = True
+)
+
+register_configvar(group,
"use_inline_snmp",
Checkbox(
title = _("Use Inline SNMP (EXPERIMENTAL)"),