Module: check_mk
Branch: master
Commit: d800516244f5b3384fcfe2c8e648271622f1f56e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d800516244f5b3…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Apr 4 15:57:12 2016 +0200
3022 FIX mk_logwatch (linux): now able to handle queries from multiple servers (no longer loosing data)
In earlier versions mk_logwatch only had one statefile for all incoming queries.
Any newly found loglines were sent to one server - subsequent queries from other servers got nothing.
With this version each IP address now has its own statefile.
So you can now monitor the same system from multiple servers without the risk of loosing log
messages. Important: Multiple OMD sites running under the same server IP address still steal
log messages from one another.
---
.werks/3022 | 15 +++++++++++++++
ChangeLog | 1 +
agents/plugins/mk_logwatch | 13 ++++++++++++-
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/.werks/3022 b/.werks/3022
new file mode 100644
index 0000000..f2b1b6d
--- /dev/null
+++ b/.werks/3022
@@ -0,0 +1,15 @@
+Title: mk_logwatch (linux): now able to handle queries from multiple servers (no longer loosing data)
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1459777575
+Class: fix
+
+In earlier versions mk_logwatch only had one statefile for all incoming queries.
+Any newly found loglines were sent to one server - subsequent queries from other servers got nothing.
+With this version each IP address now has its own statefile.
+So you can now monitor the same system from multiple servers without the risk of loosing log
+messages. Important: Multiple OMD sites running under the same server IP address still steal
+log messages from one another.
+
diff --git a/ChangeLog b/ChangeLog
index ec5c5cc..6869e0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -123,6 +123,7 @@
* 3019 FIX: netapp_api_volumes: fixed incorrect metrics (wrong scaling in graphs)
* 3111 FIX: citrix_status: fixed incorrect assignment of piggyback data to host running the plugin...
* 3020 FIX: netapp_api_volumes: ignore volumes of cluster partner...
+ * 3022 FIX: mk_logwatch (linux): now able to handle queries from multiple servers (no longer loosing data)...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/agents/plugins/mk_logwatch b/agents/plugins/mk_logwatch
index e58d5d7..6697358 100755
--- a/agents/plugins/mk_logwatch
+++ b/agents/plugins/mk_logwatch
@@ -56,11 +56,22 @@ else:
mk_confdir = os.getenv("MK_CONFDIR") or "."
mk_vardir = os.getenv("MK_VARDIR") or "."
+remote_hostname = os.getenv("REMOTE", "")
+
print "<<<logwatch>>>"
config_filename = mk_confdir + "/logwatch.cfg"
config_dir = mk_confdir + "/logwatch.d/*.cfg"
-status_filename = mk_vardir + "/logwatch.state"
+
+if remote_hostname != "":
+ status_filename = "%s/mk_logwatch_%s.state" % (mk_vardir, remote_hostname)
+else:
+ status_filename = "%s/mk_logwatch.state" % mk_vardir
+
+# Copy the last known state from the logwatch.state when there is no status_filename yet.
+if not os.path.exists(status_filename) and os.path.exists("%s/logwatch.state" % mk_vardir):
+ import shutil
+ shutil.copy("%s/logwatch.state" % mk_vardir, status_filename)
def is_not_comment(line):
if line.lstrip().startswith('#') or \
Module: check_mk
Branch: master
Commit: a317497a208f89117768a1ec0bcd41719dc7bec3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a317497a208f89…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Apr 4 15:24:12 2016 +0200
3319 HW/SW-Inventory service can now be OK in case of unreachable host
The active check for performing the HW/SW-inventory used to always take the
WARN state if the inventory cannot be done (mostly because the target host
was down). This can now be set other states as well. Set this to OK if you
inventorized workstations that are allowed to be switched off. This setting
is in the rule set {{Do hardware/software Inventory}}.
---
.werks/3319 | 13 +++++++++++++
ChangeLog | 1 +
checks/check_cmk_inv | 5 ++++-
modules/check_mk.py | 6 +++++-
modules/inventory.py | 4 ++--
web/plugins/wato/inventory.py | 9 +++++++++
6 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/.werks/3319 b/.werks/3319
new file mode 100644
index 0000000..4521de6
--- /dev/null
+++ b/.werks/3319
@@ -0,0 +1,13 @@
+Title: HW/SW-Inventory service can now be OK in case of unreachable host
+Level: 2
+Component: inv
+Compatible: compat
+Version: 1.2.9i1
+Date: 1459776126
+Class: feature
+
+The active check for performing the HW/SW-inventory used to always take the
+WARN state if the inventory cannot be done (mostly because the target host
+was down). This can now be set other states as well. Set this to OK if you
+inventorized workstations that are allowed to be switched off. This setting
+is in the rule set {{Do hardware/software Inventory}}.
diff --git a/ChangeLog b/ChangeLog
index 9fa55ea..ec5c5cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -241,6 +241,7 @@
HW/SW-Inventory:
* 3192 snmp_extended_info: now inventorizes all physical components of devices which support the ENTITY-MIB
+ * 3319 HW/SW-Inventory service can now be OK in case of unreachable host...
* 3219 FIX: lnx_distro: Now detecting Oracle VM Server correctly
* 3229 FIX: lnx_distro: SLES based systems have now an OS name inventorized\
* 3265 FIX: mk_inventory.solaris: fix problem on Solaris 10, do prtdiag and prtpicl only in global zone
diff --git a/checks/check_cmk_inv b/checks/check_cmk_inv
index a0b9b6e..1c10f5a 100644
--- a/checks/check_cmk_inv
+++ b/checks/check_cmk_inv
@@ -28,7 +28,10 @@ def check_cmk_inv(params):
if params == None:
params = {} # convert from legacy rule syntax
- return "--hw-changes=%d --sw-changes=%d" % (params.get("hw_changes", 0), params.get("sw_changes", 0))
+ return "--inv-fail-status=%d --hw-changes=%d --sw-changes=%d" % (
+ params.get("fail_status", 1),
+ params.get("hw_changes", 0),
+ params.get("sw_changes", 0))
active_check_info['cmk_inv'] = {
"command_line" : 'cmk $ARG1$ --cache --inventory-as-check $HOSTNAME$',
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 012c22f..db652bb 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3933,6 +3933,7 @@ OPTIONS:
You can specify this option multiple times.
--hw-changes=S --inventory-as-check: Use monitoring state S for HW changes
--sw-changes=S --inventory-as-check: Use monitoring state S for SW changes
+ --inv-fail-status=S Use monitoring state S in case if error during inventory
NOTES:
-I can be restricted to certain check types. Write '--checks df -I' if you
@@ -4914,7 +4915,7 @@ long_options = [ "help", "version", "verbose", "compile", "debug", "interactive"
"no-cache", "update", "restart", "reload", "dump", "fake-dns=",
"man", "nowiki", "config-check", "backup=", "restore=",
"check-inventory=", "check-discovery=", "discover-marked-hosts", "paths",
- "checks=", "inventory", "inventory-as-check=", "hw-changes=", "sw-changes=",
+ "checks=", "inventory", "inventory-as-check=", "hw-changes=", "sw-changes=", "inv-fail-status=",
"cmc-file=", "browse-man", "list-man", "update-dns-cache", "cap", "real-time-checks" ]
non_config_options = ['-L', '--list-checks', '-P', '--package', '-M',
@@ -4941,6 +4942,7 @@ exit_status = 0
opt_verbose = 0 # start again from 0, was already faked at the beginning
opt_inv_hw_changes = 0
opt_inv_sw_changes = 0
+opt_inv_fail_status = 1 # State in case of an error (default: WARN)
# Scan modifying options first (makes use independent of option order)
for o,a in opts:
@@ -4997,6 +4999,8 @@ for o,a in opts:
opt_inv_hw_changes = int(a)
elif o == "--sw-changes":
opt_inv_sw_changes = int(a)
+ elif o == "--inv-fail-status":
+ opt_inv_fail_status = int(a)
# Perform actions (major modes)
try:
diff --git a/modules/inventory.py b/modules/inventory.py
index f5dcf97..07ae365 100644
--- a/modules/inventory.py
+++ b/modules/inventory.py
@@ -209,8 +209,8 @@ def do_inv_check(hostname):
except Exception, e:
if opt_debug:
raise
- sys.stdout.write("WARN - Inventory failed: %s\n" % e)
- sys.exit(1)
+ sys.stdout.write("Inventory failed: %s\n" % e)
+ sys.exit(opt_inv_fail_status)
def count_nodes(tree):
diff --git a/web/plugins/wato/inventory.py b/web/plugins/wato/inventory.py
index df8fca8..a600757 100644
--- a/web/plugins/wato/inventory.py
+++ b/web/plugins/wato/inventory.py
@@ -44,6 +44,15 @@ register_rule(group,
title = _("State when hardware changes are detected"),
default_value = 0,
)),
+ ( "fail_status",
+ MonitoringState(
+ title = _("State when inventory fails"),
+ help = _("The check takes this state in case the inventory cannot be "
+ "updated because of any possible reason. A common use is "
+ "setting this to OK for workstations that can be switched "
+ "off - so you will get no notifications in that case."),
+ default_value = 1,
+ )),
]
),
title = _("Do hardware/software Inventory"),
Module: check_mk
Branch: master
Commit: cbc873c0cffb553bfe71d0c9c95462b320500243
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cbc873c0cffb55…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Apr 4 13:23:34 2016 +0200
3111 FIX citrix_status: fixed incorrect assignment of piggyback data to host running the plugin
When a machine is created in citrix without a name, the plugin would previously assign data from
that machine to the one running the plugin.
Those machines will now be ignored by the plugin as their data can't be correctly assigned anyway.
---
.werks/3111 | 12 ++++++++++++
ChangeLog | 1 +
agents/windows/plugins/citrix_farm.ps1 | 3 +++
3 files changed, 16 insertions(+)
diff --git a/.werks/3111 b/.werks/3111
new file mode 100644
index 0000000..d487cd9
--- /dev/null
+++ b/.werks/3111
@@ -0,0 +1,12 @@
+Title: citrix_status: fixed incorrect assignment of piggyback data to host running the plugin
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1459768772
+
+When a machine is created in citrix without a name, the plugin would previously assign data from
+that machine to the one running the plugin.
+Those machines will now be ignored by the plugin as their data can't be correctly assigned anyway.
diff --git a/ChangeLog b/ChangeLog
index a439e94..3b5ff38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -119,6 +119,7 @@
NOTE: Please refer to the migration notes!
* 3016 FIX: mk-job: scheduled jobs are now always executed despite of any status file permission problems...
* 3017 FIX: Fixed missing host/vms inventory information when having multiple datacenters...
+ * 3111 FIX: citrix_status: fixed incorrect assignment of piggyback data to host running the plugin...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/agents/windows/plugins/citrix_farm.ps1 b/agents/windows/plugins/citrix_farm.ps1
index 4c70855..a3da4c1 100644
--- a/agents/windows/plugins/citrix_farm.ps1
+++ b/agents/windows/plugins/citrix_farm.ps1
@@ -95,6 +95,9 @@ foreach ($Controller in $Controllers) {
# Column Name of Machine / Gets machines with the specific machine name known to the hypervisor.
$HostedMachineName = $XAmachine | %{ $_.HostedMachineName }
+ if([string]::IsNullOrEmpty($HostedMachineName)) {
+ continue;
+ }
"<<<<$HostedMachineName>>>>"
"<<<citrix_state>>>"
# Column CatalogNameName / Gets machines from the catalog with the specific name.