Module: check_mk
Branch: master
Commit: 21a10e9b8f059a60cec4997247843c5f223b2233
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=21a10e9b8f059a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 27 09:30:21 2014 +0100
#1162 FIX User profiles can not be edited on WATO remote sites anymore
In previous versions it was possible for users to edit their own
user profile (language, password, ...) on WATO remote sites. This
was an problem, because it leads to inconsistent settings between
the master and remote site, because the changes on the remote site
are not synced to the master.
The edit dialog of the user profile has been removed/disabled for
all users of the remote site of a WATO distributed setup.
---
.werks/1162 | 16 ++++++++++++++++
ChangeLog | 3 ++-
web/htdocs/sidebar.py | 9 ++++++---
web/htdocs/wato.py | 3 +++
web/plugins/sidebar/wato.py | 2 +-
5 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/.werks/1162 b/.werks/1162
new file mode 100644
index 0000000..7f579c9
--- /dev/null
+++ b/.werks/1162
@@ -0,0 +1,16 @@
+Title: User profiles can not be edited on WATO remote sites anymore
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414398442
+Class: fix
+
+In previous versions it was possible for users to edit their own
+user profile (language, password, ...) on WATO remote sites. This
+was an problem, because it leads to inconsistent settings between
+the master and remote site, because the changes on the remote site
+are not synced to the master.
+
+The edit dialog of the user profile has been removed/disabled for
+all users of the remote site of a WATO distributed setup.
diff --git a/ChangeLog b/ChangeLog
index cb3db73..5fa1a7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -74,10 +74,10 @@
* 1442 ups_socomec_out_source: New check for checking the power source of out phases for Socomec UPSs
* 0662 domino_mailqueues: new check to monitor mail queues in Lotus Domino
* 1188 veeam_client: Check now also outputs ReadSize and TransferedSize...
- * 1190 statgrab_cpu: Check can now handle parameters
* 0663 domino_info: new check to extract informational data about a Lotus Domino Server
* 0664 domino_users: new check to monitor the number of users on a Domino Notes server
* 1447 domino_transactions: new check to monitor the number of transactions per minute on Lotus Domino servers
+ * 1190 statgrab_cpu: Check can now handle parameters
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
@@ -139,6 +139,7 @@
* 1158 FIX: Moved filter logic to visuals module...
NOTE: Please refer to the migration notes!
* 1077 FIX: Fixed labelling of Y achsis in prediction graphs...
+ * 1162 FIX: User profiles can not be edited on WATO remote sites anymore...
WATO:
* 1096 New WATO web service: manage hosts via a new HTTP API...
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 0607df6..129e806 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -182,9 +182,12 @@ def sidebar_foot():
if config.may("general.configure_sidebar"):
html.icon_button("sidebar_add_snapin.py", _("Add snapin to the sidebar"), "sidebar_addsnapin",
target="main")
- if config.may("general.edit_profile") or config.may("general.change_password"):
- html.icon_button("user_profile.py", _("Edit your personal settings, change your password"), "sidebar_settings",
- target="main")
+ # editing the profile is not possible on remote sites which are sync targets
+ # of a central WATO system
+ if config.wato_enabled and \
+ (config.may("general.edit_profile") or config.may("general.change_password")):
+ html.icon_button("user_profile.py", _("Edit your personal settings, change your password"),
+ "sidebar_settings", target="main")
if config.may("general.logout") and not config.auth_by_http_header:
html.icon_button("logout.py", _("Log out"), "sidebar_logout", target="_top")
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index bf89e58..b180543 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -15218,6 +15218,9 @@ def page_user_profile():
if not config.may('general.edit_profile') and not config.may('general.change_password'):
raise MKAuthException(_("You are not allowed to edit your user profile."))
+ if not config.wato_enabled:
+ raise MKAuthException(_('User profiles can not be edited (WATO is disabled).'))
+
success = None
if html.has_var('_save') and html.check_transaction():
try:
diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py
index 93a3589..56c7dca 100644
--- a/web/plugins/sidebar/wato.py
+++ b/web/plugins/sidebar/wato.py
@@ -36,7 +36,7 @@ import config, wato, views, dashboard
# +----------------------------------------------------------------------+
def render_wato(mini):
if not config.wato_enabled:
- html.write(_("WATO is disabled in <tt>multisite.mk</tt>."))
+ html.write(_("WATO is disabled."))
return False
elif not config.may("wato.use"):
html.write(_("You are not allowed to use Check_MK's web configuration GUI."))
Module: check_mk
Branch: master
Commit: a0a2c6dee6a1abcafb5ca47ed95a5ccc46f2e408
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a0a2c6dee6a1ab…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 24 15:15:41 2014 +0200
#1161 FIX fc_port: Fixed invalid values of counters, fixed wrong values in graphs
Previous versions of the checks computed wrong values for all counters like
transfered bytes, errors etc. This has been fixed now.
The performance graphs, for example error counters, were using wrong datasources
which made the graphs show dramatically wrong values.
---
.werks/1161 | 13 ++++++++++++
.werks/195 | 11 ----------
ChangeLog | 3 +--
checks/fc_port | 22 ++++++++------------
pnp-templates/check_mk-fc_port.php | 40 ++++++++++++++++++++++++------------
5 files changed, 50 insertions(+), 39 deletions(-)
diff --git a/.werks/1161 b/.werks/1161
new file mode 100644
index 0000000..691530a
--- /dev/null
+++ b/.werks/1161
@@ -0,0 +1,13 @@
+Title: fc_port: Fixed invalid values of counters, fixed wrong values in graphs
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414156402
+Class: fix
+
+Previous versions of the checks computed wrong values for all counters like
+transfered bytes, errors etc. This has been fixed now.
+
+The performance graphs, for example error counters, were using wrong datasources
+which made the graphs show dramatically wrong values.
diff --git a/.werks/195 b/.werks/195
deleted file mode 100644
index 51106ed..0000000
--- a/.werks/195
+++ /dev/null
@@ -1,11 +0,0 @@
-Title: fc_port: Check temporary disabled cause of problems with automatic detection
-Level: 1
-Component: checks
-Compatible: incomp
-Version: 1.2.5i6
-Date: 1407158053
-Class: fix
-
-There are currently a problem with the scan function who lead to a positive result on not supported devices.
-The Check will be renabled asap the problems are fixed.
-
diff --git a/ChangeLog b/ChangeLog
index d5b1e7c..a83beef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -82,8 +82,6 @@
* 0194 FIX: raritan_pdu_inlet: Check now outputs the correct values...
NOTE: Please refer to the migration notes!
* 1071 FIX: oracle_rman_backups: Only inventorize ARCHIVELOG / DB FULL / DB INCR entries...
- * 0195 FIX: fc_port: Check temporary disabled cause of problems with automatic detection...
- 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
@@ -118,6 +116,7 @@
* 1128 FIX: bluecat_dns: now reports UNKNOWN if no snmp data is available
* 1131 FIX: esx_vsphere_hostsystem.maintenance: fixed misspelling in service description...
NOTE: Please refer to the migration notes!
+ * 1161 FIX: fc_port: Fixed invalid values of counters, fixed wrong values in graphs...
Multisite:
* 1066 New Dashboard Designer...
diff --git a/checks/fc_port b/checks/fc_port
index 93b02c6..52c6c51 100644
--- a/checks/fc_port
+++ b/checks/fc_port
@@ -87,15 +87,11 @@ def fc_port_getitem(num_ports, index, portname):
return itemname
def fc_parse_counter(value):
- if type(value) == str: # unsigned 64bit counter
- num = 64
- result = 0
- for c in value:
- num = num - 8
- result += ord(c) * 2 ** num
- return result
- else:
- return value
+ # The counters are sent via SNMP as OCTETSTR, which is converted to
+ # a byte string by Check_MKs SNMP code. The counters seem to be
+ # 64 bit big endian values, which are converted to integers here
+ import struct
+ return int(struct.unpack('>Q', value)[0])
def inventory_fc_port(info):
if not info:
@@ -332,23 +328,23 @@ check_info["fc_port"] = {
"1.10.1.17", # connUnitPortName # 5
"1.10.1.23", # connUnitPortHWSTate: # 6
# hardware detected state of the port
- "4.5.1.4", # connUnitPortStatTxObjects: # 7
+ "4.5.1.4", # connUnitPortStatCountTxObjects: # 7
# The number of frames/packets/IOs/etc that have been transmitted
# by this port. Note: A Fibre Channel frame starts with SOF and
# ends with EOF. FC loop devices should not count frames passed
# through. This value represents the sum total for all other Tx
- "4.5.1.5", # connUnitPortStatRxObjects: # 8
+ "4.5.1.5", # connUnitPortStatCountRxObjects: # 8
# The number of frames/packets/IOs/etc that have been received
# by this port. Note: A Fibre Channel frame starts with SOF and
# ends with EOF. FC loop devices should not count frames passed
# through. This value represents the sum total for all other Rx
- "4.5.1.6", # connUnitPortStatTxElements: # 9
+ "4.5.1.6", # connUnitPortStatCountTxElements: # 9
# The number of octets or bytes that have been transmitted
# by this port. One second periodic polling of the port. This
# value is saved and compared with the next polled value to
# compute net throughput. Note, for Fibre Channel, ordered
# sets are not included in the count.
- "4.5.1.7", # connUnitPortStatRxElements: # 10
+ "4.5.1.7", # connUnitPortStatCountRxElements: # 10
# The number of octets or bytes that have been received.
# by this port. One second periodic polling of the port. This
# value is saved and compared with the next polled value to
diff --git a/pnp-templates/check_mk-fc_port.php b/pnp-templates/check_mk-fc_port.php
index 662699e..99bfc93 100644
--- a/pnp-templates/check_mk-fc_port.php
+++ b/pnp-templates/check_mk-fc_port.php
@@ -89,6 +89,19 @@ if($bandwidth > $base * $base * $base) {
$bwuom = 'k';
}
+# The number of data source various due to different
+# settings (such as averaging). We rather work with names
+# than with numbers.
+$RRD = array();
+foreach ($NAME as $i => $n) {
+ $RRD[$n] = "$RRDFILE[$i]:$DS[$i]:MAX";
+ $RRDAVG[$n] = "$RRDFILE[$i]:$DS[$i]:AVERAGE";
+ $WARN[$n] = $WARN[$i];
+ $CRIT[$n] = $CRIT[$i];
+ $MIN[$n] = $MIN[$i];
+ $MAX[$n] = $MAX[$i];
+}
+
if ($mBandwidthH < 10)
$range = $mBandwidthH;
else
@@ -114,7 +127,7 @@ $def[1] =
$def[1] .= "".
# incoming
- "DEF:inbytes=$RRDFILE[1]:$DS[1]:MAX ".
+ "DEF:inbytes=$RRD[in] ".
"CDEF:intraffic=inbytes,$unit_multiplier,* ".
"CDEF:inmb=intraffic,1048576,/ ".
"AREA:inmb#00e060:\"in \" ".
@@ -127,7 +140,7 @@ $def[1] =
"GPRINT:inperc:\"%7.1lf %s$unit/s\\n\" ".
# outgoing
- "DEF:outbytes=$RRDFILE[2]:$DS[2]:MAX ".
+ "DEF:outbytes=$RRD[out] ".
"CDEF:outtraffic=outbytes,$unit_multiplier,* ".
"CDEF:minusouttraffic=outtraffic,-1,* ".
"CDEF:outmb=outtraffic,1048576,/ ".
@@ -146,8 +159,8 @@ $def[1] =
# averages
if (isset($DS[9])) {
$def[1] .=
- "DEF:inbytesa=$RRDFILE[9]:$DS[9]:MAX ".
- "DEF:outbytesa=$RRDFILE[10]:$DS[10]:MAX ".
+ "DEF:inbytesa=$RRD[in_avg] ".
+ "DEF:outbytesa=$RRD[out_avg] ".
"CDEF:intraffica=inbytesa,$unit_multiplier,* ".
"CDEF:outtraffica=outbytesa,$unit_multiplier,* ".
"CDEF:inmba=intraffica,1048576,/ ".
@@ -169,7 +182,7 @@ $opt[2] = "--vertical-label \"objects/sec\" --title \"Objects $hostname / $servi
$def[2] =
# rxobjects
"HRULE:0#c0c0c0 ".
- "DEF:inu=$RRDFILE[3]:$DS[3]:MAX ".
+ "DEF:inu=$RRD[rxobjects] ".
"CDEF:in=inu ".
"AREA:inu#00ffc0:\"rxobjects \" ".
"GPRINT:inu:LAST:\"%9.1lf/s last \" ".
@@ -180,15 +193,16 @@ $def[2] =
"GPRINT:inperc:\"%9.1lf/s\\n\" ".
# txobjects
- "DEF:outu=$RRDFILE[4]:$DS[4]:MAX ".
+ "DEF:outu=$RRD[txobjects] ".
"CDEF:minusoutu=0,outu,- ".
"AREA:minusoutu#00c0ff:\"txobjects \" ".
"GPRINT:outu:LAST:\"%9.1lf/s last \" ".
"GPRINT:outu:AVERAGE:\"%9.1lf/s avg \" ".
"GPRINT:outu:MAX:\"%9.1lf/s max\\n\" ".
- "VDEF:outperc=minusoutu,5,PERCENTNAN ".
- "LINE:outperc#0000cf:\"out 95% percentile\" ".
- "GPRINT:outperc:\"%9.1lf/s\\n\" ".
+ "VDEF:outperc_neg=minusoutu,5,PERCENTNAN ".
+ "VDEF:outperc_pos=outu,5,PERCENTNAN ".
+ "LINE:outperc_neg#0000cf:\"out 95% percentile\" ".
+ "GPRINT:outperc_pos:\"%9.1lf/s\\n\" ".
"";
# Graph 3: errors and discards
@@ -196,8 +210,8 @@ $ds_name[3] = 'Errors and discards';
$opt[3] = "--vertical-label \"errors/sec\" -X0 --title \"Problems $hostname / $servicedesc\" ";
$def[3] =
"HRULE:0#c0c0c0 ".
- "DEF:crcerr=$RRDFILE[5]:$DS[5]:MAX ".
- "DEF:encout=$RRDFILE[6]:$DS[6]:MAX ".
+ "DEF:crcerr=$RRD[rxcrcs] ".
+ "DEF:encout=$RRD[rxencoutframes] ".
"AREA:crcerr#ff0000:\"crc errors \" ".
"GPRINT:crcerr:LAST:\"%7.2lf/s last \" ".
"GPRINT:crcerr:AVERAGE:\"%7.2lf/s avg \" ".
@@ -206,8 +220,8 @@ $def[3] =
"GPRINT:encout:LAST:\"%7.2lf/s last \" ".
"GPRINT:encout:AVERAGE:\"%7.2lf/s avg \" ".
"GPRINT:encout:MAX:\"%7.2lf/s max\\n\" ".
- "DEF:c3discards=$RRDFILE[7]:$DS[7]:MAX ".
- "DEF:notxcredits=$RRDFILE[8]:$DS[8]:MAX ".
+ "DEF:c3discards=$RRD[c3discards] ".
+ "DEF:notxcredits=$RRD[notxcredits] ".
"CDEF:minusc3=0,c3discards,- ".
"CDEF:minusnotxcredits=0,notxcredits,- ".
"AREA:minusc3#ff0080:\"c3 discards \" ".
Module: check_mk
Branch: master
Commit: b353501ead5c199c7e9a761bdf9c26decfc4848b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b353501ead5c19…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Oct 24 12:29:19 2014 +0200
#1447 domino_transactions: new check to monitor the number of transactions per minute on Lotus Domino servers
---
.werks/1447 | 9 ++++++
ChangeLog | 1 +
checkman/domino_transactions | 24 ++++++++++++++
checks/domino_transactions | 58 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 14 ++++++++
5 files changed, 106 insertions(+)
diff --git a/.werks/1447 b/.werks/1447
new file mode 100644
index 0000000..3b88448
--- /dev/null
+++ b/.werks/1447
@@ -0,0 +1,9 @@
+Title: domino_transactions: new check to monitor the number of transactions per minute on Lotus Domino servers
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414146516
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index e8d89ac..715cb48 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -76,6 +76,7 @@
* 1188 veeam_client: Check now also outputs ReadSize and TransferedSize...
* 0663 domino_info: new check to extract informational data about a Lotus Domino Server
* 0664 domino_users: new check to monitor the number of users on a Domino Notes server
+ * 1447 domino_transactions: new check to monitor the number of transactions per minute on Lotus Domino servers
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/checkman/domino_transactions b/checkman/domino_transactions
new file mode 100644
index 0000000..e492821
--- /dev/null
+++ b/checkman/domino_transactions
@@ -0,0 +1,24 @@
+title: IBM Lotus Domino: Number of Transactions
+agents: snmp
+catalog: app/lotusnotes
+license: GPL
+distribution: check_mk
+description:
+
+ This check uses snmp to extract the average number of transactions per
+ minute on a Lotus Domino Server. Warning and critical upper limits can be
+ set.
+
+perfdata:
+ The number of transactions per minute
+
+[parameters]
+parameters(tuple): parameters is a tuple of two values
+
+ {warn}: (int) The warning level
+
+ {crit}: (int) The critical level
+
+[configuration]
+domino_transactions_default_levels (tuple): This variable is preset to { (30000,35000) }
+
diff --git a/checks/domino_transactions b/checks/domino_transactions
new file mode 100644
index 0000000..77e25ea
--- /dev/null
+++ b/checks/domino_transactions
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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.
+
+domino_transactions_default_levels = ( 30000, 35000 )
+
+def inventory_domino_transactions(info):
+ if info:
+ yield None, 'domino_transactions_default_levels'
+
+def check_domino_transactions(_no_item, params, info):
+ if info:
+ reading = int(info[0][0])
+ warn, crit = params
+ infotext = "Transactions per minute (avg): %s" % reading
+ levels = " (Warn/Crit at %s/%s)" % ( warn, crit )
+ perfdata = [ ( "transactions", reading, warn, crit ) ]
+ state = 0
+ if reading >= crit:
+ state = 2
+ infotext += levels
+ elif reading >= warn:
+ state = 1
+ infotext += levels
+ yield state, infotext, perfdata
+
+
+check_info["domino_transactions"] = {
+ "check_function" : check_domino_transactions,
+ "inventory_function" : inventory_domino_transactions,
+ "service_description" : "Domino Server Transactions",
+ "has_perfdata" : True,
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0") == ".1.3.6.1.4.1.311.1.1.3.1.2",
+ "snmp_info" : (".1.3.6.1.4.1.334.72.1.1.6.3", [2]),
+ "group" : "domino_transactions"
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 14ecc9c..6cc3199 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6880,3 +6880,17 @@ register_check_parameters(
),
None, None
)
+
+register_check_parameters(
+ subgroup_applications,
+ "domino_transactions",
+ _("Lotus Domino Transactions"),
+ Tuple(
+ title = _("Number of Transactions per Minute on a Lotus Domino Server"),
+ elements = [
+ Integer(title = _("warning if above"), default_value = 30000 ),
+ Integer(title = _("critical if above"), default_value = 35000 ),
+ ]
+ ),
+ None, None
+)