Module: check_mk
Branch: master
Commit: 8df689b9c7122e78ebf5fba75b1d32fe12d3368f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8df689b9c7122e…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Tue Aug 19 13:32:05 2014 +0200
#0647 FIX printer_input, printer_output: multiple fixes to algorithm for state determination and inventory function
The inventory function now considers the description of the unit if its name is not configured. This should lead to
more and more meaningful items. Still, all units with empty name and description will be merged into one single
service with an empty item name.
The algorithm to determine the states of a unit was plain wrong, so that a nonsense collection of states were given.
This has been corrected. Still several states may be derived, but they should now correctly describe the operational
state of the unit.
The inventory function also used the same algorithm to inventorize only units with meaningful states. Therefore some
changes may be expected in the inventory of a printer as well.
---
.werks/647 | 18 ++++++++++++++++++
ChangeLog | 1 +
checks/printer_io.include | 27 ++++++++++++++++++++-------
3 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/.werks/647 b/.werks/647
new file mode 100644
index 0000000..248eeed
--- /dev/null
+++ b/.werks/647
@@ -0,0 +1,18 @@
+Title: printer_input, printer_output: multiple fixes to algorithm for state determination and inventory function
+Level: 2
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1408447192
+Class: fix
+
+The inventory function now considers the description of the unit if its name is not configured. This should lead to
+more and more meaningful items. Still, all units with empty name and description will be merged into one single
+service with an empty item name.
+
+The algorithm to determine the states of a unit was plain wrong, so that a nonsense collection of states were given.
+This has been corrected. Still several states may be derived, but they should now correctly describe the operational
+state of the unit.
+
+The inventory function also used the same algorithm to inventorize only units with meaningful states. Therefore some
+changes may be expected in the inventory of a printer as well.
diff --git a/ChangeLog b/ChangeLog
index 1a75065..40d3a00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@
* 1152 FIX: mk-job: The check now captures currently running jobs and their start time...
* 0198 FIX: cisco_temp_sensor: Removed dicey detection for temperature value....
* 0645 FIX: brocade_fcport: since in newer firmware (7.*) swFCPortSpeed is deprecated, we then calculate port speed from IF-MIB::ifHighSpeed
+ * 0647 FIX: printer_input, printer_output: multiple fixes to algorithm for state determination and inventory function...
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/checks/printer_io.include b/checks/printer_io.include
index 6d076e1..a95232c 100644
--- a/checks/printer_io.include
+++ b/checks/printer_io.include
@@ -56,7 +56,7 @@ printer_io_states = {
64: (0, 'Transitioning to intended state'),
}
-factory_settings['printer_default_levels'] = {
+factory_settings['printer_input_default_levels'] = {
'capacity_levels': (0.0, 0.0),
}
@@ -66,11 +66,21 @@ factory_settings['printer_output_default_levels'] = {
def inventory_printer_io(info):
for line in info:
+ ignore = False
snmp_status = saveint(line[2])
- # Skip sub units where it does not seem to make sense to monitor them
- if snmp_status & 5 and snmp_status & 3 and snmp_status & 1:
+ for state_val in sorted(printer_io_states,reverse=True):
+ if state_val > 0 and snmp_status - state_val >= 0:
+ snmp_status -= state_val
+ # Skip sub units where it does not seem to make sense to monitor them
+ if state_val in ( 1,3,5 ):
+ ignore = True
+ if ignore == True:
continue
- yield (line[0], {})
+ if line[0]:
+ name = line[0]
+ else:
+ name = line[1]
+ yield (name, {})
def check_printer_io(item, params, info, what):
for line in info:
@@ -78,16 +88,19 @@ def check_printer_io(item, params, info, what):
snmp_status, level, capacity_max = saveint(snmp_status), saveint(level), saveint(capacity_max)
capacity_unit = printer_io_units[capacity_unit]
- if name == item:
+ if descr == item or name == item:
state_txt = []
state_state = 0
if snmp_status == 0:
state_txt.append(printer_io_states[0][1])
else:
- for state_val, (mon_state, text) in printer_io_states.items():
- if snmp_status & state_val:
+ for state_val in sorted(printer_io_states,reverse=True):
+ if state_val > 0 and snmp_status - state_val >= 0:
+ mon_state, text = printer_io_states[state_val]
state_state = max(mon_state, state_state)
state_txt.append(text)
+ snmp_status -= state_val
+
yield state_state, 'Status: %s' % ', '.join(state_txt)
if level in [-1, -2]:
Module: check_mk
Branch: master
Commit: 1ebf0719cf3f181ae982b05c8ac7703d46f33f0a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1ebf0719cf3f18…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Aug 19 12:00:28 2014 +0200
webapi: fixed bug, now able to add a host into the main directory
---
web/htdocs/wato.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 1042f73..4050657 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -16913,9 +16913,11 @@ class API:
if "foldername" in validate:
if not os.path.exists(host_foldername) and not create_folders:
raise MKUserError(None, _("Folder does not exist and no permission to create folders"))
- host_folder_tokens = host_foldername.split("/")
- for dir_token in host_folder_tokens:
- check_wato_foldername(None, dir_token, just_name = True)
+
+ if host_foldername != "":
+ host_folder_tokens = host_foldername.split("/")
+ for dir_token in host_folder_tokens:
+ check_wato_foldername(None, dir_token, just_name = True)
if "host_exists" in validate:
if hostname in all_hosts:
Module: check_mk
Branch: master
Commit: eea12859818d6799c9f316f6f216adb54153f12c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eea12859818d67…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Mon Aug 18 12:07:01 2014 +0200
Updated bug entries #1005
---
.bugs/1005 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/1005 b/.bugs/1005
new file mode 100644
index 0000000..fbf464f
--- /dev/null
+++ b/.bugs/1005
@@ -0,0 +1,9 @@
+Title: problems with run_cached when agent is not running for a while and $CACHEFILE.new is left over
+Component: core
+State: open
+Date: 2014-08-18 11:56:44
+Targetversion: future
+Class: bug
+
+If it happens for some reason, that a $CACHEFILE.new is left over and the agent does not run for a while,
+the leftover $CACHEFILE.new blocks the execution of the agent section
Module: check_mk
Branch: master
Commit: af80e529c3f223a050978971def48cf627b81040
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=af80e529c3f223…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Mon Aug 18 10:59:35 2014 +0200
#0645 FIX brocade_fcport: since in newer firmware (7.*) swFCPortSpeed is deprecated, we then calculate port speed from IF-MIB::ifHighSpeed
---
.werks/645 | 9 +++++++++
ChangeLog | 1 +
checkman/brocade_fcport | 18 +++++++++---------
checks/brocade_fcport | 26 ++++++++++++++++++++------
4 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/.werks/645 b/.werks/645
new file mode 100644
index 0000000..e83e27b
--- /dev/null
+++ b/.werks/645
@@ -0,0 +1,9 @@
+Title: brocade_fcport: since in newer firmware (7.*) swFCPortSpeed is deprecated, we then calculate port speed from IF-MIB::ifHighSpeed
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1408352237
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 2cf9c9e..17cce96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
NOTE: Please refer to the migration notes!
* 1152 FIX: mk-job: The check now captures currently running jobs and their start time...
* 0198 FIX: cisco_temp_sensor: Removed dicey detection for temperature value....
+ * 0645 FIX: brocade_fcport: since in newer firmware (7.*) swFCPortSpeed is deprecated, we then calculate port speed from IF-MIB::ifHighSpeed
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/checkman/brocade_fcport b/checkman/brocade_fcport
index 8e5b950..a17ef09 100644
--- a/checkman/brocade_fcport
+++ b/checkman/brocade_fcport
@@ -5,7 +5,7 @@ license: GPL
distribution: check_mk
description:
This checks monitors a FibreChannel port of a Brocade FC switch
- to very great detail. It obsoletes the older checks {fc_brocade_port} and
+ in great detail. It obsoletes the older checks {fc_brocade_port} and
{fc_brocade_port_detailed}. The check goes critical under the following conditions:
{[1]} The physical state, operational state or adminstrative state of the port is not
@@ -31,9 +31,9 @@ item:
The item is the port-number as two-digit or three-digit string (on switches
with 100 or more ports) as printed on the switch (note: the SNMP-index of
port {00} is {1}!). For ISL ports (inter-switch-links), an {ISL} is appended
- to the item, e.g. {00 ISL}. That allows you to create rules that select
+ to the item, e.g. {00 ISL}. This allows you to create rules which select
different check parameters for ISL and normal ports without specifying each
- individual port. Also if you have configured port names, they will appear
+ individual port. Also, if you have configured port names, they will appear
in the check item (and thus the service description). This can be turned
off.
@@ -65,15 +65,15 @@ examples:
perfdata:
For each port there are sent {in}, {out}, {rxframes}, {txframes}, {rxcrcs},
- {rxencoutframes}, {c3discards} and {notxcredits}. If averaging is turned on, then
- each value comes twices: once normal and once with {_avg} appended as averaged
- value. All rates are in Bytes/s or Frames/s. If you are using PNP4Nagios, then
+ {rxencoutframes}, {c3discards} and {notxcredits}. If averaging is turned on,
+ each value comes twice: once normal and once with {_avg} appended as averaged
+ value. All rates are in Bytes/s or Frames/s. If you are using PNP4Nagios,
you are strongly encouraged to set {RRD_STORAGE_TYPE = MULTIPLE} in
- {process_perfdata.cfg}. Please note, that you need to re-create or convert existing
- RRD database if you change this setting.
+ {process_perfdata.cfg}. Please note that you need to re-create or convert existing
+ RRD databases if you change this setting.
inventory:
- The inventory creates checks for all operational ports. What this exactly means,
+ The inventory creates checks for all operational ports. What this exactly means
can be configured (see CONFIGURATION VARIABLES).
[parameters]
diff --git a/checks/brocade_fcport b/checks/brocade_fcport
index 79fc0dd..f4bc421 100644
--- a/checks/brocade_fcport
+++ b/checks/brocade_fcport
@@ -50,7 +50,7 @@ factory_settings["brocade_fcport_default_levels"] = {
"rxencoutframes": (3.0, 20.0), # allowed percentage of Enc-OUT Frames
"notxcredits": (3.0, 20.0), # allowed percentage of No Tx Credits
"c3discards": (3.0, 20.0), # allowed percentage of C3 discards
- "assumed_speed": 2.0, # used, if speed not available in SNMP data
+ "assumed_speed": 2.0, # used if speed not available in SNMP data
}
@@ -67,7 +67,7 @@ def brocade_fcport_getitem(ports, index, portname, is_isl):
def inventory_brocade_fcport(info):
# info[0] is port table, info[1] is ISL table
- if len(info) != 2:
+ if len(info) < 2:
return
inventory = []
@@ -119,9 +119,18 @@ def check_brocade_fcport(item, params, info):
speedmsg = ("ISL at %.0fGbit/s" % gbit)
else: # no ISL port
if brocade_fcport_speed[speed] in [ "auto-Neg", "unknown" ]:
- # let user specify assumed speed via check parameter, default is 2.0
- gbit = params.get("assumed_speed")
- speedmsg = "assuming %gGbit/s" % gbit
+ try:
+ actual_speed = saveint(info[2][item_index][0])
+ except:
+ actual_speed = 0
+ if actual_speed > 0:
+ # use actual speed of port if available
+ gbit = actual_speed / 1000
+ speedmsg = "actual speed %gGbit/s" % gbit
+ else:
+ # let user specify assumed speed via check parameter, default is 2.0
+ gbit = params.get("assumed_speed")
+ speedmsg = "assumed speed %gGbit/s" % gbit
else:
gbit = float(brocade_fcport_speed[speed].replace("Gbit", ""))
speedmsg = "%.0fGbit/s" % gbit
@@ -311,7 +320,7 @@ check_info["brocade_fcport"] = {
22, # swFCPortRxCrcs
26, # swFCPortRxEncOutFrs
28, # swFCPortC3Discards
- 35, # swFCPortSpeed
+ 35, # swFCPortSpeed, deprecated from at least firmware version 7.2.1
36, # swFCPortName (not supported by all devices)
]),
@@ -320,6 +329,11 @@ check_info["brocade_fcport"] = {
2, # swNbMyPort
5, # swNbBaudRate
]),
+
+ # new way to get port speed supported by Brocade
+ ( ".1.3.6.1.2.1.31.1.1.1", [
+ 15, # IF-MIB::ifHighSpeed
+ ]),
],
'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.1588.2.1.1"),
'group' : 'brocade_fcport',