condition now works
Message-ID: <532c240b.uh1+ckMDecUvp4fv%mk(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: c03876e2c762fffaa2c818b7ff918fc33aaa8edd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c03876e2c762ff…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 21 12:35:23 2014 +0100
INV: fixed rule for active check, condition now works
---
web/plugins/wato/inventory.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/web/plugins/wato/inventory.py b/web/plugins/wato/inventory.py
index 559ba57..c5c10c1 100644
--- a/web/plugins/wato/inventory.py
+++ b/web/plugins/wato/inventory.py
@@ -31,7 +31,7 @@ group = "inventory"
register_rule(group,
"active_checks:cmk_inv",
- None, # Currently no parameters
+ FixedValue(None, totext = _("No configuration neccessary")),
title = _("Do hardware/software Inventory"),
help = _("All hosts configured via this ruleset will do a hardware and "
"software inventory. For each configured host a new active check "
@@ -41,6 +41,7 @@ register_rule(group,
"<b>Note:</b> in order to get any useful "
"result for agent based hosts make sure that you have installed "
"the agent plugin <tt>mk_inventory</tt> on these hosts."),
+ match = "all",
)
register_rule(group,
Module: check_mk
Branch: master
Commit: a69b187b786474747eefd74804632f4ad11ef0c5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a69b187b786474…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 21 11:14:54 2014 +0100
check_notify_count: New active check to monitor the number of notifications sent to contacts
Check the number of sent notifications per contact using the plugin <tt>check_notify_count</tt>
provided with Check_MK. This plugin counts the total number of notifcations sent by the local
monitoring core and creates graphs for each individual contact.
---
.werks/759 | 10 +++
ChangeLog | 1 +
checkman/check_notify_count | 28 +++++++
checks/check_notify_count | 43 ++++++++++
doc/treasures/active_checks/check_notify_count | 99 ++++++++++++++++++++++++
pnp-templates/check_mk_active-notify_count.php | 44 +++++++++++
web/plugins/wato/active_checks.py | 40 ++++++++++
7 files changed, 265 insertions(+)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=a69b187b78…
Module: check_mk
Branch: master
Commit: 2a036ced5c63df141d0fbf0d53d8dc8db0d2fb91
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a036ced5c63df…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 21 10:26:52 2014 +0100
FIX Availability: fix exception when summary is on and some elements have never been OK
---
.werks/750 | 8 ++++++++
ChangeLog | 1 +
web/plugins/views/availability.py | 6 +++++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/750 b/.werks/750
new file mode 100644
index 0000000..ee3c3b6
--- /dev/null
+++ b/.werks/750
@@ -0,0 +1,8 @@
+Title: Availability: fix exception when summary is on and some elements have never been OK
+Level: 1
+Component: reporting
+Version: 1.2.5i1
+Date: 1395393981
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 7d79fd1..56ced6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -354,6 +354,7 @@
* 0405 Add CSV export to availability views...
* 0338 FIX: Introduce time limit on availability queries...
* 0681 FIX: Display correct year for availability range for last month in january
+ * 0750 FIX: Availability: fix exception when summary is on and some elements have never been OK
Event Console:
* 0301 Handling messages of special syslog format correctly...
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index ce7efa9..907a460 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -1161,7 +1161,8 @@ def render_availability_group(group_title, range_title, group_id, availability,
elif show_summary:
summary.setdefault(sid, 0.0)
if avoptions["timeformat"].startswith("percentage"):
- summary[sid] += float(number) / considered_duration
+ if considered_duration > 0:
+ summary[sid] += float(number) / considered_duration
else:
summary[sid] += number
@@ -1237,6 +1238,9 @@ def render_availability_group(group_title, range_title, group_id, availability,
table.end()
def check_av_levels(number, av_levels, considered_duration):
+ if considered_duration == 0:
+ return 0
+
perc = 100 * float(number) / float(considered_duration)
warn, crit = av_levels
if perc < crit:
Module: check_mk
Branch: master
Commit: e90ff6446582aa723cdc1d3911dc5e09b7fa63d7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e90ff6446582aa…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Mar 20 23:17:04 2014 +0100
dell_chassis_slots: new check to monitor the status of the blade slots of the Dell Poweredge Blade Servers
---
.werks/597 | 8 +++++
ChangeLog | 1 +
checkman/dell_chassis_slots | 22 +++++++++++++
checks/dell_chassis_slots | 73 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 104 insertions(+)
diff --git a/.werks/597 b/.werks/597
new file mode 100644
index 0000000..844d207
--- /dev/null
+++ b/.werks/597
@@ -0,0 +1,8 @@
+Title: dell_chassis_slots: new check to monitor the status of the blade slots of the Dell Poweredge Blade Servers
+Level: 2
+Component: checks
+Version: 1.2.5i1
+Date: 1395353802
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index aa14644..7d79fd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,7 @@
* 0144 enterasys_cpu_util enterasys_powersupply: New Checks for CPU Utilization and Power Supplies on enterasys switches
* 0595 dell_chassis_power, dell_chassis_powersupplies: new checks for Dell Poweredge Chassis Ppower consumption...
* 0596 dell_chassis_status, dell_chassis_temp, dell_chassis_kvm, dell_chassis_io, dell_chassis_fans: new checks to monitor the overall status of various sections of the Dell Poweredge Chassis via CMC
+ * 0597 dell_chassis_slots: new check to monitor the status of the blade slots of the Dell Poweredge Blade Servers
* 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/checkman/dell_chassis_slots b/checkman/dell_chassis_slots
new file mode 100644
index 0000000..a382cab
--- /dev/null
+++ b/checkman/dell_chassis_slots
@@ -0,0 +1,22 @@
+title: Dell PowerEdge Chassis: State of the Blade Slots
+agents: snmp
+catalog: hw/server/dell
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the blade slots of the chassis of Dell PowerEdge Servers.
+
+ The check returns {OK} when a slot is in the {basic} state. It returns {WARN}
+ otherwise.
+
+ No limits are set in the check.
+
+ In addition to the state, the check displays the following other parameters
+ of the server: drsServerServiceTag, drsServerSlotName
+
+item:
+ The id of the slot
+
+inventory:
+ All slots where the state is not "absent".
+
diff --git a/checks/dell_chassis_slots b/checks/dell_chassis_slots
new file mode 100644
index 0000000..a3a634a
--- /dev/null
+++ b/checks/dell_chassis_slots
@@ -0,0 +1,73 @@
+#!/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.
+
+dell_chassis_slots_info = ( ".1.3.6.1.4.1.674.10892.2.5.1.1", [
+ "1", # drsServerIndex
+ "2", # drsServerMonitoringCapable
+ "3", # drsServerServiceTag
+ "4", # drsServerSlotName
+ ])
+
+dell_chassis_slots_scan = lambda oid: oid('.1.3.6.1.2.1.1.2.0') == ".1.3.6.1.4.1.674.10892.2"
+
+def inventory_dell_chassis_slots(info):
+ inventory = []
+ for line in info:
+ index = line[0]
+ if saveint(index) in ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ):
+ index = "0"+index
+ if line[1] != "1" and line[3] != "N/A":
+ inventory.append( ( index, None ) )
+ return inventory
+
+def check_dell_chassis_slots(item, _no_params, info):
+ for index, status, service_tag, name in info:
+ if saveint(index) in ( 1, 2, 3, 4, 5, 6, 7, 8, 9 ):
+ index = "0"+index
+ if item == index:
+ #absent = 1,none = 2,basic = 3,off = 4,
+ state_table = {
+ "1" : ( "absent", 0 ),
+ "2" : ( "none", 1 ),
+ "3" : ( "basic", 0 ),
+ "4" : ( "off", 1 ),
+ }
+ state_txt, state = state_table.get(status, ("unknown state, ", 3 ))
+ infotext = "Status: %s, Name: %s, ServiceTag: %s" % ( state_txt, name, service_tag )
+
+ return state, infotext
+
+ return 3, "unknown slot"
+
+check_info["dell_chassis_slots"] = {
+ "check_function" : check_dell_chassis_slots,
+ "inventory_function" : inventory_dell_chassis_slots,
+ "service_description" : "Slot %s",
+ "has_perfdata" : False,
+ "snmp_info" : dell_chassis_slots_info,
+ "snmp_scan" : dell_chassis_slots_scan,
+}
+