Module: check_mk
Branch: master
Commit: 0155f3b2ead4df7fc8bdcd9ef9ad207f68bc4ccb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0155f3b2ead4df…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Oct 5 16:08:49 2011 +0200
FIX: mbg_lantime_state: Fixed output UOM to really be miliseconds
---
ChangeLog | 1 +
checkman/mbg_lantime_state | 6 +++---
checks/mbg_lantime_state | 16 ++++++----------
3 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5eaa53a..cb5b7f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
* mrpe: make check cluster-aware and work as clustered_service
* cups_queues: Run agent part only on directly on CUPS servers,
not on clients
+ * FIX: mbg_lantime_state: Fixed output UOM to really be miliseconds
Multisite:
diff --git a/checkman/mbg_lantime_state b/checkman/mbg_lantime_state
index f5befac..266e06a 100644
--- a/checkman/mbg_lantime_state
+++ b/checkman/mbg_lantime_state
@@ -25,13 +25,13 @@ stratum_warn (int): stratums above this value will raise a {WARNING} state.
stratum_warn (int): stratums above this value will raise a {CRITICAL} state.
The default is set to {0}. The threshold can be disabled by setting to {None}.
ref_offset_warn (int): refclock offsets above this value will raise a {WARNING} state.
- The default is set to {5}. The threshold can be disabled by setting to {None}.
+ The default is set to {500} microseconds. The threshold can be disabled by setting to {None}.
ref_offset_crit (int): refclock offsets above this value will raise a {CRITICAL} state.
- The default is set to {10}. The threshold can be disabled by setting to {None}.
+ The default is set to {1000} microseconds. The threshold can be disabled by setting to {None}.
[configuration]
mbg_lantime_state_default_levels (int, int, int, int): A tuple of four floats or integers: The default
levels. These levels are used for inventorized checks. This variable
- is preset to {(0, 0, 5, 10)}
+ is preset to {(0, 0, 500, 1000)}
diff --git a/checks/mbg_lantime_state b/checks/mbg_lantime_state
index af5b042..6c0fd13 100644
--- a/checks/mbg_lantime_state
+++ b/checks/mbg_lantime_state
@@ -34,8 +34,8 @@ mbg_lantime_state_statemap = {
'5': 'normalOperationRefclock',
}
-# stratum, refclock_offset
-mbg_lantime_state_default_levels = (0, 0, 5, 10)
+# stratum, refclock_offset (in microseconds)
+mbg_lantime_state_default_levels = (0, 0, 500, 1000)
def inventory_mbg_lantime_state(info):
if len(info) > 0 and len(info[0]) == 5:
@@ -70,18 +70,14 @@ def check_mbg_lantime_state(item, params, info):
thr_txt = ''
- if refclock_offset < 0:
- pos_refclock_offset = refclock_offset * -1
- else:
- pos_refclock_offset = refclock_offset
-
- if params[2] is not None and int(pos_refclock_offset) > params[3]:
+ pos_refclock_offset = abs(savefloat(refclock_offset))
+ if params[2] is not None and pos_refclock_offset > params[3]:
state = max(state, 2)
thr_txt = ' (!!)'
- elif params[3] is not None and int(pos_refclock_offset) > params[2]:
+ elif params[3] is not None and pos_refclock_offset > params[2]:
state = max(state, 1)
thr_txt = ' (!)'
- state_txt.append('Refclock Offset: %sms%s' % (refclock_offset, thr_txt))
+ state_txt.append('Refclock Offset: %0.4fms%s' % (pos_refclock_offset / 1000, thr_txt))
perfdata = [('offset', refclock_offset, params[2], params[3])]
Module: check_mk
Branch: master
Commit: b54e97424959515d476a3a0a2ebd7524d05f32ba
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b54e9742495951…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Oct 4 11:20:02 2011 +0200
FIX: fix permission computation
---
ChangeLog | 2 +-
web/htdocs/config.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a98ade4..c3faacd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,11 +10,11 @@
* cups_queues: Run agent part only on directly on CUPS servers,
not on clients
-
Multisite:
* FIX: fix rescheduling of host check
* FIX: fix exception when using status_host while local site is offline
* FIX: fix URL-too-long in permissions page
+ * FIX: fix permission computation
* Cleanup permissions page optically, add comments for views and snapins
* Added some missing i18n strings in general HTML functions
* Added display_option "w" to disable limit messages and livestatus errors in views
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 0994832..3ba6f2c 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -224,9 +224,9 @@ def login(u):
if users != None:
all += users
if all.count(user) > 1:
- raise MKConfigError("Your username (<b>%s</b>) is listed more than once "
+ raise MKConfigError(_("Your username (<b>%s</b>) is listed more than once "
"in multisite.mk. This is not allowed. "
- "Please check your config." % user)
+ "Please check your config.") % user)
role = role_of_user(user)
@@ -262,7 +262,7 @@ def role_of_user(u):
def may(permname):
# handle case where declare_permission is done after login
# and permname also not contained in save configuration
- if permname not in user_permissions:
+ if permname not in permissions:
perm = permissions_by_name.get(permname)
if not perm: # Object does not exists, e.g. sidesnap.multisite if not is_multisite()
return False