Module: check_mk
Branch: master
Commit: c8a78f581506a5b2abd1fa7c0336837fc4c38ef0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c8a78f581506a5…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Dec 13 15:12:21 2017 +0100
updated werk text
Change-Id: Ie0111bb6b42114e3a11dd35098f374687b69a272
---
.werks/5253 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/.werks/5253 b/.werks/5253
index 1035b4f..00007d7 100644
--- a/.werks/5253
+++ b/.werks/5253
@@ -12,11 +12,11 @@ The file <tt>/etc/check_mk/real_time_checks.cfg</tt> now supports the parameter
as real time checks.
-For example
-F:
-RTC_PLUGINS+="apache_status"
+For example<br>
+RTC_PLUGINS+="apache_status"<br>
RTC_PLUGINS+="lvm"
-This executes both plugins as real time checks (1sec resolution) as well as standard check_mk check.
+
+This executes both plugins as real time checks (1sec resolution) in addition to the standard check.
Module: check_mk
Branch: master
Commit: d3c7f49ca6a0e4e037ff9c250561dd94cb548294
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d3c7f49ca6a0e4…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Dec 13 15:06:47 2017 +0100
5253 Linux check_mk_agent: now able to execute plugins for real time checks
The file <tt>/etc/check_mk/real_time_checks.cfg</tt> now supports the parameter
<tt>RTC_PLUGINS</tt> which allows the configuration of plugins to be also executed
as real time checks.
For example
F:
RTC_PLUGINS+="apache_status"
RTC_PLUGINS+="lvm"
This executes both plugins as real time checks (1sec resolution) as well as standard check_mk check.
Change-Id: I45967b6ae67d913b95e7a9eda3ad212dd8b10a62
---
.werks/5253 | 22 ++++++++++++++++++++++
agents/check_mk_agent.linux | 42 ++++++++++++++++++++++++++++++++++++------
2 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/.werks/5253 b/.werks/5253
new file mode 100644
index 0000000..1035b4f
--- /dev/null
+++ b/.werks/5253
@@ -0,0 +1,22 @@
+Title: Linux check_mk_agent: now able to execute plugins for real time checks
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i2
+Date: 1513173632
+Class: feature
+
+The file <tt>/etc/check_mk/real_time_checks.cfg</tt> now supports the parameter
+<tt>RTC_PLUGINS</tt> which allows the configuration of plugins to be also executed
+as real time checks.
+
+
+For example
+F:
+RTC_PLUGINS+="apache_status"
+RTC_PLUGINS+="lvm"
+
+This executes both plugins as real time checks (1sec resolution) as well as standard check_mk check.
+
+
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 6fec1cd..b1a544d 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -85,6 +85,12 @@ if [ "$ENCRYPTED" == "yes" ] ; then
fi
+RTC_PLUGINS=""
+if [ -e $MK_CONFDIR/real_time_checks.cfg ]; then
+ . $MK_CONFDIR/real_time_checks.cfg
+fi
+
+
#
# CHECK SECTIONS
#
@@ -204,13 +210,19 @@ function run_real_time_checks()
PIDFILE=$MK_VARDIR/real_time_checks.pid
echo $$ > $PIDFILE
- . $MK_CONFDIR/real_time_checks.cfg
if [ "$PASSPHRASE" != "" ] ; then
# new mechanism to set the passphrase has priority
RTC_SECRET=$PASSPHRASE
fi
+ if [ "$ENCRYPTED_RT" != "no" ] ; then
+ PROTOCOL=00
+ else
+ PROTOCOL=99
+ fi
+
+
while true; do
# terminate when pidfile is gone or other Real-Time Check process started or configured timeout
if [ ! -e $PIDFILE ] || [ $(<$PIDFILE) -ne $$ ] || [ $RTC_TIMEOUT -eq 0 ]; then
@@ -218,11 +230,6 @@ function run_real_time_checks()
fi
for SECTION in $RTC_SECTIONS; do
- if [ "$ENCRYPTED_RT" != "no" ] ; then
- PROTOCOL=00
- else
- PROTOCOL=99
- fi
# Be aware of maximum packet size. Maybe we need to check the size of the section
# output and do some kind of nicer error handling.
# 2 bytes: protocol version, 10 bytes: timestamp, rest: encrypted data
@@ -237,6 +244,29 @@ function run_real_time_checks()
} | dd bs=9999 iflag=fullblock 2>/dev/null >/dev/udp/$REMOTE/$RTC_PORT
done
+
+ # Plugins
+ if cd $PLUGINSDIR ; then
+ for PLUGIN in $RTC_PLUGINS; do
+ if [ ! -f $PLUGIN ] ; then
+ continue
+ fi
+
+ # Be aware of maximum packet size. Maybe we need to check the size of the section
+ # output and do some kind of nicer error handling.
+ # 2 bytes: protocol version, 10 bytes: timestamp, rest: encrypted data
+ # dd is used to concatenate the output of all commands to a single write/block => udp packet
+ { echo -n $PROTOCOL ;
+ date +%s | tr -d '\n' ;
+ if [ "$ENCRYPTED_RT" != "no" ] ; then
+ export RTC_SECRET=$RTC_SECRET ; ./$PLUGIN | openssl enc -aes-256-cbc -pass env:RTC_SECRET -nosalt ;
+ else
+ ./$PLUGIN;
+ fi
+ } | dd bs=9999 iflag=fullblock 2>/dev/null >/dev/udp/$REMOTE/$RTC_PORT
+ done
+ fi
+
sleep 1
RTC_TIMEOUT=$((RTC_TIMEOUT-1))
done
Module: check_mk
Branch: master
Commit: 39e1fc2fd60223bdb401437fcd36489d538ce2ac
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=39e1fc2fd60223…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Fri Dec 8 11:50:18 2017 +0100
5483 FIX mknotifyd: improve error handling and logging
Connections in progress are now explicitely written to
the mknotifyd.log. This makes it easier to spot ongoning,
unsucessful connection attempts.
Furthermore, in case of polling errors a timeout of 1s
was added. This prevents the mknotifyd from using 100% CPU
if an error appears and the polling returns immediately.
Change-Id: I06daaca4accdae83df9a45a609410f89b46fadb6
---
.werks/5483 | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/.werks/5483 b/.werks/5483
new file mode 100644
index 0000000..b7667c7
--- /dev/null
+++ b/.werks/5483
@@ -0,0 +1,16 @@
+Title: mknotifyd: improve error handling and logging
+Level: 1
+Component: notifications
+Compatible: compat
+Edition: cee
+Version: 1.5.0i2
+Date: 1513152210
+Class: fix
+
+Connections in progress are now explicitely written to
+the mknotifyd.log. This makes it easier to spot ongoning,
+unsucessful connection attempts.
+
+Furthermore, in case of polling errors a timeout of 1s
+was added. This prevents the mknotifyd from using 100% CPU
+if an error appears and the polling returns immediately.
Module: check_mk
Branch: master
Commit: f65a75c9a7f52b1f8761bb17ab68a1bb002c4c92
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f65a75c9a7f52b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Dec 12 13:58:36 2017 +0100
5579 Rule event limit can now be configured individually per rule
The rule event limit can now be customized per rule. There is a new
option "Custom rule event limit" available in the EC rule editor
that can be used for this purpose.
Change-Id: Id740b84abe04fb2bf9b17b629953943c159f8818
---
.werks/5579 | 12 +++++++++
bin/mkeventd | 17 ++++++++++--
web/plugins/wato/mkeventd.py | 64 +++++++++++++++++++++++++++-----------------
3 files changed, 67 insertions(+), 26 deletions(-)
diff --git a/.werks/5579 b/.werks/5579
new file mode 100644
index 0000000..deba512
--- /dev/null
+++ b/.werks/5579
@@ -0,0 +1,12 @@
+Title: Rule event limit can now be configured individually per rule
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.5.0i2
+Date: 1513083425
+Class: feature
+
+The rule event limit can now be customized per rule. There is a new
+option "Custom rule event limit" available in the EC rule editor
+that can be used for this purpose.
diff --git a/bin/mkeventd b/bin/mkeventd
index 866ed04..353099a 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -2914,8 +2914,7 @@ class EventServer(ECServerThread):
assert ty in [ "overall", "by_rule", "by_host" ]
num_already_open = g_event_status.get_num_existing_events_by(ty, event)
- limit = g_config["event_limit"][ty]["limit"]
- action = g_config["event_limit"][ty]["action"]
+ limit, action = self._get_event_limit(ty, event)
self.logger.verbose(" Type: %s, already open events: %d, Limit: %d" % (ty, num_already_open, limit))
# Limit not reached: add new event
@@ -2960,6 +2959,20 @@ class EventServer(ECServerThread):
return False
+ # protected by lock_eventstatus
+ def _get_event_limit(self, ty, event):
+ # Prefer the rule inidividual limit for by_rule limit (in case there is some)
+ if ty == "by_rule":
+ rule_limit = self._rule_by_id[event["rule_id"]].get("event_limit")
+ if rule_limit:
+ return rule_limit["limit"], rule_limit["action"]
+
+ limit = g_config["event_limit"][ty]["limit"]
+ action = g_config["event_limit"][ty]["action"]
+
+ return limit, action
+
+
def _create_overflow_event(self, ty, event):
now = time.time()
new_event = {
diff --git a/web/plugins/wato/mkeventd.py b/web/plugins/wato/mkeventd.py
index cae5679..a84cd0a 100644
--- a/web/plugins/wato/mkeventd.py
+++ b/web/plugins/wato/mkeventd.py
@@ -419,6 +419,20 @@ def vs_mkeventd_rule(rule_pack):
"will be no \"open event\" to be handled by the administrators."),
)
),
+ ("event_limit", Alternative(
+ title = _("Custom rule event limit"),
+ help = _("Use this option to override the "
+ "<a href=\"wato.py?mode=mkeventd_edit_configvar&site=&varname=event_limit\">"
+ "global rule event limit</a>"),
+ style = "dropdown",
+ elements = [
+ FixedValue(None,
+ title = _("Use global rule limit"),
+ totext = "",
+ ),
+ vs_ec_rule_limit(),
+ ],
+ )),
( "count",
Dictionary(
title = _("Count messages in defined interval"),
@@ -848,7 +862,7 @@ def vs_mkeventd_rule(rule_pack):
( _("Matching Criteria"), [ "match", "match_host", "match_ipaddress", "match_application", "match_priority", "match_facility",
"match_sl", "match_ok", "cancel_priority", "cancel_application", "match_timeperiod", "invert_matching" ]),
( _("Outcome & Action"), [ "state", "sl", "contact_groups", "actions", "actions_in_downtime",
- "cancel_actions", "cancel_action_phases", "drop", "autodelete" ]),
+ "cancel_actions", "cancel_action_phases", "drop", "autodelete", "event_limit" ]),
( _("Counting & Timing"), [ "count", "expect", "delay", "livetime", ]),
( _("Rewriting"), [ "set_text", "set_host", "set_application", "set_comment", "set_contact" ]),
],
@@ -2543,6 +2557,30 @@ if mkeventd_enabled:
default_value = "stop_overflow_notify",
)
+ def vs_ec_rule_limit():
+ return Dictionary(
+ title = _("Rule limit"),
+ help = _("You can limit the number of current events created by a single "
+ "rule here. This is meant to "
+ "prevent you from too generous rules creating a lot of events.<br>"
+ "Once the limit is reached, the Event Console will stop the rule "
+ "creating new current events until the number of current "
+ "events has been reduced to be below this limit. In the "
+ "moment the limit is reached, the Event Console will notify "
+ "the configured contacts of the rule or create a notification "
+ "with empty contact information."),
+ elements = [
+ ("limit", Integer(
+ title = _("Limit"),
+ minvalue = 1,
+ default_value = 1000,
+ unit = _("current events"),
+ )),
+ ("action", vs_ec_event_limit_actions("notify contacts in rule or fallback contacts")),
+ ],
+ optional_keys = [],
+ )
+
register_configvar(groups["ec"],
"event_limit",
Dictionary(
@@ -2573,28 +2611,7 @@ if mkeventd_enabled:
],
optional_keys = [],
)),
- ("by_rule", Dictionary(
- title = _("Rule limit"),
- help = _("You can limit the number of current events created by a single "
- "rule here. This is meant to "
- "prevent you from too generous rules creating a lot of events.<br>"
- "Once the limit is reached, the Event Console will stop the rule "
- "creating new current events until the number of current "
- "events has been reduced to be below this limit. In the "
- "moment the limit is reached, the Event Console will notify "
- "the configured contacts of the rule or create a notification "
- "with empty contact information."),
- elements = [
- ("limit", Integer(
- title = _("Limit"),
- minvalue = 1,
- default_value = 1000,
- unit = _("current events"),
- )),
- ("action", vs_ec_event_limit_actions("notify contacts in rule or fallback contacts")),
- ],
- optional_keys = [],
- )),
+ ("by_rule", vs_ec_rule_limit()),
("overall", Dictionary(
title = _("Overall current events"),
help = _("To protect you against a continously growing list of current "
@@ -2852,7 +2869,6 @@ if mkeventd_enabled:
domain = ConfigDomainEventConsole,
)
-
# Settings that should also be avaiable on distributed Sites that
# do not run an own eventd but want to query one or send notifications
# to one.