Compare commits

..

4 Commits

Author SHA1 Message Date
dodger 004b3d9171 shellcheck 2023-06-19 16:27:07 +02:00
dodger ad326d409a catching output from get oracle home function 2022-05-25 12:37:31 +02:00
dodger 877309adf3 changes 2022-05-23 17:56:04 +02:00
dodger 78252cc2de Merge pull request 'getops_switch' (#1) from getops_switch into master
Reviewed-on: dodger/nagios_oracle_check_plugin#1
2022-05-12 12:27:31 +02:00
2 changed files with 13 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
# SC2317: Command appears to be unreachable. <- unused functions on the template
# SC2034: OPTION appears unused. Verify use <- unused variable on the template
# SC1090: ShellCheck can't follow non-constant source. Use a directive to specify location. <- ${CONFIGFILE}
#disable=SC2317,SC2034,SC1090
disable=SC2034
+8 -2
View File
@@ -72,10 +72,12 @@ RESET="\033[0;00m"
DEBUG=0
DEBUG=1
NOHEAD="SET HEAD OFF
SET PAGES 0
SET FEED OFF"
SET FEED OFF
SET TIMING OFF"
########################################################################
#
@@ -578,7 +580,6 @@ group by username
local AUX="${ORAENV} printf \"%s\n${QUERY}\" | ${SQLPLUS}"
local RESSULT="$(${SSH} "${AUX}" | awk '{print $1}')"
if [[ "${RESSULT}" =~ .*(ORA\-[0-9]{1,}).* ]] ; then
echo "CRITICAL - ${ORACLE_SID} Error getting sessions: ${BASH_REMATCH[1]}"
return ${STATE_CRITICAL}
@@ -1795,6 +1796,11 @@ fi
SSH="ssh ${ORACLE_OSUSER}@${REMOTE_SERVER} -xq"
get_remote_oraclehome
RES=$?
if [[ ${RES} -ne 0 ]] ; then
echo "CRITICAL - ORACLE_HOME not found"
exit ${STATE_CRITICAL}
fi
# SQLPLUS FOR CONNECTIONS
SQLPLUS="sqlplus -s '${ORACLEUSER}/${ORACLEUSERPASSWORD}@${ORACLE_SID}'"