Module: check_mk
Branch: master
Commit: 26190e8fcc8c68453e7c4543ad8edd0f77c2afda
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26190e8fcc8c68…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Oct 17 13:47:18 2017 +0200
Added additional test for unreachable notifications
Change-Id: I0b6a9df498d8e86adf686fcd6620229cbd70e93b
---
.../test_unreachable_notifications.py | 126 ++++++++++++++++++++-
1 file changed, 125 insertions(+), 1 deletion(-)
diff --git a/tests/notifications/test_unreachable_notifications.py b/tests/notifications/test_unreachable_notifications.py
index 3d821e8..9b2740b 100644
--- a/tests/notifications/test_unreachable_notifications.py
+++ b/tests/notifications/test_unreachable_notifications.py
@@ -356,4 +356,128 @@ def test_child_up_after_parent_recovers(scenario, site, initial_state):
# - Set parent UP, expect UP notification for child
site.send_host_check_result("notify-test-parent", STATE_UP, "UP")
- log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UP;check-mk-notify;")
+ if scenario.unreachable_enabled:
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UP;check-mk-notify;")
+ else:
+ log.check_not_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UP;check-mk-notify;")
+
+
+# Test the situation where:
+# a) Child goes down
+# b) Parent goes down, child becomes unreachable
+# d) Parent goes up, child becomes down
+def test_down_child_becomes_unreachable_and_down_again(scenario, site, initial_state):
+ log = HistoryLog(scenario.core)
+
+ # - Set child down, expect DOWN notification
+ site.send_host_check_result("notify-test-child", STATE_DOWN, "DOWN")
+ log.check_logged("HOST ALERT: notify-test-child;DOWN;HARD;1;DOWN")
+
+ if scenario.core == "cmc":
+ # CMC: Send a new check result for the parent to make the CMC create the host notification
+ # for the child
+ site.send_host_check_result("notify-test-parent", STATE_UP, "UP")
+
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;DOWN;check-mk-notify;")
+
+ # - Set parent down, expect DOWN notification for parent and UNREACHABLE notification for child
+ site.send_host_check_result("notify-test-parent", STATE_DOWN, "DOWN")
+ log.check_logged("HOST ALERT: notify-test-parent;DOWN;HARD;1;DOWN")
+
+ # Difference beween nagios/cmc: when sending DOWN via PROCESS_HOST_CHECK_RESULT
+ # the nagios core needs another child down check result to report it as unreachable.
+ if scenario.core == "cmc":
+ log.check_logged("HOST ALERT: notify-test-child;UNREACHABLE;HARD;1;")
+
+ if scenario.unreachable_enabled:
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UNREACHABLE;check-mk-notify;")
+ # TODO: Can not test this because it drains too many entries from the log. HistoryLog could deal
+ # with this by readding the read lines after succeeded test or similar
+ #else:
+ # log.check_not_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UNREACHABLE;check-mk-notify;")
+
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-parent;DOWN;check-mk-notify;")
+
+ elif scenario.core == "nagios":
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-parent;DOWN;check-mk-notify;")
+
+ site.send_host_check_result("notify-test-child", STATE_DOWN, "DOWN", expected_state=STATE_UNREACHABLE)
+ log.check_logged("HOST ALERT: notify-test-child;UNREACHABLE;HARD;1;")
+
+ if scenario.unreachable_enabled:
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UNREACHABLE;check-mk-notify;")
+
+ # - Set parent up, expect UP notification
+ site.send_host_check_result("notify-test-parent", STATE_UP, "UP")
+ log.check_logged("HOST ALERT: notify-test-parent;UP;HARD;1;")
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-parent;UP")
+
+ # - Next child check DOWN
+ # cmc: expect no notification (till next parent check confirms UP)
+ # nagios: expect notification without
+ site.send_host_check_result("notify-test-child", STATE_DOWN, "DOWN")
+ log.check_logged("HOST ALERT: notify-test-child;DOWN;HARD;1;")
+
+ if scenario.core == "cmc":
+ # - Set parent UP (again), expect DOWN notification for child
+ site.send_host_check_result("notify-test-parent", STATE_UP, "UP")
+
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;DOWN;check-mk-notify;")
+
+
+# Test the situation where:
+# a) Child goes down
+# b) Parent goes down, child becomes unreachable
+# c) Child goes up
+def test_down_child_becomes_unreachable_then_up(scenario, site, initial_state):
+ log = HistoryLog(scenario.core)
+
+ # - Set child down, expect DOWN notification
+ site.send_host_check_result("notify-test-child", STATE_DOWN, "DOWN")
+ log.check_logged("HOST ALERT: notify-test-child;DOWN;HARD;1;DOWN")
+
+ if scenario.core == "cmc":
+ # CMC: Send a new check result for the parent to make the CMC create the host notification
+ # for the child
+ site.send_host_check_result("notify-test-parent", STATE_UP, "UP")
+
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;DOWN;check-mk-notify;")
+
+ # - Set parent down, expect DOWN notification for parent and UNREACHABLE notification for child
+ site.send_host_check_result("notify-test-parent", STATE_DOWN, "DOWN")
+ log.check_logged("HOST ALERT: notify-test-parent;DOWN;HARD;1;DOWN")
+
+ # Difference beween nagios/cmc: when sending DOWN via PROCESS_HOST_CHECK_RESULT
+ # the nagios core needs another child down check result to report it as unreachable.
+ if scenario.core == "cmc":
+ log.check_logged("HOST ALERT: notify-test-child;UNREACHABLE;HARD;1;")
+
+ if scenario.unreachable_enabled:
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UNREACHABLE;check-mk-notify;")
+ # TODO: Can not test this because it drains too many entries from the log. HistoryLog could deal
+ # with this by readding the read lines after succeeded test or similar
+ #else:
+ # log.check_not_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UNREACHABLE;check-mk-notify;")
+
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-parent;DOWN;check-mk-notify;")
+
+ elif scenario.core == "nagios":
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-parent;DOWN;check-mk-notify;")
+
+ site.send_host_check_result("notify-test-child", STATE_DOWN, "DOWN", expected_state=STATE_UNREACHABLE)
+ log.check_logged("HOST ALERT: notify-test-child;UNREACHABLE;HARD;1;")
+
+ if scenario.unreachable_enabled:
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UNREACHABLE;check-mk-notify;")
+
+ # - Set child up, expect:
+ # cmc: pending UP notification, and sent up notification after next parent check
+ # nagios: UP notification
+ site.send_host_check_result("notify-test-child", STATE_UP, "UP")
+ log.check_logged("HOST ALERT: notify-test-child;UP;HARD;1;")
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-child;UP")
+
+ ## - Set parent up, expect UP notification
+ site.send_host_check_result("notify-test-parent", STATE_UP, "UP")
+ log.check_logged("HOST ALERT: notify-test-parent;UP;HARD;1;")
+ log.check_logged("HOST NOTIFICATION: check-mk-notify;notify-test-parent;UP")
Module: check_mk
Branch: master
Commit: 38bfd092a9197aecc6a429894e6ed886b67120ba
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=38bfd092a9197a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Oct 17 13:56:25 2017 +0200
5321 FIX mk_oracle: Fixed usage of awk command in case of SunOS which causes 'record ... too long' error
The consequence of above error was that Check_MK did not
find any ORACLE instances any more. Fixed that by using
{{nawk}} in case of SunOS.
Change-Id: I73612f7e8412f0b62bd7a807718bd672a32861f8
---
.werks/5321 | 13 +++++++++++++
agents/plugins/mk_oracle | 4 +++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/5321 b/.werks/5321
new file mode 100644
index 0000000..b1d2556
--- /dev/null
+++ b/.werks/5321
@@ -0,0 +1,13 @@
+Title: mk_oracle: Fixed usage of awk command in case of SunOS which causes 'record ... too long' error
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1508241149
+
+The consequence of above error was that Check_MK did not
+find any ORACLE instances any more. Fixed that by using
+{{nawk}} in case of SunOS.
diff --git a/agents/plugins/mk_oracle b/agents/plugins/mk_oracle
index dcc871d..5259008 100755
--- a/agents/plugins/mk_oracle
+++ b/agents/plugins/mk_oracle
@@ -742,12 +742,14 @@ sql_asm_diskgroup()
function set_osenv () {
ostype=$(uname -s)
+ AWK=$(which awk)
if [ ${ostype} = 'Linux' ] ; then
GREP=$(which grep)
STATCX='stat -c %X'
STATCY='stat -c %Y'
+ AWK=$(which nawk)
elif [ ${ostype} = 'SunOS' ] ; then
@@ -1256,7 +1258,7 @@ fi
# Get list of all running databases
# Do not work on ASM in this plugin. => Ignore a running ASM-Instance!
-SIDS=$(UNIX95=true ps -ef | awk '{print $NF}' | ${GREP} -E '^asm_pmon_|^ora_pmon_|^xe_pmon_XE' | cut -d"_" -f3-)
+SIDS=$(UNIX95=true ps -ef | ${AWK} '{print $NF}' | ${GREP} -E '^asm_pmon_|^ora_pmon_|^xe_pmon_XE' | cut -d"_" -f3-)
# If we do not have found any running database instance, then either
# no ORACLE is present on this system or it's just currently not running.
Module: check_mk
Branch: master
Commit: 7826043dfc32b6c649d23cd4d70effe453271bc2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7826043dfc32b6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Oct 17 11:09:24 2017 +0200
5397 Microcore can now be configured to send UNREACHABLE notifications
Normally you don't want to receive UNREACHABLE notifications of hosts. Configuring
client/parent relationships between your hosts is a good idea to be able to
detect network outages. DOWN states of hosts will then be translated into UNREACHABLE,
making your view clear for the real cause (e.g. a router in DOWN state).
But there may be situations where you want to be able to receive these UNREACHABLE
notifications. This was already configurable when using the Nagios core for a long
time. For the Microcore the suppression of UNREACHABLE notifications was hard coded.
This has been changed now.
The default behaviour will not be changed. New sites or updates sites will not send
out UNREACHABLE notifications by default. To enable the new feature, you will first
have to tell the core to send out UNREACHABLE notifications.
To have a seamless transition we additionally changed these things:
<ul>
<li>A default rule that disables the UNREACHABLE notifications is being created
for new sites in the ruleset "Notified events for hosts". Whenever you want
to enable UNREACHABLE notifications, simply enable them using this rule.</li>
<li>Updated sites:
<ul>
<li>If you have configured rules for all your hosts in the
"Notified events for hosts" ruleset, the core will continue working
as configured.</li>
<li>Microcore: For hosts that have no matching rule in "Notified events for hosts",
the Microcore will <i>not send</i> out UNREACHABLE notifications.</li>
<li>Microcore: If you previously had configured a rule in "Notified events for hosts"
which enabled the UNREACHABLE notifications, this rule had no effect. It will now
be working after updating.</li>
<li>Nagios: For hosts that have no matching rule in "Notified events for hosts",
the Nagios core will <i>send</i> out UNREACHABLE notifications.</li>
</ul>
</li>
</ul>
Change-Id: Ie6dab1970f9e0dd433986e38b84a604a7a26c552
---
.werks/5397 | 44 ++++++++++++++++++++++++++++++
web/htdocs/wato.py | 23 ++++++++++++----
web/plugins/wato/check_mk_configuration.py | 10 +++++--
3 files changed, 69 insertions(+), 8 deletions(-)
diff --git a/.werks/5397 b/.werks/5397
new file mode 100644
index 0000000..631ab5a
--- /dev/null
+++ b/.werks/5397
@@ -0,0 +1,44 @@
+Title: Microcore can now be configured to send UNREACHABLE notifications
+Level: 2
+Component: core
+Compatible: compat
+Edition: cee
+Version: 1.5.0i1
+Date: 1508230324
+Class: feature
+
+Normally you don't want to receive UNREACHABLE notifications of hosts. Configuring
+client/parent relationships between your hosts is a good idea to be able to
+detect network outages. DOWN states of hosts will then be translated into UNREACHABLE,
+making your view clear for the real cause (e.g. a router in DOWN state).
+
+But there may be situations where you want to be able to receive these UNREACHABLE
+notifications. This was already configurable when using the Nagios core for a long
+time. For the Microcore the suppression of UNREACHABLE notifications was hard coded.
+This has been changed now.
+
+The default behaviour will not be changed. New sites or updates sites will not send
+out UNREACHABLE notifications by default. To enable the new feature, you will first
+have to tell the core to send out UNREACHABLE notifications.
+
+To have a seamless transition we additionally changed these things:
+
+<ul>
+<li>A default rule that disables the UNREACHABLE notifications is being created
+ for new sites in the ruleset "Notified events for hosts". Whenever you want
+ to enable UNREACHABLE notifications, simply enable them using this rule.</li>
+<li>Updated sites:
+ <ul>
+ <li>If you have configured rules for all your hosts in the
+ "Notified events for hosts" ruleset, the core will continue working
+ as configured.</li>
+ <li>Microcore: For hosts that have no matching rule in "Notified events for hosts",
+ the Microcore will <i>not send</i> out UNREACHABLE notifications.</li>
+ <li>Microcore: If you previously had configured a rule in "Notified events for hosts"
+ which enabled the UNREACHABLE notifications, this rule had no effect. It will now
+ be working after updating.</li>
+ <li>Nagios: For hosts that have no matching rule in "Notified events for hosts",
+ the Nagios core will <i>send</i> out UNREACHABLE notifications.</li>
+ </ul>
+</li>
+</ul>
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 5bc3204..24cf9be 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7990,9 +7990,11 @@ def event_rule_match_conditions(flavour):
( "match_host_event",
ListChoice(
title = _("Match host event type"),
- help = _("Select the host event types and transitions this rule should handle. Note: "
- "If you activate this option and do <b>not</b> also specify service event "
- "types then this rule will never hold for service notifications!"),
+ help = _("Select the host event types and transitions this rule should handle.<br>"
+ "Note: If you activate this option and do <b>not</b> also specify service event "
+ "types then this rule will never hold for service notifications!<br>"
+ "Note: You can only match on event types <a href=\"%s\">created by the core</a>.") % \
+ "wato.py?mode=edit_ruleset&varname=extra_host_conf%3Anotification_options",
choices = [
( 'rd', _("UP") + u" ➤ " + _("DOWN")),
( 'ru', _("UP") + u" ➤ " + _("UNREACHABLE")),
@@ -8013,9 +8015,11 @@ def event_rule_match_conditions(flavour):
( "match_service_event",
ListChoice(
title = _("Match service event type"),
- help = _("Select the service event types and transitions this rule should handle. Note: "
- "If you activate this option and do <b>not</b> also specify host event "
- "types then this rule will never hold for host notifications!"),
+ help = _("Select the service event types and transitions this rule should handle.<br>"
+ "Note: If you activate this option and do <b>not</b> also specify host event "
+ "types then this rule will never hold for host notifications!<br>"
+ "Note: You can only match on event types <a href=\"%s\">created by the core</a>.") % \
+ "wato.py?mode=edit_ruleset&varname=extra_service_conf%3Anotification_options",
choices = [
( 'rw', _("OK") + u" ➤ " + _("WARN")),
( 'rr', _("OK") + u" ➤ " + _("OK")),
@@ -14768,6 +14772,13 @@ def create_sample_config():
],
},
+ # Disable unreachable notifications by default
+ 'extra_host_conf': {
+ 'notification_options': [
+ ( 'd,r,f,s', [], ALL_HOSTS, {} ),
+ ],
+ },
+
# Periodic service discovery
'periodic_discovery': [
({'severity_unmonitored': 1,
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index fbdd4e0..e579999 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1731,13 +1731,19 @@ register_rule(group,
( "f", _("Start or end of flapping state")),
( "s", _("Start or end of a scheduled downtime")),
],
- default_value = [ "d", "u", "r", "f", "s" ],
+ default_value = [ "d", "r", "f", "s" ],
),
title = _("Notified events for hosts"),
help = _("This ruleset allows you to restrict notifications of host problems to certain "
"states, e.g. only notify on DOWN, but not on UNREACHABLE. Please select the types "
"of events that should initiate notifications. Please note that several other "
- "filters must also be passed in order for notifications to finally being sent out."),
+ "filters must also be passed in order for notifications to finally being sent out."
+ "<br><br>"
+ "Please note: There is a difference between the Microcore and Nagios when you have "
+ "a host that has no matching rule in this ruleset. In this case the Microcore will "
+ "not send out UNREACHABLE notifications while the Nagios core would send out "
+ "UNREACHABLE notifications. To align this behaviour, create a rule matching "
+ "all your hosts and configure it to either send UNREACHABLE notifications or not."),
forth = lambda x: x != 'n' and x.split(",") or [],
back = lambda x: ",".join(x) or "n",
),
Module: check_mk
Branch: master
Commit: 8be294797c5792e976ce9159ae3d115b059cfac0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8be294797c5792…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Mon Oct 16 11:54:03 2017 +0200
5344 FIX fileinfo: correct handling of file names with spaces in fileinfo.cfg
Change-Id: Icdaa3afb31d14efc494e4fa99a81b13e69a98109
---
.werks/5344 | 11 +++++++++++
agents/check_mk_agent.aix | 20 ++++++++++++++------
agents/check_mk_agent.freebsd | 6 +++---
agents/check_mk_agent.linux | 8 ++++----
agents/check_mk_agent.macosx | 6 +++---
agents/check_mk_agent.openwrt | 6 +++---
agents/check_mk_agent.solaris | 13 ++++++-------
7 files changed, 44 insertions(+), 26 deletions(-)
diff --git a/.werks/5344 b/.werks/5344
new file mode 100644
index 0000000..f110ce4
--- /dev/null
+++ b/.werks/5344
@@ -0,0 +1,11 @@
+Title: fileinfo: correct handling of file names with spaces in fileinfo.cfg
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1508146535
+
+
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index dcc7a39..7632cb5 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -287,12 +287,20 @@ fi
# Fileinfo-Check: put patterns for files into /etc/check_mk/fileinfo.cfg
if [ -r "$MK_CONFDIR/fileinfo.cfg" ]; then
- echo '<<<fileinfo:sep(124)>>>'
- date +%s
- # simulate output of the Linux "stat -c "%n|%s|%Y" command
- # TODO: feel free to improve this command. It opens the perl interpreter for every file found...
- for pattern in $(cat "$MK_CONFDIR/fileinfo.cfg" 2>/dev/null); do if [ -f $pattern ]; then ls -1 "$pattern" ; fi; done |\
- while read file ; do /usr/bin/perl -e 'printf "$_|%s|%s\n", (stat) [7,9] for @ARGV' "$file" ; done
+ echo '<<<fileinfo:sep(124)>>>'
+ date +%s
+ # simulate output of the Linux "stat -c "%n|%s|%Y" command
+ # TODO: feel free to improve this command. It opens the perl interpreter for every file found...
+ while read pattern
+ do
+ if [ -f "$pattern" ]; then
+ ls -1 "$pattern"
+ fi
+ done < "$MK_CONFDIR/fileinfo.cfg" 2>/dev/null |\
+ while read file
+ do
+ /usr/bin/perl -e 'printf "$_|%s|%s\n", (stat) [7,9] for @ARGV' "$file"
+ done
fi
# powerHA
diff --git a/agents/check_mk_agent.freebsd b/agents/check_mk_agent.freebsd
index 1b9a79b..3748661 100755
--- a/agents/check_mk_agent.freebsd
+++ b/agents/check_mk_agent.freebsd
@@ -380,14 +380,14 @@ fi
if [ -r "$MK_CONFDIR/fileinfo.cfg" ] ; then
echo '<<<fileinfo:sep(124)>>>'
date +%s
- for line in $(cat "$MK_CONFDIR/fileinfo.cfg")
+ while read line
do
- stat -f "%N|%z|%m" $line 2>/dev/null
+ stat -f "%N|%z|%m" "$line" 2>/dev/null
if [ $? -ne 0 ]; then
echo "$line|missing|$(date +%s)"
fi
- done
+ done < "$MK_CONFDIR/fileinfo.cfg"
fi
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index ec7af26..8dc40c0 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -764,18 +764,18 @@ function replace_datevariable()
if [ -r "$MK_CONFDIR/fileinfo.cfg" ] ; then
echo '<<<fileinfo:sep(124)>>>'
date +%s
- for line in $(cat "$MK_CONFDIR/fileinfo.cfg")
+ while read line
do
# only work on lines containing files, skip e.g. comments and blank lines
- if [ ${line:0:1} = "/" ]; then
- line="$(replace_datevariable $line)"
+ if [ "${line:0:1}" = "/" ]; then
+ line=$(replace_datevariable "$line")
stat -c "%n|%s|%Y" "${line}" 2>/dev/null
if [ $? -ne 0 ]; then
echo "$line|missing|$(date +%s)"
fi
fi
- done
+ done < "$MK_CONFDIR/fileinfo.cfg"
fi
# Get stats about OMD monitoring cores running on this machine.
diff --git a/agents/check_mk_agent.macosx b/agents/check_mk_agent.macosx
index 97ec400..73b65ee 100755
--- a/agents/check_mk_agent.macosx
+++ b/agents/check_mk_agent.macosx
@@ -93,14 +93,14 @@ netstat -ntfinet | awk ' /^tcp/ { c[$6]++; } END { for (x in c) { print x, c[x];
if [ -r "$MK_CONFDIR/fileinfo.cfg" ] ; then
echo '<<<fileinfo:sep(124)>>>'
date +%s
- for line in $(cat "$MK_CONFDIR/fileinfo.cfg")
+ while read line
do
- stat -f "%N|%z|%m" $line 2>/dev/null
+ stat -f "%N|%z|%m" "$line" 2>/dev/null
if [ $? -ne 0 ]; then
echo "$line|missing|$(date +%s)"
fi
- done
+ done < "$MK_CONFDIR/fileinfo.cfg"
fi
if type tmutil >/dev/null
diff --git a/agents/check_mk_agent.openwrt b/agents/check_mk_agent.openwrt
index d8ff0ec..02ae32d 100755
--- a/agents/check_mk_agent.openwrt
+++ b/agents/check_mk_agent.openwrt
@@ -679,14 +679,14 @@ fi
if [ -r "$MK_CONFDIR/fileinfo.cfg" ] ; then
echo '<<<fileinfo:sep(124)>>>'
date +%s
- for line in $(cat "$MK_CONFDIR/fileinfo.cfg")
+ while read line
do
- stat -c "%n|%s|%Y" $line 2>/dev/null
+ stat -c "%n|%s|%Y" "$line" 2>/dev/null
if [ $? -ne 0 ]; then
echo "$line|missing|$(date +%s)"
fi
- done
+ done < "$MK_CONFDIR/fileinfo.cfg"
fi
# Get stats about OMD monitoring cores running on this machine.
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index 05134d1..95b4dac 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -369,15 +369,14 @@ then
echo '<<<fileinfo:sep(124)>>>'
/usr/bin/perl -e 'print time."\n"'
# note: patterns in the fileinfo.cfg are resolved inside this loop
- for file in $(cat "$MK_CONFDIR/fileinfo.cfg")
+ while read file
do
# only work on lines containing files, skip e.g. comments and blank lines
- if [ ${file:0:1} = "/" ]; then
- file="$(replace_datevariable $file)"
- ls $file > /dev/null 2>&1
-
+ if [ "${file:0:1}" = "/" ]; then
+ file=$(replace_datevariable "$file")
+ ls "$file" > /dev/null 2>&1
if [ $? -eq 0 ]; then
- echo $file | \
+ echo "$file" | \
/usr/bin/perl -e '
while(my $file = <>) {
$file =~ s/\n$//;
@@ -388,7 +387,7 @@ then
echo "$file|missing|$(/usr/bin/perl -e 'print time')"
fi
fi
- done
+ done < "$MK_CONFDIR/fileinfo.cfg"
fi
# Libelle Business Shadow
Module: check_mk
Branch: master
Commit: 8f4911d356e42e965b01533be5ca8be345454a3c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8f4911d356e42e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 13 11:37:16 2017 +0200
5396 FIX Nagios: Log external commands to nagios.log by default
Nagios is now logging external commands to the core log (nagios.log)
in the default configuration. This makes Nagios behave like the Microcore
in this case.
Change-Id: Ie18d93111a62102753fa0a32547cbfdde1c416de
---
.werks/5396 | 12 ++++++++++++
omd/packages/nagios/skel/etc/nagios/nagios.d/logging.cfg | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/5396 b/.werks/5396
new file mode 100644
index 0000000..71c5cab
--- /dev/null
+++ b/.werks/5396
@@ -0,0 +1,12 @@
+Title: Nagios: Log external commands to nagios.log by default
+Level: 1
+Component: core
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1507887368
+Class: fix
+
+Nagios is now logging external commands to the core log (nagios.log)
+in the default configuration. This makes Nagios behave like the Microcore
+in this case.
diff --git a/omd/packages/nagios/skel/etc/nagios/nagios.d/logging.cfg b/omd/packages/nagios/skel/etc/nagios/nagios.d/logging.cfg
index 4e98868..539f87f 100644
--- a/omd/packages/nagios/skel/etc/nagios/nagios.d/logging.cfg
+++ b/omd/packages/nagios/skel/etc/nagios/nagios.d/logging.cfg
@@ -65,7 +65,7 @@ log_initial_states=1
# checks - see the option below for controlling whether or not
# passive checks are logged.
-log_external_commands=0
+log_external_commands=1
# PASSIVE CHECKS LOGGING OPTION
# If you don't want Nagios to log passive host and service checks, set
Module: check_mk
Branch: master
Commit: be06290af8c3292aafa17972588bb6cf682a4660
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=be06290af8c329…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Thu Oct 12 11:37:22 2017 +0200
5341 agent_vsphere: change of the option "Display VM power state on"
The option "Display VM power state on" of the WATO rule now displays
the power state of VMs <i>additionally</i> on either the ESX host or
the VM. The option is therefore renamed to "Display power state
additionally on". This will result in services for <i>both</i> the
queried system and the ESX host / VM. By disabling the unwanted
services it is then possible to configure where the corresponding
services are displayed. Because the data is now still available on
the queried system the service "Object count" will now display the
correct count when the option is used.
Change-Id: I89172eaa9384a7ef0436a1084ce812ae9cdd2d07
---
.werks/5341 | 18 ++++++++++++++++++
agents/special/agent_vsphere | 6 ++----
web/plugins/wato/datasource_programs.py | 8 +++++++-
3 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/.werks/5341 b/.werks/5341
new file mode 100644
index 0000000..d4e6821
--- /dev/null
+++ b/.werks/5341
@@ -0,0 +1,18 @@
+Title: agent_vsphere: change of the option "Display VM power state on"
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1507799865
+Class: feature
+
+The option "Display VM power state on" of the WATO rule now displays
+the power state of VMs <i>additionally</i> on either the ESX host or
+the VM. The option is therefore renamed to "Display power state
+additionally on". This will result in services for <i>both</i> the
+queried system and the ESX host / VM. By disabling the unwanted
+services it is then possible to configure where the corresponding
+services are displayed. Because the data is now still available on
+the queried system the service "Object count" will now display the
+correct count when the option is used.
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index cebc547..e272957 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -1662,8 +1662,7 @@ if not error:
host_info = "hostsystem\t%s\t\t%s" % (converted_hostname, hostsystems_properties[hostname]["runtime.powerState"][0])
if opt_host_pwr_display == "esxhost" and not opt_direct:
host_piggy_data.setdefault(converted_hostname, []).append(host_info)
- else:
- output(host_info)
+ output(host_info)
if "virtualmachine" in query_objects:
for key in vms.keys():
@@ -1676,8 +1675,7 @@ if not error:
vm_piggy_data.setdefault(vm_name, []).append(vm_info)
elif opt_vm_pwr_display == "esxhost" and not opt_direct:
host_piggy_data.setdefault(running_on, []).append(vm_info)
- else:
- output(vm_info)
+ output(vm_info)
if "virtualmachine" in query_objects and "hostsystem" in query_objects and opt_host_pwr_display == "vm":
def find_host(hostname):
diff --git a/web/plugins/wato/datasource_programs.py b/web/plugins/wato/datasource_programs.py
index 7dbdbda..da9539c 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -158,7 +158,13 @@ register_rule(group,
),
( "vm_pwr_display",
DropdownChoice(
- title = _("Display VM power state on"),
+ title = _("Display VM power state <i>additionally</i> on"),
+ help = _("The power state can be displayed additionally either "
+ "on the ESX host or the VM. This will result in services "
+ "for <i>both</i> the queried system and the ESX host / VM. "
+ "By disabling the unwanted services it is then possible "
+ "to configure where the services are displayed."
+ ),
choices = [
( None, _("The queried ESX system (vCenter / Host)") ),
( "esxhost", _("The ESX Host") ),