check_oracle possible bug

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
target74
Posts: 2
Joined: Mon Apr 28, 2014 3:07 am

check_oracle possible bug

Post by target74 »

Hi everyone.

We have some strange result from "check_oracle --tablespace" checks.

Plugin return no error when using as argument a tablespace not existing:

[nagios]:/usr/lib/nagios/plugins$ ./check_oracle --tablespace SAP_SMD user xxxx PSAPSR3702 95 90
./check_oracle: line 269: [: : integer expression expected
./check_oracle: line 273: [: : integer expression expected
./check_oracle: line 277: [: : integer expression expected
SAP_SMD : PSAPSR3702 OK - % used [ / MB available ]|PSAPSR3702=%;90;95;0;100
[nagios]:/usr/lib/nagios/plugins$ echo $?
0

Debugging the query used in plugin, it seems that sqlplus command exit with no error, but result is "no rows selected".

So, a change to plugin as by following diff seems to resolve issue:

264a265,268
> if [ $(echo "$result" | grep -c "no rows selected" ) -ne 0 ]; then
> echo "No data returned by Oracle - tablespace $5 not found?"
> exit $STATE_UNKNOWN
> fi

Issue has been replicated with oracle 10g and oracle 11g rdbms.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_oracle possible bug

Post by slansing »

Can you upload an exact duplicate of this oracle plugin you are using? As well as sharing the link as to where you got it from? I'm moving this to the core support forums as this is for the Nagios Plugins package.
Locked