Module: check_mk
Branch: master
Commit: 8438a85961d135c6bb815f71069c5511d8d7215b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8438a85961d135…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Nov 26 15:32:21 2014 +0100
New keywords OID_END_BIN and OID_END_OCTET_STRING for SNMP
---
modules/snmp.py | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/modules/snmp.py b/modules/snmp.py
index 22dd216..6ba2e4b 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -28,9 +28,11 @@
import subprocess
-OID_END = 0
-OID_STRING = -1
-OID_BIN = -2
+OID_END = 0 # Suffix-part of OID that was not specified
+OID_STRING = -1 # Complete OID as string ".1.3.6.1.4.1.343...."
+OID_BIN = -2 # Complete OID as binary string "\x01\x03\x06\x01..."
+OID_END_BIN = -3 # Same, but just the end part
+OID_END_OCTET_STRING = -4 # yet same, but omit first byte (assuming that is the length byte)
def strip_snmp_value(value, hex_plain = False):
v = value.strip()
@@ -127,7 +129,10 @@ def get_snmp_table(hostname, ip, check_type, oid_info):
# in later. If the column in OID_STRING or OID_BIN we do something
# similar: we fill in the complete OID of the entry, either as
# string or as binary UTF-8 encoded number string
- if column in [ OID_END, OID_STRING, OID_BIN ]:
+ if column in [ OID_END, OID_STRING, OID_BIN, OID_END_BIN, OID_END_OCTET_STRING ]:
+ if index_column >= 0:
+ raise MKGeneralException("Invalid SNMP OID specification in implementation of check. "
+ "You can only use one of OID_END, OID_STRING, OID_BIN, OID_END_BIN and OID_END_OCTET_STRING.")
index_column = colno
columns.append((fetchoid, []))
index_format = column
@@ -161,12 +166,16 @@ def get_snmp_table(hostname, ip, check_type, oid_info):
fetchoid, max_column = columns[max_len_col]
for o, value in max_column:
if index_format == OID_END:
- eo = extract_end_oid(fetchoid, o)
- index_rows.append((o, eo))
+ index_rows.append((o, extract_end_oid(fetchoid, o)))
elif index_format == OID_STRING:
index_rows.append((o, o))
- else:
+ elif index_format == OID_BIN:
index_rows.append((o, oid_to_bin(o)))
+ elif index_format == OID_END_BIN:
+ index_rows.append((o, oid_to_bin(extract_end_oid(fetchoid, o))))
+ else: # OID_END_OCTET_STRING:
+ index_rows.append((o, oid_to_bin(extract_end_oid(fetchoid, o))[1:]))
+
columns[index_column] = fetchoid, index_rows
Module: check_mk
Branch: master
Commit: b4052180869926f65302bad671a01561d67df119
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b4052180869926…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 26 11:50:38 2014 +0100
#1536 FIX fritz!Box special agent now deals with new URLs (firmware >= 6.0) correctly
---
.werks/1536 | 10 ++++++++++
ChangeLog | 1 +
agents/special/agent_fritzbox | 43 +++++++++++++++++++++++++++--------------
3 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/.werks/1536 b/.werks/1536
new file mode 100644
index 0000000..2928004
--- /dev/null
+++ b/.werks/1536
@@ -0,0 +1,10 @@
+Title: fritz!Box special agent now deals with new URLs (firmware >= 6.0) correctly
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1416999028
+
+
diff --git a/ChangeLog b/ChangeLog
index 443a2f4..c47760f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
* 1532 FIX: mk_sap: Cleaning up old state information from sap.state file...
* 1548 FIX: bluecat_ntp: do not inventorized devices where NTP information is missing
* 1549 FIX: bluecat_threads: do not inventorize this check where information is missing...
+ * 1536 FIX: fritz!Box special agent now deals with new URLs (firmware >= 6.0) correctly
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/agents/special/agent_fritzbox b/agents/special/agent_fritzbox
index 6cccf36..30df424 100755
--- a/agents/special/agent_fritzbox
+++ b/agents/special/agent_fritzbox
@@ -107,9 +107,10 @@ class RequestError(Exception):
g_device = None
g_version = None
+base_urls = [ 'http://%s:49000/upnp' % host_address, 'http://%s:49000/igdupnp' % host_address ]
+
def get_upnp_info(control, namespace, action):
global g_device, g_version
- url = 'http://%s:49000/upnp/control/%s' % (host_address, control)
headers = {
'User-agent': 'Check_MK agent_fritzbox',
@@ -124,20 +125,32 @@ def get_upnp_info(control, namespace, action):
</s:Body>
</s:Envelope>''' % (action, namespace)
- if opt_debug:
- sys.stdout.write('============================\n')
- sys.stdout.write('URL: %s\n' % url)
- sys.stdout.write('SoapAction: %s\n' % headers['SoapAction'])
-
- try:
- req = urllib2.Request(url, data, headers)
- handle = urllib2.urlopen(req)
- except Exception, e:
- if opt_debug:
- sys.stdout.write('----------------------------\n')
- sys.stdout.write(traceback.format_exc())
- sys.stdout.write('============================\n')
- raise RequestError('Error during UPNP call')
+ # Fritz!Box with firmware >= 6.0 use a new url. We try the newer one first and
+ # try the other one, when the first one did not succeed.
+ for base_url in base_urls[:]:
+ url = base_url + '/control/' + control
+ try:
+ if opt_debug:
+ sys.stdout.write('============================\n')
+ sys.stdout.write('URL: %s\n' % url)
+ sys.stdout.write('SoapAction: %s\n' % headers['SoapAction'])
+ req = urllib2.Request(url, data, headers)
+ handle = urllib2.urlopen(req)
+ break # got a good response
+ except urllib2.HTTPError, e:
+ if e.code == 500:
+ # Is the result when the old URL can not be found, continue in this
+ # case and revert the order of base urls in the hope that the other
+ # url gets a successful result to have only one try on future requests
+ # during an agent execution
+ base_urls.reverse()
+ continue
+ except Exception, e:
+ if opt_debug:
+ sys.stdout.write('----------------------------\n')
+ sys.stdout.write(traceback.format_exc())
+ sys.stdout.write('============================\n')
+ raise RequestError('Error during UPNP call')
infos = handle.info()
contents = handle.read()
Module: check_mk
Branch: master
Commit: 372b5c1b1a8f9dfa57a74306a70d6fd6373585f0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=372b5c1b1a8f9d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 26 11:13:57 2014 +0100
#1535 Disabled services on service discovery page now link to the ruleset
---
.werks/1535 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 7 +++++++
3 files changed, 18 insertions(+)
diff --git a/.werks/1535 b/.werks/1535
new file mode 100644
index 0000000..b2501ec
--- /dev/null
+++ b/.werks/1535
@@ -0,0 +1,10 @@
+Title: Disabled services on service discovery page now link to the ruleset
+Level: 1
+Component: wato
+Class: feature
+Compatible: compat
+State: unknown
+Version: 1.2.5i7
+Date: 1416996809
+
+
diff --git a/ChangeLog b/ChangeLog
index b218b6e..443a2f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -75,6 +75,7 @@
* 1489 Added iCalendar import for generating timeperiods e.g. for holidays...
* 1495 Most WATO tables can now be sorted (where useful)...
* 1504 WATO makes host tag and group information available for NagVis...
+ * 1535 Disabled services on service discovery page now link to the ruleset
* 1165 FIX: Fixed exception in service discovery of logwatch event console forwarding checks...
* 1490 FIX: Timperiod excludes can now even be configured when creating a timeperiod...
* 1491 FIX: Fixed bug in dynamic lists where removing an item was not always possible...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 5305e9d..3ccd0c1 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -3292,6 +3292,13 @@ def show_service_table(host, firsttime):
("item", mk_repr(item))])
html.icon_button(url, _("Edit and analyze the check parameters of this service"), "check_parameters")
+ if state_type == "ignored":
+ url = make_link([("mode", "edit_ruleset"),
+ ("varname", "ignored_services"),
+ ("host", hostname),
+ ("item", mk_repr(descr))])
+ html.icon_button(url, _("Edit and analyze the disabled services rules"), "ignore")
+
# Permanently disable icon
if state_type in ['new', 'old']:
url = make_link([
Module: check_mk
Branch: master
Commit: 14efe0ff259d49720135a5107bc02093d4c14f36
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=14efe0ff259d49…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 26 10:02:10 2014 +0100
This fixes an error where filtering a view leads into an empty view, because
the enforced site filter has the first site preselected, which is not always
the site of the data shown in the view. Now we use the optional site filter
for most views to cleanup this error.
Conflicts:
ChangeLog
web/plugins/views/builtin.py
---
.werks/1534 | 13 ++++++++
ChangeLog | 1 +
mkeventd/web/plugins/views/mkeventd.py | 4 +--
web/plugins/views/builtin.py | 52 ++++++++++++++++----------------
4 files changed, 42 insertions(+), 28 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=14efe0ff25…