Module: check_mk
Branch: master
Commit: ee4b122076488d216c67e45a7a68a1c93294b7f5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ee4b122076488d…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Feb 22 14:09:08 2017 +0100
4414 FIX oracle_rman: fixed UnboundLocalError if sid level 0 is empty
Change-Id: I402d1cd536fe02951a0611f61d56fdbfd442538f
---
.werks/4414 | 11 +++++++++++
ChangeLog | 1 +
checks/oracle_rman | 8 ++------
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/.werks/4414 b/.werks/4414
new file mode 100644
index 0000000..62eceae
--- /dev/null
+++ b/.werks/4414
@@ -0,0 +1,11 @@
+Title: oracle_rman: fixed UnboundLocalError if sid level 0 is empty
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1487768837
+
+
diff --git a/ChangeLog b/ChangeLog
index aa584c5..3c1bfd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
* 4410 FIX: brocade_fcport: fixed missing info handling
* 4412 FIX: haproxy.server: fixed empty uptime info handling
* 4413 FIX: mem.linux: handle empty info
+ * 4414 FIX: oracle_rman: fixed UnboundLocalError if sid level 0 is empty
Multisite:
* 4365 FIX: Service availability: Host down could not be rewritten to other states
like CRIT
diff --git a/checks/oracle_rman b/checks/oracle_rman
index c790478..6a44d23 100644
--- a/checks/oracle_rman
+++ b/checks/oracle_rman
@@ -60,7 +60,6 @@ def inventory_oracle_rman(info):
return inventory
def check_oracle_rman(item, params, info):
-
sid_level0 = ''
backupage_level0 = 0
item_found = False
@@ -75,8 +74,7 @@ def check_oracle_rman(item, params, info):
if len(line) == 6:
sid, status, start, end, backuptype, backupage = line
- if len(line) == 8:
-
+ elif len(line) == 8:
sid, status, not_used_1, end, backuptype, backuplevel, backupage, backupscn =
line
if backupscn == '':
backupscn = -1
@@ -112,14 +110,12 @@ def check_oracle_rman(item, params, info):
if item[:-1] == "%s.DB_INCR_" % item[:item.find('.')]:
# we are on sid.DB_INCR_
- if item[-1] == '0':
-
+ if item[-1] == '0' and sid_level0:
# we are on a DB_INCR_0
# we could have invalid data from for item loop due to 'continue'
at backuplevel==0
sid, end, backupage = sid_level0, end_level0, backupage_level0
else:
-
if item == "%s.%s_%s" % (sid, backuptype, backuplevel):
# we got a line from agent
# => use the data from agent