Module: check_mk
Branch: master
Commit: 45ec371fe2d1d86ffc94a5500d4319fa717645b2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=45ec371fe2d1d8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 29 10:18:23 2016 +0200
3728 Automatically creating automation user for Check_MK internal use with WATO default config
We are adding now a default automation user named <i>cmkautomation</i> to Check_MK with the
WATO default configuration. This user will currently only be added to new sites, but may be
added to existing sites in future, too.
The user has the administrative role to be able to access all hosts and do all actions. The
authentication secret is randomly created for each site. In distributed setups the authentication
secret will be synchronized from the central site.
The idea of this user is, that components of Check_MK can automatically authenticate with
the Web GUI using an always existing user. This is currently not used, but may be used for
the internal cron job, fetching of graphs and performing checks against the GUI.
If you don't like this user, you are free to disable or delete it. But this may lead to issues
in future when we start using the user for internal things.
---
.werks/3728 | 22 ++++++++++++++++++++++
ChangeLog | 1 +
web/htdocs/userdb.py | 21 ++++++++++++++++++++-
web/htdocs/wato.py | 2 ++
4 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/.werks/3728 b/.werks/3728
new file mode 100644
index 0000000..0cd165b
--- /dev/null
+++ b/.werks/3728
@@ -0,0 +1,22 @@
+Title: Automatically creating automation user for Check_MK internal use with WATO default config
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i1
+Date: 1469780006
+Class: feature
+
+We are adding now a default automation user named <i>cmkautomation</i> to Check_MK with the
+WATO default configuration. This user will currently only be added to new sites, but may be
+added to existing sites in future, too.
+
+The user has the administrative role to be able to access all hosts and do all actions. The
+authentication secret is randomly created for each site. In distributed setups the authentication
+secret will be synchronized from the central site.
+
+The idea of this user is, that components of Check_MK can automatically authenticate with
+the Web GUI using an always existing user. This is currently not used, but may be used for
+the internal cron job, fetching of graphs and performing checks against the GUI.
+
+If you don't like this user, you are free to disable or delete it. But this may lead to issues
+in future when we start using the user for internal things.
diff --git a/ChangeLog b/ChangeLog
index ef2e826..9646aaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -432,6 +432,7 @@
* 3154 added ability to retrieve passwords for active checks from a password store
* 3667 Search expressions in host search can now be given as regexes...
* 3724 Password input fields: Added note about plain text storing (if done so)
+ * 3728 Automatically creating automation user for Check_MK internal use with WATO default config...
* 3060 FIX: Folder properties: Fixed exception when a user has no alias set...
* 3062 FIX: Git integration: Fixed not adding files in WATO folders to git control
* 3203 FIX: Distributed WATO: Fixed exception in remote host service discovery...
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index f81b872..043df3c 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -836,7 +836,26 @@ def save_users(profiles):
def rewrite_users():
- users = load_users(lock = True)
+ users = load_users(lock=True)
+ save_users(users)
+
+
+def create_cmk_automation_user():
+ secret = gen_id()
+
+ users = load_users(lock=True)
+ users["cmkautomation"] = {
+ 'alias' : u'Check_MK internal - Used for site local authentication',
+ 'contactgroups' : [],
+ 'automation_secret' : secret,
+ 'password' : encrypt_password(secret),
+ 'roles' : ['admin'],
+ 'locked' : False,
+ 'serial' : 0,
+ 'email' : '',
+ 'pager' : '',
+ 'notifications_enabled' : False,
+ }
save_users(users)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index d3c2b44..feb30a3 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -14293,6 +14293,8 @@ def create_sample_config():
save_mkeventd_sample_config()
+ userdb.create_cmk_automation_user()
+
def has_agent_bakery():
return 'bake_agents' in globals()
Module: check_mk
Branch: master
Commit: 19ded57967c427fcb2e101502a5e23c1bfa849a8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=19ded57967c427…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 29 09:47:10 2016 +0200
3727 FIX fc_port: Fixed broken interpretation of counter values leading to wrong measurements
---
.werks/3727 | 10 ++++++++++
ChangeLog | 1 +
checks/fc_port | 20 +++++++++-----------
3 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/.werks/3727 b/.werks/3727
new file mode 100644
index 0000000..c208919
--- /dev/null
+++ b/.werks/3727
@@ -0,0 +1,10 @@
+Title: fc_port: Fixed broken interpretation of counter values leading to wrong measurements
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1469778404
+
+
diff --git a/ChangeLog b/ChangeLog
index 5873df9..ef2e826 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -318,6 +318,7 @@
* 3556 FIX: agent_vsphere.pysphere: The ESX 4.1 compatible agent version no longer validates the ssl certificate
* 3709 FIX: cisco_wlc, cisco_wlc_clients: fixed scan function and incomplete listing of interfaces
* 3672 FIX: Agent sections cached by the agent could cause stale services...
+ * 3727 FIX: fc_port: Fixed broken interpretation of counter values leading to wrong measurements
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/fc_port b/checks/fc_port
index 1cde4c6..5f747e8 100644
--- a/checks/fc_port
+++ b/checks/fc_port
@@ -91,9 +91,7 @@ def fc_parse_counter(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
- if len(value) == len("00 00 00 0C 8F 70 DD 74"):
- value = "".join(map(chr, [ eval("0x" + v) for v in value.split() ]))
- return binstring_to_int(value)
+ return binstring_to_int("".join(map(chr, value)))
def inventory_fc_port(info):
@@ -313,41 +311,41 @@ 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", # connUnitPortStatCountTxObjects: # 7
+ BINARY("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", # connUnitPortStatCountRxObjects: # 8
+ BINARY("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", # connUnitPortStatCountTxElements: # 9
+ BINARY("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", # connUnitPortStatCountRxElements: # 10
+ BINARY("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
# compute net throughput. Note, for Fibre Channel, ordered
# sets are not included in the count.
- "4.5.1.8", # connUnitPortStatCountBBCreditZero: # 11
+ BINARY("4.5.1.8"), # connUnitPortStatCountBBCreditZero: # 11
# Count of transitions in/out of BBcredit zero state.
# The other side is not providing any credit.
- "4.5.1.28", # connUnitPortStatCountClass3Discards: # 12
+ BINARY("4.5.1.28"), # connUnitPortStatCountClass3Discards: # 12
# Count of Class 3 Frames that were discarded upon reception
# at this port. There is no FBSY or FRJT generated for Class 3
# Frames. They are simply discarded if they cannot be delivered.
- "4.5.1.40", # connUnitPortStatCountInvalidCRC: # 13
+ BINARY("4.5.1.40"), # connUnitPortStatCountInvalidCRC: # 13
# Count of frames received with invalid CRC. This count is
# part of the Link Error Status Block (LESB). (FC-PH 29.8). Loop
# ports should not count CRC errors passing through when
# monitoring.
- "4.5.1.50", # connUnitPortStatCountEncodingDisparityErrors: # 14
+ BINARY("4.5.1.50"), # connUnitPortStatCountEncodingDisparityErrors: # 14
# Count of disparity errors received at this port.
]),
}