Module: check_mk
Branch: master
Commit: dd39b47643319699c39bc2c8032546509a754e39
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dd39b476433196…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Oct 25 16:27:38 2013 +0200
Updated bug entries #1082
---
.bugs/1082 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/.bugs/1082 b/.bugs/1082
new file mode 100644
index 0000000..8e6bc36
--- /dev/null
+++ b/.bugs/1082
@@ -0,0 +1,10 @@
+Title: Part of services missing after save in WATO
+Component: wato
+State: open
+Date: 2013-10-25 16:26:45
+Targetversion: 1.2.2
+Class: bug
+
+When you save the service list of a host in WATO then sometimes
+some checks are not being saved and displayed as "missing" the
+next time you enter the services list.
up to now it is only able to check power supplies in Brocade MLX Series
routers
Message-ID: <526a6c34.FU3nwFy1HWuzFA45%bs(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: 98333628750ca51d80abac1c82d9d2127eda0989
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=98333628750ca5…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Oct 25 15:03:42 2013 +0200
initial release of brocade_mlx check: up to now it is only able to check power supplies in Brocade MLX Series routers
---
checks/brocade_mlx | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/checks/brocade_mlx b/checks/brocade_mlx
new file mode 100644
index 0000000..24973cf
--- /dev/null
+++ b/checks/brocade_mlx
@@ -0,0 +1,61 @@
+#!/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.
+
+brocade_mlx_info = ('.1.3.6.1.4.1.1991.1.1.1.2.1.1', [ 1, 2, 3 ])
+
+def inventory_brocade_mlx_power(info):
+ inventory = []
+ for power_id, power_descr, power_state in info:
+ if power_descr == "":
+ power_item = power_id
+ else:
+ power_item = "%s %s" % (power_id, power_descr)
+ inventory.append( (power_item, None) )
+ return inventory
+
+def check_brocade_mlx_power(item, _no_params, info):
+ for power_id, power_descr, power_state in info:
+ if power_descr == "":
+ power_item = power_id
+ else:
+ power_item = "%s %s" % (power_id, power_descr)
+ if power_item == item:
+ if power_state == "2":
+ return 0, "Power supply reports status 2 (normal)"
+ elif power_state == "3":
+ return 2, "Power supply reports status 3 (failure)"
+ else:
+ return 3, "Power supply reports unidentified status %s" % power_state
+ return 3, "Power supply %s not found" % item
+
+check_info["brocade_mlx.power"] = {
+ "check_function" : check_brocade_mlx_power,
+ "inventory_function" : inventory_brocade_mlx_power,
+ "service_description" : "Power supply %s",
+ "snmp_info" : brocade_mlx_info,
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.1991.1."),
+ "has_perfdata" : False,
+}
Module: check_mk
Branch: master
Commit: d4235d710569f44caf0cd2699791952bedb8cd18
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d4235d710569f4…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Oct 25 12:37:25 2013 +0200
table statehist: no longer computes an unmonitored
state for hosts and services in certain instances
---
ChangeLog | 3 +++
livestatus/src/LogEntry.h | 1 +
livestatus/src/TableStateHistory.cc | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index b34bfca..55101fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -109,6 +109,9 @@
Livestatus:
* Removed "livecheck". It never was really stable. Nagios4 has something
similar built in. And also the Check_MK Micro Core.
+ * table statehist: no longer computes an unmonitored state for hosts and
+ services on certain instances.
+ (showed up as no hosts/services in the multisite gui)
1.2.3i4:
Core:
diff --git a/livestatus/src/LogEntry.h b/livestatus/src/LogEntry.h
index b744b64..1a3d18c 100644
--- a/livestatus/src/LogEntry.h
+++ b/livestatus/src/LogEntry.h
@@ -33,6 +33,7 @@
#define LOGCLASS_COMMAND 5 // external commands
#define LOGCLASS_STATE 6 // initial or current states
#define LOGCLASS_TEXT 7 // specific text passages. e.g "logging initial states"
+ // TODO: This LOGCLASS sets different logclasses on match -> fix this
#define LOGCLASS_INVALID -1 // never stored
#define LOGCLASS_ALL 0xffff
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index 4848bd5..6a6d93c 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -115,7 +115,7 @@ struct HostServiceState {
extern Store *g_store;
-#define CLASSMASK_STATEHIST 0xC2
+#define CLASSMASK_STATEHIST 0xC6
// Debug information
int total_update_calls = 0;
Module: check_mk
Branch: master
Commit: b338de4e6feee1e0aee903eed477b4f23525e124
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b338de4e6feee1…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Oct 24 14:50:03 2013 +0200
New check genua_pfstate for testing the state and number of used states
of the OpenBSD PF engine in genuscreen firewalls
---
checkman/genua_pfstate | 37 +++++++++++++++
checks/genua_pfstate | 85 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 21 +++++++++
3 files changed, 143 insertions(+)
diff --git a/checkman/genua_pfstate b/checkman/genua_pfstate
new file mode 100644
index 0000000..dfd5ee9
--- /dev/null
+++ b/checkman/genua_pfstate
@@ -0,0 +1,37 @@
+title: State of packetfilter engine for genuscreen firewalls
+agents: snmp
+catalog: hw/network/genua
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of the packetfilter engine of genuscreen
+ firewalls. It evaluates the pf status, number of used pf states and the
+ maximum number of pf states set for the engine. Warningn and critical
+ limits for the number of used states can be given. If the critical level
+ is not set, the maximum number of states defined for the engine will be
+ assumed.
+
+ The check is known to run with genuscreen version 3.0 and 4.1, and supports
+ genuas regular enterprise id 3717 as well as the id 3137 which was
+ introduced in a bug in some versions of genuscreen.
+
+perfdata:
+ The number of used PF states
+
+inventory:
+ The inventory process checks if the device has a system description OID
+ of .1.3.6.1.2.1.1.2.0 and if the name of this OID contains "genuscreen"
+ (case insensitive). If it also contains valid pf state output, the device is
+ inventorized.
+
+[parameters]
+parameters(dict): parameters is a dictionary with one key
+
+ {"used"}: a tuple of lower warning and critical values for the number
+of used PF states
+
+[configuration]
+genua_pfstate_default_levels(dict): This variable is preset to
+
+ {{ "used": ( None, None) }}
+
diff --git a/checks/genua_pfstate b/checks/genua_pfstate
new file mode 100644
index 0000000..ed3c18c
--- /dev/null
+++ b/checks/genua_pfstate
@@ -0,0 +1,85 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+
+# Example Agent Output:
+# GENUA-MIB:
+# .1.3.6.1.4.1.3717.2.1.1.6.1 = INTEGER: 300000
+# .1.3.6.1.4.1.3717.2.1.1.6.2 = INTEGER: 1268
+# .1.3.6.1.4.1.3717.2.1.1.6.3 = INTEGER: 1
+
+genua_pfstate_default_levels = { "used": ( None , None ) }
+
+def inventory_genua_pfstate(info):
+ # remove empty elements due to alternative enterprise id in snmp_info
+ info = filter(None, info)
+
+ if info[0]:
+ if len(info[0][0]) == 3:
+ return [ (None, genua_pfstate_default_levels) ]
+ else:
+ return []
+
+
+def pfstate(st):
+ names = {
+ '0' : 'notOK',
+ '1' : 'OK',
+ '2' : 'unknown',
+ }
+ return names.get(st, st)
+
+
+def check_genua_pfstate(item, params, info):
+ # remove empty elements due to alternative enterprise id in snmp_info
+ info = filter(None, info)
+
+ if info[0]:
+ if len(info[0][0]) == 3:
+ pfstateMax = saveint(info[0][0][0])
+ pfstateUsed = saveint(info[0][0][1])
+ pfstateStatus = info[0][0][2]
+ else:
+ return(3, "Invalid Output from Agent")
+
+ warn,crit = params.get("used")
+ if crit == None:
+ crit = pfstateMax
+
+ state = 0
+ usedsym = ""
+ statussym = ""
+ if pfstateStatus != "1":
+ state = 1
+ statussym = "(!)"
+
+ if crit and pfstateUsed > crit:
+ state = 2
+ usedsym = "(!!)"
+ elif warn and pfstateUsed > warn:
+ state = 1
+ usedsym = "(!)"
+
+ pfstatus = pfstate(str(pfstateStatus))
+ infotext = "PF State: %s%s States used: %d%s States max: %d" \
+ % (pfstatus, statussym, pfstateUsed, usedsym, pfstateMax )
+ perfdata = [ ( "statesused", pfstateUsed, None, pfstateMax ) ]
+ return (state, infotext, perfdata)
+
+check_info['genua_pfstate'] = {
+ "inventory_function" : inventory_genua_pfstate,
+ "check_function" : check_genua_pfstate,
+ "service_description": "Paketfilter Status",
+ "has_perfdata" : True,
+ "group" : "pf_used_states",
+ "snmp_info" : [( ".1.3.6.1.4.1.3717.2.1.1.6",[
+ 1, # "pfstateMax"
+ 2, # "pfstateUsed"
+ 3, # "pfstateStatus"
+ ]),
+ ( ".1.3.6.1.4.1.3137.2.1.1.6",[
+ 1, # "pfstateMax"
+ 2, # "pfstateUsed"
+ 3, # "pfstateStatus"
+ ])],
+ "snmp_scan_function" : lambda oid: "genuscreen" in oid(".1.3.6.1.2.1.1.1.0").lower()
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index c8759b0..b9d91bd 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -3173,6 +3173,27 @@ register_check_parameters(
)
register_check_parameters(
+ subgroup_os,
+ "pf_used_states",
+ _("Number of used states of OpenBSD PF engine"),
+ Dictionary(
+ elements = [
+ ("used",
+ Tuple(
+ title = _("Limits for the number of used states"),
+ elements = [
+ Integer(title = _("warning if above")),
+ Integer(title = _("critical if above")),
+ ]),
+ ),
+ ],
+ optional_keys = [None],
+ ),
+ None,
+ "first"
+)
+
+register_check_parameters(
subgroup_environment,
"pdu_gude",
_("Levels for Gude PDU Devices"),