Module: check_mk
Branch: master
Commit: eeb2941172bcb107efa272866ab102a7b7bf0512
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eeb2941172bcb1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 27 15:43:06 2015 +0100
#2171 FIX netapp_api_vf_status: Handling "DR backup" as normal (OK) state now
---
.werks/2171 | 10 ++++++++++
ChangeLog | 1 +
checks/netapp_api_vf_status | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/2171 b/.werks/2171
new file mode 100644
index 0000000..294dba4
--- /dev/null
+++ b/.werks/2171
@@ -0,0 +1,10 @@
+Title: netapp_api_vf_status: Handling "DR backup" as normal (OK) state now
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1427467363
+
+
diff --git a/ChangeLog b/ChangeLog
index 6f9ecc3..0df0b32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -291,6 +291,7 @@
* 2170 FIX: jolokia_metrics_gc: Fixed exception when GC time not reported by server
* 2109 FIX: netapp_api_volumes: now using the defined levels when using the Nagios core
* 1241 FIX: hp_prolaint: Unkown state is not longer handled as OK...
+ * 2171 FIX: netapp_api_vf_status: Handling "DR backup" as normal (OK) state now
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/checks/netapp_api_vf_status b/checks/netapp_api_vf_status
index 71f8fe4..8ec54e3 100644
--- a/checks/netapp_api_vf_status
+++ b/checks/netapp_api_vf_status
@@ -39,7 +39,7 @@ def check_netapp_api_vf_status(item, _no_params, info):
if item not in filer_states:
return
- state = filer_states[item] != "running" and 2 or 0
+ state = filer_states[item] not in ["running", "DR backup"] and 2 or 0
return state, "Status is %s" % filer_states[item]
check_info["netapp_api_vf_status"] = {
Module: check_mk
Branch: master
Commit: cfeef86f87b996911a5bcc035ca7cd0f75db0e9a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cfeef86f87b996…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Mar 27 15:35:04 2015 +0100
#1241 FIX hp_prolaint: Unkown state is not longer handled as OK
Due to a bug in the HP Firmware there was a need to handle a reported uknown state as {OK}.
Since HP provided an Firmware update (http://h20566.www2.hp.com/hpsc/doc/public/display?docId=c03939085&jump) we can
handle this state now like expected.
---
.werks/1241 | 12 ++++++++++++
ChangeLog | 1 +
checkman/hp_proliant | 5 +++--
checks/hp_proliant | 2 +-
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/1241 b/.werks/1241
new file mode 100644
index 0000000..de06c96
--- /dev/null
+++ b/.werks/1241
@@ -0,0 +1,12 @@
+Title: hp_prolaint: Unkown state is not longer handled as OK
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1427466792
+Class: fix
+
+Due to a bug in the HP Firmware there was a need to handle a reported uknown state as {OK}.
+Since HP provided an Firmware update (http://h20566.www2.hp.com/hpsc/doc/public/display?docId=c03939085&jump) we can
+handle this state now like expected.
+
diff --git a/ChangeLog b/ChangeLog
index f8b31f2..6f9ecc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -290,6 +290,7 @@
* 2169 FIX: jolokia_metrics.threads: Fixed graph template...
* 2170 FIX: jolokia_metrics_gc: Fixed exception when GC time not reported by server
* 2109 FIX: netapp_api_volumes: now using the defined levels when using the Nagios core
+ * 1241 FIX: hp_prolaint: Unkown state is not longer handled as OK...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/checkman/hp_proliant b/checkman/hp_proliant
index 9bc094e..0140f57 100644
--- a/checkman/hp_proliant
+++ b/checkman/hp_proliant
@@ -8,8 +8,9 @@ description:
on a HP Proliant server and reads the general status information.
In addition it also returns the serial number and firmware version.
- The status is {OK} if the agent signals {Unknown} or {Ok}, {WARN} on
- {Degraded} and {CRIT} on {Failed}.
+ The status is {OK} only if the agent signals {Ok}, {WARN} on
+ {Degraded} and {CRIT} on {Failed}. If you get an {UKNOWN} state you may need a Fireware Update:
+ http://h20566.www2.hp.com/hpsc/doc/public/display?docId=c03939085&jum
inventory:
One check is automatically created for each supported server.
diff --git a/checks/hp_proliant b/checks/hp_proliant
index 10d089d..d8ec3e6 100644
--- a/checks/hp_proliant
+++ b/checks/hp_proliant
@@ -30,7 +30,7 @@
# '.1.3.6.1.4.1.232.11.1.3.0' => cpqHoMibCondition
hp_proliant_general_status_map = { 1: 'Unknown', 2: 'Ok', 3: 'Degraded', 4: 'Failed' }
-hp_proliant_general_status2nagios_map = { 'Unknown': 0, 'Ok': 0, 'Degraded': 1, 'Failed': 2, }
+hp_proliant_general_status2nagios_map = { 'Unknown': 3, 'Ok': 0, 'Degraded': 1, 'Failed': 2, }
def inventory_proliant_general(info):
if len(info) > 0 and len(info[0]) > 1:
Module: check_mk
Branch: master
Commit: 088a70da23f174c5b9cd94312b91238ded458079
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=088a70da23f174…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 27 10:00:51 2015 +0100
#2168 FIX Fixed automation actions with transid=-1 when using basic authentication
---
.werks/2168 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/index.py | 5 +++++
3 files changed, 16 insertions(+)
diff --git a/.werks/2168 b/.werks/2168
new file mode 100644
index 0000000..51b2fbc
--- /dev/null
+++ b/.werks/2168
@@ -0,0 +1,10 @@
+Title: Fixed automation actions with transid=-1 when using basic authentication
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1427446830
+
+
diff --git a/ChangeLog b/ChangeLog
index 983b3e3..43ff5b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -346,6 +346,7 @@
* 2150 FIX: Reworked internal logging mechanism...
* 1953 FIX: Fixed processing of html processing in input fields...
* 2157 FIX: LDAP: Fixed group-to-role/group-to-contactgroup sync with OpenLDAP (using posixGroup)
+ * 2168 FIX: Fixed automation actions with transid=-1 when using basic authentication
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index 4a6462e..26604f1 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -207,6 +207,11 @@ def handler(req, fields = None, profiling = True):
login.page_login(plain_error)
release_all_locks()
return apache.OK
+ else:
+ # In case of basic auth the user is already known, but we still need to decide
+ # whether or not the user is an automation user (which is allowed to use transid=-1)
+ if html.var("_secret"):
+ login.check_auth_automation()
# Call userdb page hooks which are executed on a regular base to e.g. syncronize
# information withough explicit user triggered actions
Module: check_mk
Branch: master
Commit: 8f4eeba0ee090a6a3ad8ee09cb3cd2f268465f97
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8f4eeba0ee090a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 27 09:39:18 2015 +0100
#2167 SNMPv3: Added support for using SNMP contextes in requests
Some devices, which are checked via SNMPv3, offer their SNMP data
in different SNMP contextes. Check_MK can now be configured, based
on the host and check type, to use one or multiple specific SNMPv3
context names in the SNMP requests done for the host and check.
By default Check_MK does not set any context, but if you need it,
simply configure the rule <i>SNMPv3 contexts to use in requests</i>.
Please note to only use this feature when you really need it. By
configuring multiple contextes, all SNMP requests are done once for
each SNMPv3 context. This increases the amount of SNMP communication.
---
.werks/2167 | 19 +++++++
ChangeLog | 1 +
modules/check_mk.py | 3 ++
modules/config.py | 1 +
modules/snmp.py | 29 +++++++---
web/plugins/wato/check_mk_configuration.py | 79 ++++++++++++++++++----------
6 files changed, 97 insertions(+), 35 deletions(-)
diff --git a/.werks/2167 b/.werks/2167
new file mode 100644
index 0000000..c3f37a6
--- /dev/null
+++ b/.werks/2167
@@ -0,0 +1,19 @@
+Title: SNMPv3: Added support for using SNMP contextes in requests
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.7i1
+Date: 1427445341
+Class: feature
+
+Some devices, which are checked via SNMPv3, offer their SNMP data
+in different SNMP contextes. Check_MK can now be configured, based
+on the host and check type, to use one or multiple specific SNMPv3
+context names in the SNMP requests done for the host and check.
+
+By default Check_MK does not set any context, but if you need it,
+simply configure the rule <i>SNMPv3 contexts to use in requests</i>.
+
+Please note to only use this feature when you really need it. By
+configuring multiple contextes, all SNMP requests are done once for
+each SNMPv3 context. This increases the amount of SNMP communication.
diff --git a/ChangeLog b/ChangeLog
index f1bf387..983b3e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Core & Setup:
* 1759 Packed RPM and DEB agent packages are now shipped with normal Check_MK package...
* 1228 Linux Agent: Now supports systemd...
+ * 2167 SNMPv3: Added support for using SNMP contextes in requests...
* 1791 FIX: Fix problem where many bogus RRD files for Check_MK service would be created...
* 1792 FIX: Fix path to special agents in case of manual installation
* 1797 FIX: Fix incomplete configuration during checking when using CMC...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 40b881f..d8a4f38 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -641,6 +641,9 @@ def get_snmp_character_encoding(hostname):
if len(entries) > 0:
return entries[0]
+def is_snmpv3_host(hostname):
+ return type(snmp_credentials_of(hostname)) == tuple
+
def is_snmp_host(hostname):
return in_binary_hostlist(hostname, snmp_hosts)
diff --git a/modules/config.py b/modules/config.py
index 9718c9f..7332004 100644
--- a/modules/config.py
+++ b/modules/config.py
@@ -109,6 +109,7 @@ tcp_hosts = [ (['tcp'], ALL_HOSTS), (NEGATE, ['snmp']
bulkwalk_hosts = []
snmpv2c_hosts = []
snmp_without_sys_descr = []
+snmpv3_contexts = []
usewalk_hosts = []
dyndns_hosts = [] # use host name as ip address for these hosts
ignored_checktypes = [] # exclude from inventory
diff --git a/modules/snmp.py b/modules/snmp.py
index cbd955f..4ff2cbb 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -90,6 +90,12 @@ def oid_to_intlist(oid):
def cmp_oids(o1, o2):
return cmp(oid_to_intlist(o1), oid_to_intlist(o2))
+def snmpv3_contexts_of(hostname, check_type):
+ for ty, rules in host_extra_conf(hostname, snmpv3_contexts):
+ if ty == check_type:
+ return rules
+ return [None]
+
def get_snmp_table(hostname, ip, check_type, oid_info):
# oid_info is either ( oid, columns ) or
# ( oid, suboids, columns )
@@ -144,10 +150,19 @@ def get_snmp_table(hostname, ip, check_type, oid_info):
if opt_use_snmp_walk or is_usewalk_host(hostname):
rowinfo = get_stored_snmpwalk(hostname, fetchoid)
- elif has_inline_snmp and use_inline_snmp:
- rowinfo = inline_snmpwalk_on_suboid(hostname, check_type, fetchoid, oid)
else:
- rowinfo = snmpwalk_on_suboid(hostname, ip, fetchoid)
+ rowinfo = []
+ if is_snmpv3_host(hostname):
+ snmp_contexts = snmpv3_contexts_of(hostname, check_type)
+ else:
+ snmp_contexts = [None]
+
+ for context_name in snmp_contexts:
+ if has_inline_snmp and use_inline_snmp:
+ rowinfo += inline_snmpwalk_on_suboid(hostname, check_type, fetchoid, oid,
+ context_name=context_name)
+ else:
+ rowinfo += snmpwalk_on_suboid(hostname, ip, fetchoid, context_name=context_name)
# I've seen a broken device (Mikrotik Router), that broke after an
# update to RouterOS v6.22. It would return 9 time the same OID when
@@ -418,10 +433,12 @@ def snmp_decode_string(text):
# | Non-inline SNMP handling code. Kept for compatibility. |
# '----------------------------------------------------------------------'
-def snmpwalk_on_suboid(hostname, ip, oid, hex_plain = False):
+def snmpwalk_on_suboid(hostname, ip, oid, hex_plain = False, context_name = None):
portspec = snmp_port_spec(hostname)
- command = snmp_walk_command(hostname) + \
- " -OQ -OU -On -Ot %s%s %s" % (ip, portspec, oid)
+ command = snmp_walk_command(hostname)
+ if context_name != None:
+ command += " -n %s" % quote_shell_string(context_name)
+ command += " -OQ -OU -On -Ot %s%s %s" % (ip, portspec, oid)
vverbose(' Running %s\n' % command)
snmp_process = subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE)
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index e9f8f20..9dada8c 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1815,35 +1815,6 @@ register_rule(group,
),
)
-def get_snmp_checktypes():
- checks = check_mk_local_automation("get-check-information")
- types = [ (cn, (c['title'] != cn and '%s: ' % cn or '') + c['title'])
- for (cn, c) in checks.items() if c['snmp'] ]
- types.sort()
- return [ (None, _('All SNMP Checks')) ] + types
-
-register_rule(group,
- "snmp_check_interval",
- Tuple(
- title = _('Check intervals for SNMP checks'),
- help = _('This rule can be used to customize the check interval of each SNMP based check. '
- 'With this option it is possible to configure a longer check interval for specific '
- 'checks, than then normal check interval.'),
- elements = [
- DropdownChoice(
- title = _("Checktype"),
- choices = get_snmp_checktypes,
- ),
- Integer(
- title = _("Do check every"),
- unit = _("minutes"),
- min_value = 1,
- default_value = 1,
- ),
- ]
- )
-)
-
group = "monconf/" + _("Notifications")
register_rule(group,
"extra_host_conf:notifications_enabled",
@@ -2538,3 +2509,53 @@ register_rule(group,
"agent is running on. It is not applied to the translated piggybacked hosts."),
),
match = "dict")
+
+def get_snmp_checktypes():
+ checks = check_mk_local_automation("get-check-information")
+ types = [ (cn, (c['title'] != cn and '%s: ' % cn or '') + c['title'])
+ for (cn, c) in checks.items() if c['snmp'] ]
+ types.sort()
+ return [ (None, _('All SNMP Checks')) ] + types
+
+register_rule(group,
+ "snmp_check_interval",
+ Tuple(
+ title = _('Check intervals for SNMP checks'),
+ help = _('This rule can be used to customize the check interval of each SNMP based check. '
+ 'With this option it is possible to configure a longer check interval for specific '
+ 'checks, than then normal check interval.'),
+ elements = [
+ DropdownChoice(
+ title = _("Checktype"),
+ choices = get_snmp_checktypes,
+ ),
+ Integer(
+ title = _("Do check every"),
+ unit = _("minutes"),
+ min_value = 1,
+ default_value = 1,
+ ),
+ ]
+ )
+)
+
+register_rule(group,
+ "snmpv3_contexts",
+ Tuple(
+ title = _('SNMPv3 contexts to use in requests'),
+ help = _('By default Check_MK does not use a specific context during SNMPv3 queries, '
+ 'but some devices are offering their information in different SNMPv3 contexts. '
+ 'This rule can be used to configure, based on hosts and check type, which SNMPv3 '
+ 'contexts Check_MK should ask for when getting information via SNMPv3.'),
+ elements = [
+ DropdownChoice(
+ title = _("Checktype"),
+ choices = get_snmp_checktypes,
+ ),
+ ListOfStrings(
+ title = _("SNMP Context IDs"),
+ allow_empty = False,
+ ),
+ ]
+ )
+)