Module: check_mk
Branch: master
Commit: 38bfd092a9197aecc6a429894e6ed886b67120ba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=38bfd092a9197a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Oct 17 13:56:25 2017 +0200
5321 FIX mk_oracle: Fixed usage of awk command in case of SunOS which causes 'record
... too long' error
The consequence of above error was that Check_MK did not
find any ORACLE instances any more. Fixed that by using
{{nawk}} in case of SunOS.
Change-Id: I73612f7e8412f0b62bd7a807718bd672a32861f8
---
.werks/5321 | 13 +++++++++++++
agents/plugins/mk_oracle | 4 +++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/5321 b/.werks/5321
new file mode 100644
index 0000000..b1d2556
--- /dev/null
+++ b/.werks/5321
@@ -0,0 +1,13 @@
+Title: mk_oracle: Fixed usage of awk command in case of SunOS which causes 'record
... too long' error
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1508241149
+
+The consequence of above error was that Check_MK did not
+find any ORACLE instances any more. Fixed that by using
+{{nawk}} in case of SunOS.
diff --git a/agents/plugins/mk_oracle b/agents/plugins/mk_oracle
index dcc871d..5259008 100755
--- a/agents/plugins/mk_oracle
+++ b/agents/plugins/mk_oracle
@@ -742,12 +742,14 @@ sql_asm_diskgroup()
function set_osenv () {
ostype=$(uname -s)
+ AWK=$(which awk)
if [ ${ostype} = 'Linux' ] ; then
GREP=$(which grep)
STATCX='stat -c %X'
STATCY='stat -c %Y'
+ AWK=$(which nawk)
elif [ ${ostype} = 'SunOS' ] ; then
@@ -1256,7 +1258,7 @@ fi
# Get list of all running databases
# Do not work on ASM in this plugin. => Ignore a running ASM-Instance!
-SIDS=$(UNIX95=true ps -ef | awk '{print $NF}' | ${GREP} -E
'^asm_pmon_|^ora_pmon_|^xe_pmon_XE' | cut -d"_" -f3-)
+SIDS=$(UNIX95=true ps -ef | ${AWK} '{print $NF}' | ${GREP} -E
'^asm_pmon_|^ora_pmon_|^xe_pmon_XE' | cut -d"_" -f3-)
# If we do not have found any running database instance, then either
# no ORACLE is present on this system or it's just currently not running.