Module: check_mk
Branch: master
Commit: e68bb49c6767824759a7b4f312d76690569ae66b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e68bb49c676782…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu May 16 09:52:50 2013 +0200
WATO: New rule for notification_options of hosts and services
---
ChangeLog | 1 +
web/plugins/wato/check_mk_configuration.py | 51 +++++++++++++++++++++++++++-
2 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 41d9723..d688d30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -125,6 +125,7 @@
for each logfile on a host
* Configuration of an alternativ host check command
* Inventory: Display link symbol for ps ruleset
+ * New rule for notification_options of hosts and services
* FIX: Rulesets: correct display of rules within subfolders
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 2a90b6a..1bc5f19 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1257,8 +1257,57 @@ register_rule(group,
"service completely. Per default all notifications are enabled."),
choices = [ ("1", _("Enable service notifications")),
("0", _("Disable service notifications")) ],
+ ),
+ itemtype = "service"
+)
+
+register_rule(group,
+ "extra_host_conf:notification_options",
+ Transform(
+ ListChoice(
+ choices = [
+ ( "d", _("Host goes down")),
+ ( "u", _("Host gets unreachble")),
+ ( "r", _("Host goes up again")),
+ ( "f", _("Start or end of flapping state")),
+ ( "s", _("Start or end of a scheduled downtime")),
+ ],
+ default_value = [ "d", "u", "r", "f", "s" ],
),
- itemtype = "service")
+ 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."),
+ forth = lambda x: x != 'n' and x.split(",") or [],
+ back = lambda x: ",".join(x) or "n",
+ ),
+)
+
+register_rule(group,
+ "extra_service_conf:notification_options",
+ Transform(
+ ListChoice(
+ choices = [
+ ("w", _("Service goes into warning state")),
+ ("u", _("Service goes into unknown state")),
+ ("c", _("Service goes into critical state")),
+ ("r", _("Service recovers to OK")),
+ ("f", _("Start or end of flapping state")),
+ ("s", _("Start or end of a scheduled downtime")),
+ ],
+ default_value = [ "w", "u", "c", "r", "f", "s" ],
+ ),
+ title = _("Notified events for services"),
+ help = _("This ruleset allows you to restrict notifications of service problems to certain "
+ "states, e.g. only notify on CRIT, but not on WARN. 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."),
+ forth = lambda x: x != 'n' and x.split(",") or [],
+ back = lambda x: ",".join(x) or "n",
+ ),
+ itemtype = "service"
+)
register_rule(group,
"extra_host_conf:notification_period",
Module: check_mk
Branch: master
Commit: 5305cc3c59a311230fd1fb9c8fad16f6fb2c4965
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5305cc3c59a311…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed May 15 15:41:23 2013 +0200
winperf_tcp_conn: now with performance data and checkman
---
checkman/winperf_tcp_conn | 19 +++++++++++++++++++
checks/winperf_tcp_conn | 5 ++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/checkman/winperf_tcp_conn b/checkman/winperf_tcp_conn
new file mode 100644
index 0000000..abed0d9
--- /dev/null
+++ b/checkman/winperf_tcp_conn
@@ -0,0 +1,19 @@
+title: Monitor number of TCP connections per state
+agents: windows
+author: Andreas Boesl (ab(a)mathias-kettner.de)
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the number of established TCP connections on windows systems
+
+perfdata:
+ The number of established connections
+
+inventory:
+ If the windows agents has the section <<<winperf_tcp_conn>>>, then one check
+ will be created
+
+
+[parameters]
+levels(dict from string to (int, int)): A python dictionary with the key ESTABLISHED and a pair of integers for warning and critical levels. If this state is not listed then the check will be always OK
+
diff --git a/checks/winperf_tcp_conn b/checks/winperf_tcp_conn
index 7427666..14a9ce4 100644
--- a/checks/winperf_tcp_conn
+++ b/checks/winperf_tcp_conn
@@ -45,9 +45,11 @@ def check_winperf_tcp_conn(item, params, info):
]
infotext = ""
worst_state = 0
+ perfdata = []
for offset, name, param_key in fields:
value = saveint(info[offset][1])
infotext += "%s: %s" % (name, value)
+ warn, crit = "", ""
if params.get(param_key):
warn, crit = params.get(param_key)
if value >= crit:
@@ -57,9 +59,10 @@ def check_winperf_tcp_conn(item, params, info):
worst_state = max(1, worst_state)
infotext += "(!) (warning at %d)" % warn
infotext += ", "
+ perfdata.append( (name, value, warn, crit) )
infotext = infotext[:-2]
- return (worst_state, infotext)
+ return worst_state, infotext, perfdata
check_info["winperf_tcp_conn"] = {
'check_function': check_winperf_tcp_conn,
Module: check_mk
Branch: master
Commit: e0d283911f1978308a2d7ff59b39ecbf16eb6b79
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e0d283911f1978…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue May 14 16:20:58 2013 +0200
Fixed typo in help text
---
web/plugins/wato/check_mk_configuration.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index a5c2360..2a90b6a 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1419,7 +1419,7 @@ register_rule(group,
CheckTypeSelection(
title = _("Ignored checks"),
help = _("This ruleset is similar to 'Ignored services', but selects checks to be ignored "
- "by their <b>type</b>. This allows to disable certain techinal implementations "
+ "by their <b>type</b>. This allows you to disable certain technical implementations "
"such as filesystem checks via SNMP on hosts that also have the Check_MK agent "
"installed."),
))
Module: check_mk
Branch: master
Commit: b1a8837827db75486eac0ba58d679986f3d89f96
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b1a8837827db75…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue May 14 13:04:07 2013 +0200
lnx_if: show MAC address for interfaces (needs also agent update)
---
ChangeLog | 1 +
agents/check_mk_agent.linux | 5 +++--
checks/lnx_if | 7 +++++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f4bc640..678a8e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -95,6 +95,7 @@
* uptime, snmp_uptime, esx_vsphere_counters.uptime: allow to set lower and upper levels
* winperf_processor: Now displays (and scales) to number of cpus in pnpgraph
* mk_postgres plugin: replace select * with list of explicit columns (fix for PG 9.1)
+ * lnx_if: show MAC address for interfaces (needs also agent update)
Notifications:
* notify.py: unique spoolfiles name no longer created with uuid
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 78902ca..9c80562 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -166,8 +166,9 @@ if type ethtool > /dev/null
then
for eth in $(sed -e 1,2d < /proc/net/dev | cut -d':' -f1 | sort)
do
- echo "[$eth]"
- ethtool $eth | egrep '(Speed|Duplex|Link detected|Auto-negotiation):'
+ echo "[$eth]"
+ ethtool $eth | egrep '(Speed|Duplex|Link detected|Auto-negotiation):'
+ echo -en "\tAddress: " ; cat /sys/class/net/$eth/address
done
fi
diff --git a/checks/lnx_if b/checks/lnx_if
index 0099d8c..516407a 100644
--- a/checks/lnx_if
+++ b/checks/lnx_if
@@ -37,6 +37,7 @@
# Duplex: Unknown! (255)
# Auto-negotiation: on
# Link detected: no
+# Address: de:ad:be:af:00:01
# [eth1]
# Speed: 1000Mb/s
# Duplex: Full
@@ -60,7 +61,7 @@ def if_lnx_convert_to_if64(info):
nic = line[0]
nic_info[nic] = { "counters": map(int, line[1].split()) }
else:
- nic_info[current_nic][line[0].strip()] = line[1].strip()
+ nic_info[current_nic][line[0].strip()] = ":".join(line[1:]).strip()
# if index is 0 we either have found no nics or no information
# from ethtool is present. In the latter case we continue and
@@ -130,7 +131,9 @@ def if_lnx_convert_to_if64(info):
ifOperStatus = 4 # unknown (NIC has never been used)
# There is no mac adress data available for the moment
- ifPhysAddress = ''
+ def hextobin(x):
+ return chr(int(x, 16))
+ ifPhysAddress = "".join([chr(int(x, 16)) for x in attr.get("Address", "").split(":")])
if_table.append(map(str, [
ifIndex, ifDescr, ifType, ifSpeed, ifOperStatus,