Module: check_mk
Branch: master
Commit: 7eaa163f8a48e9edcd6c4aa0561ecb1b1b328556
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7eaa163f8a48e9…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jul 4 12:20:31 2016 +0200
3553 SNMPv3 noAuthNoPriv: Fixed diagnostic page
---
.werks/3553 | 9 +++++++++
ChangeLog | 1 +
modules/automation.py | 6 +++++-
web/htdocs/js/wato.js | 6 ++++--
web/htdocs/wato.py | 2 ++
5 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/.werks/3553 b/.werks/3553
new file mode 100644
index 0000000..d7e1879
--- /dev/null
+++ b/.werks/3553
@@ -0,0 +1,9 @@
+Title: SNMPv3 noAuthNoPriv: Fixed diagnostic page
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i1
+Date: 1467627593
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 42d5122..d794d09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -397,6 +397,7 @@
* 3687 Hostname translation for piggybacked host: now it's possible to enter any
number of regular expressions within this ruleset...
* 3657 Custom host attributes can now be configured...
* 3658 LDAP: Connections can now be enabled/disabled per site...
+ * 3553 SNMPv3 noAuthNoPriv: Fixed diagnostic page
* 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/modules/automation.py b/modules/automation.py
index 1cf3683..e3b5bcf 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -694,6 +694,8 @@ def automation_diag_host(args):
snmpv3_use = args[8]
if snmpv3_use in ["authNoPriv", "authPriv"]:
snmpv3_auth_proto, snmpv3_security_name, snmpv3_security_password =
args[9:12]
+ else:
+ snmpv3_security_name = args[10]
if snmpv3_use == "authPriv":
snmpv3_privacy_proto, snmpv3_privacy_password = args[12:14]
@@ -733,7 +735,7 @@ def automation_diag_host(args):
elif test.startswith('snmp'):
# SNMPv3 tuples
- # ('noAuthNoPriv',)
+ # ('noAuthNoPriv', "username")
# ('authNoPriv', 'md5', '11111111',
'22222222')
# ('authPriv', 'md5', '11111111', '22222222',
'DES', '33333333')
@@ -743,6 +745,8 @@ def automation_diag_host(args):
snmpv3_credentials = [snmpv3_use]
if snmpv3_use in ["authNoPriv", "authPriv"]:
snmpv3_credentials.extend([snmpv3_auth_proto,
snmpv3_security_name, snmpv3_security_password])
+ else:
+ snmpv3_credentials.extend([snmpv3_security_name])
if snmpv3_use == "authPriv":
snmpv3_credentials.extend([snmpv3_privacy_proto,
snmpv3_privacy_password])
explicit_snmp_communities[hostname] = tuple(snmpv3_credentials)
diff --git a/web/htdocs/js/wato.js b/web/htdocs/js/wato.js
index 842d92d..1e38291 100644
--- a/web/htdocs/js/wato.js
+++ b/web/htdocs/js/wato.js
@@ -772,7 +772,10 @@ function start_host_diag_test(ident, hostname) {
if
(document.getElementsByName("vs_host_p_snmp_v3_credentials_USE")[0].checked) {
v3_use =
encodeURIComponent(document.getElementsByName('vs_host_p_snmp_v3_credentials_use')[0].value);
vars += '&snmpv3_use=' + v3_use;
- if (v3_use == "1") {
+ if (v3_use == "0") {
+ vars += '&snmpv3_security_name=' +
encodeURIComponent(document.getElementsByName('vs_host_p_snmp_v3_credentials_0_1')[0].value);
+ }
+ else if (v3_use == "1") {
vars += '&snmpv3_auth_proto=' +
encodeURIComponent(document.getElementsByName('vs_host_p_snmp_v3_credentials_1_1')[0].value);
vars += '&snmpv3_security_name=' +
encodeURIComponent(document.getElementsByName('vs_host_p_snmp_v3_credentials_1_2')[0].value);
vars += '&snmpv3_security_password=' +
encodeURIComponent(document.getElementsByName('vs_host_p_snmp_v3_credentials_1_3')[0].value);
@@ -786,7 +789,6 @@ function start_host_diag_test(ident, hostname) {
}
}
-
vars += '&agent_port=' +
encodeURIComponent(document.getElementsByName('vs_rules_p_agent_port')[0].value);
vars += '&snmp_timeout=' +
encodeURIComponent(document.getElementsByName('vs_rules_p_snmp_timeout')[0].value);
vars += '&snmp_retries=' +
encodeURIComponent(document.getElementsByName('vs_rules_p_snmp_retries')[0].value);
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 742eb61..073c7b6 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2628,6 +2628,8 @@ def ajax_diag_host():
snmpv3_privacy_proto = { "0": "DES",
"1": "AES" }.get(html.var("snmpv3_privacy_proto"))
args[10] = snmpv3_privacy_proto
args[11] = html.var("snmpv3_privacy_password")
+ else:
+ args[8] = html.var("snmpv3_security_name")
result = check_mk_automation(host.site_id(), "diag-host", [hostname,
_test] + args)
# API is defined as follows: Two data fields, separated by space.