Page 1 of 1

Got error with check_oracle_health plugin

Posted: Thu Mar 25, 2021 3:21 am
by axvaster
Hi support,

We used check_oracle_health plugin on XI 5.7.3 and encountered the problem as attachment.

Code: Select all

[nagios@Nagios19 ~]$ /usr/bin/env LD_LIBRARY_PATH=/usr/lib/oracle/18.5/client64/lib ORACLE_HOME=/usr/lib/oracle/18.5/client64 /usr/local/nagios/libexec/check_oracle_health --connect '' --username '' --password '' --mode sql --name="select count(*) from nagios.alert_history where ORIGINATING_TIMESTAMP > trunc(systimestamp - 30/(24*60),'mi') and ORAERROR1 not in (select ORAERROR1 from nagios.oraerrwlst)" --warning 0 --critical 2
Error message is following:

Code: Select all

UNKNOWN - got no valid response for select count\\(\\*\\) from nagios.alert_history where ORIGINATING_TIMESTAMP \\> trunc\\(systimestamp - 30/\\(24\\*60\\),\\'mi\\'\\) and ORAERROR1 not in \\(select ORAERROR1 from nagios.oraerrwlst\\) - ORA-00911: invalid character (DBD ERROR: error possibly near <*> indicator at char 12 in 'select count<*>\\(\\*\\) from nagios.alert_history where ORIGINATING_TIMESTAMP \\> trunc\\(systimestamp - 30/\\(24\\*60\\),\\'mi\\'\\) and ORAERROR1 not in \\(select ORAERROR1 from nagios.oraerrwlst\\)')
nxi_573_error.png
It seems like we have invalid SQL statement, but the same SQL statement we used on XI 5.5.11 is working.
Is there any possible for this issue as a bug between them?
nagios_core.png
For your information, the version of DB is 11.2.0.4.0 and OS version is CentOS 8.2.

P.S. I would PM profile when any replies available.

Please advise.
Thank you!

Re: Got error with check_oracle_health plugin

Posted: Thu Mar 25, 2021 12:11 pm
by dchurch
Can you try running that command from the command line while SSH-ed into the Nagios XI server?

This is likely due to a known issue in Nagios XI 5.7.3 (fixed in 5.7.5) where the Run Check Command dialog inserted extra escaping where it shouldn't.

See Nagios XI change log:
5.7.5 - 11/12/2020
- Core Config Manager (CCM) - 3.0.8
- - Fixed issue with command escaping in Test Check Command [TPS#15167] -JO
I'd advise upgrading if this is a problem for you, but if that's not possible, I could maybe create a patch to retrofit the fix into your 5.7.3 installation.