Module: check_mk
Branch: master
Commit: d91704bac2920fc48abc4778c14ead6ed71e85fe
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d91704bac2920f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jan 24 15:50:25 2014 +0100
New column painter for the last time a service was OK
This information is displayed in the details of a service.
---
.werks/683 | 8 ++++++++
ChangeLog | 1 +
web/plugins/views/builtin.py | 1 +
web/plugins/views/painters.py | 7 +++++++
4 files changed, 17 insertions(+)
diff --git a/.werks/683 b/.werks/683
new file mode 100644
index 0000000..0fb25b9
--- /dev/null
+++ b/.werks/683
@@ -0,0 +1,8 @@
+Title: New column painter for the last time a service was OK
+Level: 1
+Component: multisite
+Version: 1.2.5i1
+Date: 1390574993
+Class: feature
+
+This information is displayed in the details of a service.
diff --git a/ChangeLog b/ChangeLog
index 6da324c..198c205 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -153,6 +153,7 @@
* 0449 Show all custom variables of hosts and services in the detail views...
* 0665 Added mail notificaton method to custom user notification dialog...
* 0123 New time range filter for Downtimes and Comments...
+ * 0683 New column painter for the last time a service was OK...
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in Chrome/IE
* 0239 FIX: Fixed incorrect html formatting when displaying host or service comments...
* 0307 FIX: Increased performance of multisite GUI with a large userbase...
diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py
index c4cdfa8..1320e78 100644
--- a/web/plugins/views/builtin.py
+++ b/web/plugins/views/builtin.py
@@ -1274,6 +1274,7 @@ multisite_builtin_views.update({
('svc_notification_number', None),
('svc_check_type', None),
('svc_state_age', None),
+ ('svc_last_time_ok', None),
('svc_check_age', None),
('svc_next_check', None),
('svc_next_notification', None),
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index b91cf60..f018d14 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -532,6 +532,13 @@ multisite_painters["svc_next_check"] = {
"paint" : lambda row: paint_future_time(row["service_next_check"]),
}
+multisite_painters["svc_last_time_ok"] = {
+ "title" : _("The last time the service was OK"),
+ "short" : _("Last OK"),
+ "columns" : [ "service_last_time_ok", "service_has_been_checked" ],
+ "paint" : lambda row: paint_age(row["service_last_time_ok"], row["service_has_been_checked"] == 1, 60 * 10),
+}
+
multisite_painters["svc_next_notification"] = {
"title" : _("The time of the next service notification"),
"short" : _("Next notification"),
Module: check_mk
Branch: master
Commit: d210739c08bf4020858538574bc32b8d7b95092f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d210739c08bf40…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Jan 24 15:26:44 2014 +0100
add intialization of g_git_messages to page_automation
---
web/htdocs/wato.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 0bcddd7..b5226ec 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -8678,6 +8678,9 @@ def page_automation():
if secret != get_login_secret():
raise MKAuthException(_("Invalid automation secret."))
+ global g_git_messages
+ g_git_messages = []
+
# To prevent mixups in written files we use the same lock here as for
# the normal WATO page processing. This might not be needed for some
# special automation requests, like inventory e.g., but to keep it simple,
Module: check_mk
Branch: master
Commit: 71052482c96d05cafc213393b15ff7bff05eede0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=71052482c96d05…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Jan 24 15:09:03 2014 +0100
removed nowiki headline in werk 265
---
.werks/265 | 3 +--
ChangeLog | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/.werks/265 b/.werks/265
index 70fbe59..7d25af0 100644
--- a/.werks/265
+++ b/.werks/265
@@ -1,11 +1,10 @@
-Title: mpre_include: new local check, allows to include further mrpe configurations
+Title: mpre_include: run additional mrpe configs within user context
Level: 2
Component: checks
Version: 1.2.5i1
Date: 1390568187
Class: feature
-H1:<b class=new>1.2.5</b> Additional MRPE local check with new features
This version brings the new local check <tt>mrpe_include</tt> where you can
configure additional include files for mrpe and under which user context
the commands of these files are run. It allows non-root users to add additional
diff --git a/ChangeLog b/ChangeLog
index 84d8e9a..320ac19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -67,11 +67,11 @@
* 0125 unitrends_backup:Unitrends Backup...
* 0126 mikrotik_signal: Check for mikrotik wifi bridges
* 0127 hp_proliant_raid: Check for proliant RAID status.
- * 0265 mpre_include: new local check, allows to include further mrpe configurations...
* 0571 cmciii_lcp_fans: now monitors the lower limit for the rpm
* 0572 cmciii_lcp_waterflow: lower and upper limits to the flow are now monitored
* 0573 cmciii_lcp_airin, cmciii_lcp_airout, cmciii_lcp_waterin, cmciii_lcp_waterout: checks now observe limits to the temperatures
* 0128 unitrends_replication: Check for monitoring Replicaion staus on Unitrend systems
+ * 0265 mpre_include: run additional mrpe configs within user context...
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
Module: check_mk
Branch: master
Commit: 709eac569e50c521e912aeb597b41294431a8d8e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=709eac569e50c5…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Jan 24 14:39:36 2014 +0100
New local check mrpe_include
---
.werks/265 | 37 +++++++++++++++++++++++++++++++++++++
ChangeLog | 1 +
agents/plugins/mrpe_include | 26 ++++++++++++++++++++++++++
3 files changed, 64 insertions(+)
diff --git a/.werks/265 b/.werks/265
new file mode 100644
index 0000000..70fbe59
--- /dev/null
+++ b/.werks/265
@@ -0,0 +1,37 @@
+Title: mpre_include: new local check, allows to include further mrpe configurations
+Level: 2
+Component: checks
+Version: 1.2.5i1
+Date: 1390568187
+Class: feature
+
+H1:<b class=new>1.2.5</b> Additional MRPE local check with new features
+This version brings the new local check <tt>mrpe_include</tt> where you can
+configure additional include files for mrpe and under which user context
+the commands of these files are run. It allows non-root users to add additional
+mrpe commands without modifying the <tt>mrpe.cfg</tt> file.
+You can assign include files to users and define in which user context the commands
+should be executed.
+
+This check is configured with the configuration
+file <tt>mrpe_include.cfg</tt>. In a default installation this file is located
+within the Check_MK config directory under <tt>/etc/check_mk/mrpe_include.cfg</tt>.
+
+The <tt>mrpe_include.cfg</tt> does not contain the new mrpe commands,
+though a user name followed by a include path.
+Here is an example:
+
+F+:/etc/check_mk/mrpe_include.cfg
+# Execute as user ab
+ab /etc/check_mk/mrpe_ab_commands.cfg
+# Execute as user lm
+lm /etc/other/mrpe_lm.cfg
+# Execute with no user context change
+- /etc/mrpe_default.cfg
+F-:
+
+Each line consists of two parameters, the user followed by the include file.
+Each command within the include file is executed as this user.
+If you do not want to change the user context (default is root), you can set the user to <tt>-</tt>.
+The included files have the same configuration syntax as the <tt>mrpe.cfg</tt>.
+
diff --git a/ChangeLog b/ChangeLog
index bc7cdbf..4533170 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,6 +66,7 @@
* 0125 unitrends_backup:Unitrends Backup...
* 0126 mikrotik_signal: Check for mikrotik wifi bridges
* 0127 hp_proliant_raid: Check for proliant RAID status.
+ * 0265 mpre_include: new local check, allows to include further mrpe configurations...
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/agents/plugins/mrpe_include b/agents/plugins/mrpe_include
new file mode 100755
index 0000000..3fcfb64
--- /dev/null
+++ b/agents/plugins/mrpe_include
@@ -0,0 +1,26 @@
+#!/bin/bash
+echo '<<<mrpe>>>'
+grep -Ev '^[[:space:]]*($|#)' "$MK_CONFDIR/mrpe_include.cfg" | \
+while read user include
+do
+ if [ -f $include ] ; then
+ PREFIX=""
+ if [ "$user" != "-" ] ; then
+ PREFIX="su $user -c "
+ fi
+
+ grep -Ev '^[[:space:]]*($|#)' "$include" | \
+ while read descr cmdline
+ do
+ PLUGIN=${cmdline%% *}
+ if [ -n "$PREFIX" ] ; then
+ cmdline="$PREFIX\"$cmdline\""
+ fi
+ OUTPUT=$(eval "$cmdline")
+ echo -n "(${PLUGIN##*/}) $descr $? $OUTPUT" | tr \\n \\1
+ echo
+ done
+ fi
+done
+
+
Module: check_mk
Branch: master
Commit: a3304115f1c479b91f1378711be06bf5e601e0cd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a3304115f1c479…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jan 24 14:29:25 2014 +0100
Update of Werk 682: Overriding of custom checks
---
.werks/682 | 15 +++++++--------
ChangeLog | 2 +-
modules/check_mk.py | 5 +++++
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/.werks/682 b/.werks/682
index 0da43bb..9a0407d 100644
--- a/.werks/682
+++ b/.werks/682
@@ -1,14 +1,13 @@
-Title: Allow overriding of active checks by more specific rule
+Title: Allow overriding of active and custom checks by more specific rule
Level: 1
Component: core
-Class: fix
State: unknown
Version: 1.2.5i1
Date: 1390564829
+Class: fix
-If you define an active Check via WATO in the main folder and then
-want to override this check in a subfolder, that was not possible
-up to now. Now if you define an active check <b>with the same
-type and service description</b> by a more specific rule, then
-that rule will override the more general ones (i.e. those
-coming later).
+If you define an active or custom Check via WATO in the main folder and
+then want to override this check in a subfolder, that was not possible up
+to now. Now if you define an active check <b>with the same type and service
+description</b> by a more specific rule, then that rule will override the
+more general ones (i.e. those coming later).
diff --git a/ChangeLog b/ChangeLog
index f07eef7..6da324c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,7 +19,7 @@
* 0259 FIX: Fixed htpasswd permission problem in check_mk standalone installation...
* 0453 FIX: Fix ugly Python exception in host diagnosis page in case of SNMP error...
* 0696 FIX: Remove garbled output of cmk -v in state of CMC
- * 0682 FIX: Allow overriding of active checks by more specific rule...
+ * 0682 FIX: Allow overriding of active and custom checks by more specific rule...
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 107c83d..20bb90b 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2356,6 +2356,11 @@ define service {
if description in used_descriptions:
cn, it = used_descriptions[description]
+ # If we have the same active check again with the same description,
+ # then we do not regard this as an error, but simply ignore the
+ # second one.
+ if cn == "custom(%s)" % command_name:
+ continue
raise MKGeneralException(
"ERROR: Duplicate service description (custom check) '%s' for host '%s'!\n"
" - 1st occurrance: checktype = %s, item = %r\n"
Module: check_mk
Branch: master
Commit: fd73e2b4be2e872436cba2ea57965e78114a078e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd73e2b4be2e87…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Jan 24 13:31:21 2014 +0100
unitrends_replication: Check for monitoring Replicaion staus on Unitrend systems
---
.werks/128 | 8 +++++
ChangeLog | 1 +
agents/plugins/unitrends_replication.py | 25 ++++++++++++++
checkman/unitrends_backup | 2 +-
checkman/unitrends_replication | 16 +++++++++
checks/unitrends_replication | 54 +++++++++++++++++++++++++++++++
6 files changed, 105 insertions(+), 1 deletion(-)
diff --git a/.werks/128 b/.werks/128
new file mode 100644
index 0000000..53625dc
--- /dev/null
+++ b/.werks/128
@@ -0,0 +1,8 @@
+Title: unitrends_replication: Check for monitoring Replicaion staus on Unitrend systems
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1390566649
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 24ba9df..5ebc407 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -69,6 +69,7 @@
* 0571 cmciii_lcp_fans: now monitors the lower limit for the rpm
* 0572 cmciii_lcp_waterflow: lower and upper limits to the flow are now monitored
* 0573 cmciii_lcp_airin, cmciii_lcp_airout, cmciii_lcp_waterin, cmciii_lcp_waterout: checks now observe limits to the temperatures
+ * 0128 unitrends_replication: Check for monitoring Replicaion staus on Unitrend systems
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/agents/plugins/unitrends_replication.py b/agents/plugins/unitrends_replication.py
new file mode 100755
index 0000000..a5e3fb6
--- /dev/null
+++ b/agents/plugins/unitrends_replication.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+import sys, time, urllib
+from xml.dom import minidom
+now = int(time.time())
+start = now - 24 * 60 * 60
+end = now
+dpu = 1
+
+url = "http://localhost/recoveryconsole/bpl/syncstatus.php?type=replicate&argument…:" % ( start, end, dpu )
+xml = urllib.urlopen(url)
+
+print "<<<unitrends_replication:sep(124)>>>"
+dom = minidom.parse(xml)
+for item in dom.getElementsByTagName('SecureSyncStatus'):
+ application = item.getElementsByTagName('Application')
+ if application:
+ application = application[0].attributes['Name'].value
+ else:
+ application = "N/A"
+ result = item.getElementsByTagName('Result')[0].firstChild.data
+ completed = item.getElementsByTagName('Complete')[0].firstChild.data
+ targetname = item.getElementsByTagName('TargetName')[0].firstChild.data
+ instancename = item.getElementsByTagName('InstanceName')[0].firstChild.data
+ print "%s|%s|%s|%s|%s" % (application, result, completed, targetname, instancename)
diff --git a/checkman/unitrends_backup b/checkman/unitrends_backup
index d8787c7..9350d8d 100644
--- a/checkman/unitrends_backup
+++ b/checkman/unitrends_backup
@@ -5,7 +5,7 @@ license: GPL
distribution: check_mk
description:
Unitrends is a enterprise class backup solution.
- This plugin needs the unitrends_backup plugin installed on the unitrends server
+ This check needs the unitrends_backup.php plugin installed on the unitrends server
in order to work. The plugin will deliver a complete list of all schedules including
a sublist of a jobs in this schdule from the last 24 hours.
diff --git a/checkman/unitrends_replication b/checkman/unitrends_replication
new file mode 100644
index 0000000..2b90778
--- /dev/null
+++ b/checkman/unitrends_replication
@@ -0,0 +1,16 @@
+title: Unitrends Replication status
+agents: linux
+catalog: app/unitrends
+license: GPL
+distribution: check_mk
+description:
+ Unitrends is a enterprise class backup solution.
+ This check needs the unitrends_replication.py plugin installed on the unitrends server
+ in order to work. The plugin will deliver a complete list of all replication entries and
+ her status
+
+ As long all of the jobs are succsessful the check returns a {OK} state. In each other
+ case the check will return {CRITICAL} and deliver the list of the failed replications
+
+inventory:
+ One Service for each replication target will be created
diff --git a/checks/unitrends_replication b/checks/unitrends_replication
new file mode 100644
index 0000000..959a206
--- /dev/null
+++ b/checks/unitrends_replication
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+
+def inventory_unitrends_replication(info):
+ inventory = []
+ for application, result, complete, target, instance in info:
+ if target not in [ x[0] for x in inventory ]:
+ inventory.append( (target, None) )
+ return inventory
+
+def check_unitrends_replication(item, _no_params, info):
+ # this never gone be a blessed check :)
+ replications = [ x for x in info if x[3] == item ]
+ if len(replications) == 0:
+ return 3, "No Entries found"
+ not_successfull = [ x for x in replications if x[1] != "Success"]
+ if len(not_successfull) == 0:
+ return 0, "All Replications in the last 24 hours Successfull"
+ messages = []
+ for application, result, complete, target, instance in not_successfull:
+ messages.append( "Target: %s, Result: %s, Instance: %s " % ( target, result, instance ))
+ # TODO: Maybe a good place to use multiline output here
+ return 2, "Errors from the last 24 hours: " + "/ ".join(messages)
+
+check_info["unitrends_replication"] = {
+ "check_function" : check_unitrends_replication,
+ "inventory_function" : inventory_unitrends_replication,
+ "service_description" : "Replicaion %s",
+}
+
Module: check_mk
Branch: master
Commit: c5b568fdd835bdc53d860e055d4f3e6cea6e0908
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c5b568fdd835bd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jan 24 13:02:29 2014 +0100
FIX Allow overriding of active checks by more specific rule
If you define an active Check via WATO in the main folder and then
want to override this check in a subfolder, that was not possible
up to now. Now if you define an active check <b>with the same
type and service description</b> by a more specific rule, then
that rule will override the more general ones (i.e. those
coming later).
---
.werks/682 | 14 ++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 6 ++++++
3 files changed, 21 insertions(+)
diff --git a/.werks/682 b/.werks/682
new file mode 100644
index 0000000..0da43bb
--- /dev/null
+++ b/.werks/682
@@ -0,0 +1,14 @@
+Title: Allow overriding of active checks by more specific rule
+Level: 1
+Component: core
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1390564829
+
+If you define an active Check via WATO in the main folder and then
+want to override this check in a subfolder, that was not possible
+up to now. Now if you define an active check <b>with the same
+type and service description</b> by a more specific rule, then
+that rule will override the more general ones (i.e. those
+coming later).
diff --git a/ChangeLog b/ChangeLog
index 51c3ffd..8bea274 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@
* 0259 FIX: Fixed htpasswd permission problem in check_mk standalone installation...
* 0453 FIX: Fix ugly Python exception in host diagnosis page in case of SNMP error...
* 0696 FIX: Remove garbled output of cmk -v in state of CMC
+ * 0682 FIX: Allow overriding of active checks by more specific rule...
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 2d64184..107c83d 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2289,6 +2289,12 @@ define service {
if description in used_descriptions:
cn, it = used_descriptions[description]
+ # If we have the same active check again with the same description,
+ # then we do not regard this as an error, but simply ignore the
+ # second one. That way one can override a check with other settings.
+ if cn == "active(%s)" % acttype:
+ continue
+
raise MKGeneralException(
"ERROR: Duplicate service description (active check) '%s' for host '%s'!\n"
" - 1st occurrance: checktype = %s, item = %r\n"