Module: check_mk
Branch: master
Commit: 4cbcfec31915b53eecc5434cba847a97086cc5a4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4cbcfec31915b5…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Feb 21 12:46:02 2017 +0100
4027 FIX BI Aggregations: fixed compilation problem with BI aggregations when using sites without hosts
BI aggregations did not compile correctly for sites without hosts.
Happens when there was an empty viewer site with several connected real sites.
Change-Id: Id84214e23443b02fe1173038ce848c771cc0b0fd
---
.werks/4027 | 11 +++++++++++
web/htdocs/bi.py | 5 +++++
2 files changed, 16 insertions(+)
diff --git a/.werks/4027 b/.werks/4027
new file mode 100644
index 0000000..cfb420f
--- /dev/null
+++ b/.werks/4027
@@ -0,0 +1,11 @@
+Title: BI Aggregations: fixed compilation problem with BI aggregations when using sites without hosts
+Level: 1
+Component: bi
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.5.0i1
+Date: 1487677398
+
+BI aggregations did not compile correctly for sites without hosts.
+Happens when there was an empty viewer site with several connected real sites.
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index e1bc75c..f2d247b 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -700,6 +700,11 @@ class BISitedataManager(object):
cleanup_orphaned_files = True
only_sites = [x[0] for x in missing_sites]
new_data = self._query_data(only_sites)
+
+ sites_with_no_data = set(map(lambda x: x[0], missing_sites)) - set(new_data.keys())
+ for site in sites_with_no_data:
+ new_data[site] = {}
+
for site, sitedata in new_data.items():
# Write data to disk
siteinfo = (site, dict(missing_sites).get(site))
Module: check_mk
Branch: master
Commit: 861fc2f64ea1d4839ce80714cc50f9fbfcd81d80
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=861fc2f64ea1d4…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Feb 21 12:01:08 2017 +0100
4347 packeteer_{fan,ps}_status: Two checks for Blue Coat Packet Shaper devices
Change-Id: I95d13e2a5dbb94d0eab3cff81b809f996480f5ba
---
.werks/4347 | 10 +++++++++
checkman/packeteer_fan_status | 10 +++++++++
checkman/packeteer_ps_status | 10 +++++++++
checks/packeteer_fan_status | 50 +++++++++++++++++++++++++++++++++++++++++++
checks/packeteer_ps_status | 47 ++++++++++++++++++++++++++++++++++++++++
5 files changed, 127 insertions(+)
diff --git a/.werks/4347 b/.werks/4347
new file mode 100644
index 0000000..304559c
--- /dev/null
+++ b/.werks/4347
@@ -0,0 +1,10 @@
+Title: packeteer_{fan,ps}_status: Two checks for Blue Coat Packet Shaper devices
+Level: 1
+Component: checks
+Class: feature
+Compatible: compat
+State: unknown
+Version: 1.5.0i1
+Date: 1487674799
+
+
diff --git a/checkman/packeteer_fan_status b/checkman/packeteer_fan_status
new file mode 100644
index 0000000..3bdbfbd
--- /dev/null
+++ b/checkman/packeteer_fan_status
@@ -0,0 +1,10 @@
+title: Blue Coat Packet Shaper: Fan Status
+agents: snmp
+catalog: hw/network/bluecoat
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of fans as described in the Packeteer MIB.
+
+inventory:
+ One check for each fan will be created.
diff --git a/checkman/packeteer_ps_status b/checkman/packeteer_ps_status
new file mode 100644
index 0000000..034a362
--- /dev/null
+++ b/checkman/packeteer_ps_status
@@ -0,0 +1,10 @@
+title: Blue Coat Packet Shaper: Power Supply Status
+agents: snmp
+catalog: hw/network/bluecoat
+license: GPL
+distribution: check_mk
+description:
+ Checks the status of power supplies as described in the Packeteer MIB.
+
+inventory:
+ One check for each device will be created.
diff --git a/checks/packeteer_fan_status b/checks/packeteer_fan_status
new file mode 100644
index 0000000..51099dc
--- /dev/null
+++ b/checks/packeteer_fan_status
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2017 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-
+# tails. 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_packeteer_fan_status(info):
+ for nr, fan_status in enumerate(info[0]):
+ if fan_status in [ u"1", u"2" ]:
+ yield ("%d" % nr, None)
+
+
+def check_packeteer_fan_status(item, _no_params, info):
+ fan_status = info[0][int(item)]
+ if fan_status == u"1":
+ return 0, "OK"
+ elif fan_status == u"2":
+ return 2, "Not OK"
+ elif fan_status == u"3":
+ return 2, "Not present"
+
+
+check_info["packeteer_fan_status"] = {
+ "inventory_function" : inventory_packeteer_fan_status,
+ "check_function" : check_packeteer_fan_status,
+ "service_description" : "Fan Status",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.2334"),
+ "snmp_info" : ( ".1.3.6.1.4.1.2334.2.1.5", [ "12", "14", "22", "24" ]),
+}
diff --git a/checks/packeteer_ps_status b/checks/packeteer_ps_status
new file mode 100644
index 0000000..1ea140f
--- /dev/null
+++ b/checks/packeteer_ps_status
@@ -0,0 +1,47 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2017 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-
+# tails. 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_packeteer_ps_status(info):
+ if info:
+ return [ (None, None) ]
+
+
+def check_packeteer_ps_status(_no_item, _no_params, info):
+ for nr, ps_status in enumerate(info[0]):
+ if ps_status == u"1":
+ yield 0, "Power Supply %d okay" % nr
+ else:
+ yield 2, "Power Supply %d not okay" % nr
+
+
+check_info["packeteer_ps_status"] = {
+ "inventory_function" : inventory_packeteer_ps_status,
+ "check_function" : check_packeteer_ps_status,
+ "service_description" : "Power Supply Status",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.2334"),
+ "snmp_info" : ( ".1.3.6.1.4.1.2334.2.1.5", [ "8", "10" ]),
+}