Module: check_mk
Branch: master
Commit: 734ad7cadef060ee401f6cf7537f696d0a352ba0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=734ad7cadef060…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 21 13:40:58 2016 +0100
#2943 FIX Preventing issues with password completion of browsers on user and profile edit pages
---
.werks/2943 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/htmllib.py | 7 +++++++
web/htdocs/wato.py | 4 ++++
4 files changed, 21 insertions(+)
diff --git a/.werks/2943 b/.werks/2943
new file mode 100644
index 0000000..f2f4413
--- /dev/null
+++ b/.werks/2943
@@ -0,0 +1,9 @@
+Title: Preventing issues with password completion of browsers on user and profile edit pages
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453380032
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 872a8a1..ae86c67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -267,6 +267,7 @@
* 2825 FIX: Parameter overview page no longer raises an exception in certain scenarios...
* 2925 FIX: Editing a notification rule for a missing user selected random other user...
* 2905 FIX: Check plugins: Non existant man pages now result in helpful error messages
+ * 2943 FIX: Preventing issues with password completion of browsers on user and profile edit pages
Notifications:
* 2811 Mail notifications: Now able to add Host/Service Notes Url...
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index c334b13..d0e605a 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -257,6 +257,13 @@ class html(GUITester):
self.write("</form>\n")
self.form_name = None
+ def prevent_password_auto_completion(self):
+ # These fields are not really used by the form. They are used to prevent the browsers
+ # from filling the default password and previous input fields in the form
+ # with password which are eventually saved in the browsers password store.
+ self.write("<input type=\"text\" style=\"display:none;\">")
+ self.write("<input style=\"display:none\" type=\"password\">")
+
def form_submitted(self, form_name=None):
if form_name:
return self.var("filled_in") == form_name
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 2e9e43a..f5078cf 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10243,6 +10243,8 @@ def mode_edit_user(phase):
load_notification_scripts()
html.begin_form("user", method="POST")
+ html.prevent_password_auto_completion()
+
forms.header(_("Identity"))
# ID
@@ -10281,6 +10283,7 @@ def mode_edit_user(phase):
forms.header(_("Security"))
forms.section(_("Authentication"))
+
is_automation = user.get("automation_secret", None) != None
html.radiobutton("authmethod", "password", not is_automation,
_("Normal user login with password"))
@@ -13800,6 +13803,7 @@ def page_user_profile(change_pw=False):
return attr in locked_attributes
html.begin_form("profile", method="POST")
+ html.prevent_password_auto_completion()
html.write('<div class=wato>')
forms.header(_("Personal Settings"))
Module: check_mk
Branch: master
Commit: 17d09fa593bf0ec6271721bc7db5ade272f341cf
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=17d09fa593bf0e…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Jan 21 10:02:37 2016 +0100
Simplify InputBuffer's API.
The are two advantages for doing this:
* It doesn't keep the textual representation of a query alive longer than
needed, something which gets important when the query gets big.
* It reduces coupling between classes, now only Store needs to know the
InputBuffer. So it is e.g. crystal-clear now that Query simply gets a
completed query and doesn't rely on any I/O for this to be done in an
interleaved way.
The representation of the query input has been changed from a deque to a
list. The former is offers constant-time indexing at the price of being more
heavy-weight, something which we don't need.
---
livestatus/src/InputBuffer.cc | 96 +++++++++++++++++++----------------------
livestatus/src/InputBuffer.h | 10 ++---
livestatus/src/Query.cc | 44 +++++++++----------
livestatus/src/Query.h | 4 +-
livestatus/src/Store.cc | 21 +++++----
livestatus/src/Store.h | 4 +-
6 files changed, 86 insertions(+), 93 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=17d09fa593…
Module: check_mk
Branch: master
Commit: 530369c4e70c3b31a8496a0c01cd1d989f5ef026
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=530369c4e70c3b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 21 10:42:03 2016 +0100
#2912 FIX mk_oracle mk_oracle.aix: Fixed handling of DBs which names end with "_[NUMBER]"
The agent plugin did not compute the ORACLE_SID_SHORT correctly in case of databases
named like this:
DB Instance Name = TESTDBDB
Instance RAC Knoten 1: TESTDB_1DB
Instance RAC Knoten 2: TESTDB_2
---
.werks/2912 | 14 ++++++++++++++
ChangeLog | 1 +
agents/plugins/mk_oracle | 2 +-
agents/plugins/mk_oracle.aix | 2 +-
4 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/.werks/2912 b/.werks/2912
new file mode 100644
index 0000000..9469c3a
--- /dev/null
+++ b/.werks/2912
@@ -0,0 +1,14 @@
+Title: mk_oracle mk_oracle.aix: Fixed handling of DBs which names end with "_[NUMBER]"
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453369163
+Class: fix
+
+The agent plugin did not compute the ORACLE_SID_SHORT correctly in case of databases
+named like this:
+
+DB Instance Name = TESTDBDB
+Instance RAC Knoten 1: TESTDB_1DB
+Instance RAC Knoten 2: TESTDB_2
diff --git a/ChangeLog b/ChangeLog
index 5900b4a..664549d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -198,6 +198,7 @@
* 2909 FIX: postfix_mailq: Fixed crash when postfix mailq size can not be read
* 2910 FIX: heartbeat_crm: Fixed crash in case of "number of resources" paramters have been configured
* 2911 FIX: mysql.innodb_io: Fixed crash in case averaging is set to 0 minutes
+ * 2912 FIX: mk_oracle mk_oracle.aix: Fixed handling of DBs which names end with "_[NUMBER]"...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/agents/plugins/mk_oracle b/agents/plugins/mk_oracle
index 3adfdcb..bb94092 100755
--- a/agents/plugins/mk_oracle
+++ b/agents/plugins/mk_oracle
@@ -711,7 +711,7 @@ function set_oraenv () {
ORACLE_HOME=$(cat ${ORATAB} | grep "^"${ORACLE_SID}":" | cut -d":" -f2)
if [ -z $ORACLE_HOME ] ; then
# cut last number from SID for Oracle RAC to find entry in oratab
- ORACLE_SID_SHORT=$(echo $ORACLE_SID | sed "s/[0-9]$//")
+ ORACLE_SID_SHORT=$(echo $ORACLE_SID | sed "s/_[0-9]$//")
ORACLE_HOME=$(cat ${ORATAB} | grep "^"${ORACLE_SID_SHORT}":" | cut -d":" -f2)
fi
fi
diff --git a/agents/plugins/mk_oracle.aix b/agents/plugins/mk_oracle.aix
index fb1a1f6..a863072 100755
--- a/agents/plugins/mk_oracle.aix
+++ b/agents/plugins/mk_oracle.aix
@@ -697,7 +697,7 @@ function set_oraenv () {
ORACLE_HOME=$(cat ${ORATAB} | grep "^"${ORACLE_SID}":" | cut -d":" -f2)
if [ -z $ORACLE_HOME ] ; then
# cut last number from SID for Oracle RAC to find entry in oratab
- ORACLE_SID_SHORT=$(echo $ORACLE_SID | sed "s/[0-9]$//")
+ ORACLE_SID_SHORT=$(echo $ORACLE_SID | sed "s/_[0-9]$//")
ORACLE_HOME=$(cat ${ORATAB} | grep "^"${ORACLE_SID_SHORT}":" | cut -d":" -f2)
fi
Module: check_mk
Branch: master
Commit: b23d454c22c2f5e832828eaffacdd900b1646cbd
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b23d454c22c2f5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 21 10:32:26 2016 +0100
Renamed new check solaris_prtdiag to solaris_prtdiag_status and reworked it a bit
---
.werks/1322 | 2 +-
ChangeLog | 2 +-
agents/check_mk_agent.solaris | 5 +--
agents/plugins/mk_inventory.solaris | 11 +++++
checkman/solaris_prtdiag | 12 ------
checkman/solaris_prtdiag_status | 14 +++++++
checks/{solaris_prtdiag => solaris_prtdiag_status} | 44 ++++++++------------
7 files changed, 47 insertions(+), 43 deletions(-)
diff --git a/.werks/1322 b/.werks/1322
index 8f78dc6..0a07806 100644
--- a/.werks/1322
+++ b/.werks/1322
@@ -1,4 +1,4 @@
-Title: solaris_prtdiag: New Check for Solaris Hardware State based on prtdiag
+Title: solaris_prtdiag_status: New Check for Solaris Hardware State based on prtdiag
Level: 1
Component: checks
Compatible: compat
diff --git a/ChangeLog b/ChangeLog
index 01483da..5900b4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,7 +83,7 @@
* 2918 agent_jolokia: jolokia can now be monitored using a special agent
* 2919 hp_webmgmt_status: New check for health status of various Hewlett-Packard devices...
* 2920 hr_cpu: this check can now also supports per-core features...
- * 1322 solaris_prtdiag: New Check for Solaris Hardware State based on prtdiag
+ * 1322 solaris_prtdiag_status: New Check for Solaris Hardware State based on prtdiag
* 2921 printer_supply_ricoh: check now tries to handle negative readings properly...
* 2922 check_mk_agent.linux: mrpe sections can now be cached...
* 2933 openhardwaremonitor, check_mk_agent.windows: added agent support and check for monitoring hardware sensors through OpenHardwareMonitor...
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index ab79199..56d9c56 100755
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -245,9 +245,8 @@ then
fi
if type prtdiag >/dev/null 2>&1
- then
- echo '<<<solaris_prtdiag:sep(10)>>>'
- run_cached prtdiag 300 '/usr/sbin/prtdiag -v;echo "SerialNumber: $(sneep -t serial)";echo "PRTDIAG_OVERALL_STATE : $(echo $?)"'
+then
+ run_cached -s solaris_prtdiag_status 300 '/usr/sbin/prtdiag; echo $?'
fi
# TCP Connection stats
diff --git a/agents/plugins/mk_inventory.solaris b/agents/plugins/mk_inventory.solaris
index 222d8f4..eaece65 100755
--- a/agents/plugins/mk_inventory.solaris
+++ b/agents/plugins/mk_inventory.solaris
@@ -46,6 +46,17 @@ then
echo "<<<solaris_uname:sep(61):persist($UNTIL)>>>"
uname -X
+ if type prtdiag > /dev/null; then
+ echo "<<<solaris_prtdiag:sep(10):persist($UNTIL)>>>"
+ if type sneep >/dev/null 2>&1; then
+ SN=$(sneep -t serial)
+ else
+ SN=$(smbios -t SMB_TYPE_SYSTEM | grep 'Serial Number:' | awk '{print $3}')
+ fi
+ echo "SerialNumber: $SN"
+ prtdiag -v
+ fi
+
if type psrinfo > /dev/null; then
echo "<<<solaris_psrinfo:persist($UNTIL)>>>"
psrinfo -p -v
diff --git a/checkman/solaris_prtdiag b/checkman/solaris_prtdiag
deleted file mode 100644
index 8db3ea9..0000000
--- a/checkman/solaris_prtdiag
+++ /dev/null
@@ -1,12 +0,0 @@
-title: Prtdiag based health check for solaris
-agents: solaris
-catalog: os/solaris
-license: GPL
-distribution: check_mk
-description:
- This check looks for the return value of the prtdiag -v command on solaris based systems.
- A return value of 0 is interpreted as OK as documented in the prtdiag man page. Each other return value
- results in a CRITICAL state.
- CAVEAT:
- The extend of the hardware that is considered in the prtdiag command varies from solaris platform to platform (i.e. huge differences between e.g. M series and T series systems.)
- Please have a look at the documentation of prtdiag for your system.
diff --git a/checkman/solaris_prtdiag_status b/checkman/solaris_prtdiag_status
new file mode 100644
index 0000000..cd36ab3
--- /dev/null
+++ b/checkman/solaris_prtdiag_status
@@ -0,0 +1,14 @@
+title: Prtdiag based health check for solaris
+agents: solaris
+catalog: os/solaris
+license: GPL
+distribution: check_mk
+description:
+ This check looks for the return value of the prtdiag command on solaris based systems.
+ A return value of 0 is interpreted as OK as documented in the prtdiag man page.
+ Each other return value results in a CRITICAL state.
+
+ CAVEAT:
+ The extend of the hardware that is considered in the prtdiag command varies from
+ solaris platform to platform (i.e. huge differences between e.g. M series and T
+ series systems). Please have a look at the documentation of prtdiag for your system.
diff --git a/checks/solaris_prtdiag b/checks/solaris_prtdiag_status
similarity index 60%
rename from checks/solaris_prtdiag
rename to checks/solaris_prtdiag_status
index bb73b5a..95b1ca0 100644
--- a/checks/solaris_prtdiag
+++ b/checks/solaris_prtdiag_status
@@ -25,38 +25,30 @@
# Boston, MA 02110-1301 USA.
# Example output from agent:
-# .
-# .
-# .
-# SPARC64-VII mode
-#
-# PRTDIAG_OVERALL_STATE : 0
-# SerialNumber: BDF112567
+# <<<solaris_prtdiag_status>>>
+# 0
+def inventory_solaris_prtdiag_status(info):
+ if info:
+ return [(None, None)]
-def inventory_solaris_prtdiag(info):
- for line in info:
- # We have to search in the agent section if we find
- # that state
- if line[0].startswith("PRTDIAG_OVERALL_STATE"):
- return [(None, None)]
-def check_solaris_prtdiag(_no_item, _no_params, info):
- for line in info:
- if line[0].startswith("PRTDIAG_OVERALL_STATE"):
- # 0 No failures or errors are detected in the system.
- # 1 Failures or errors are detected in the system.
- state = int(info[-1][0].split(':')[1])
+def check_solaris_prtdiag_status(_no_item, _no_params, info):
+ if not info:
+ return
- # If we not find the status in the agent output, raise error
- if state == 0:
- return 0, "No failures or errors are detected in the system"
+ # 0 No failures or errors are detected in the system.
+ # 1 Failures or errors are detected in the system.
+ state = int(info[0][0])
+ if int(info[0][0]) == 0:
+ return 0, "No failures or errors are reported"
else:
- return 2, "Failures or errors are detected in the system, please check details via prtdiag -v"
+ return 2, "Failures or errors are reported by the system. " \
+ "Please check the output of \"prtdiag -v\" for details."
-check_info['solaris_prtdiag'] = {
- "inventory_function" : inventory_solaris_prtdiag,
- "check_function" : check_solaris_prtdiag,
+check_info['solaris_prtdiag_status'] = {
+ "inventory_function" : inventory_solaris_prtdiag_status,
+ "check_function" : check_solaris_prtdiag_status,
"service_description" : "Hardware Overall State"
}