<br><br><div class="gmail_quote">On Wed, Nov 16, 2011 at 8:32 PM, Tim Dunphy <span dir="ltr"><<a href="mailto:bluethundr@jokefire.com">bluethundr@jokefire.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
hello,<br>
<br>
I am attempting to using one of many checks that are designed to check oracle db. I chose this one because it seemed pretty flexible as you are able to feed some SQL statements into it with a flag.<br>
<br>
Here's the page for the plugin I am trying to use:<br>
<br>
<a href="http://exchange.nagios.org/directory/Plugins/Databases/Oracle/check_db/details" target="_blank">http://exchange.nagios.org/directory/Plugins/Databases/Oracle/check_db/details</a><br>
<br>
<br>
I was able to get the check to work in 'usage' mode where it prints out it's help page. But when I actually go to run the check this is the error that I see:<br>
<br>
<br>
[root@db07-dc2:/opt/nagios/libexec] $./check_db -H qaecom1-db-lh -p 1521 -s qaecom1 -l user -x secret -f /u01/app/oracle/sql/test.sql -r 'test' -w 15 -c 25 -L THRESHOLD<br>
java.sql.SQLException: ORA-00933: SQL command not properly ended<br>
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)<br>
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)<br>
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:590)<br>
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1973)<br>
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:850)<br>
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2599)<br>
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2963)<br>
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:653)<br>
at DbCheck.testSS(DbCheck.java:158)<br>
at DbCheck.main(DbCheck.java:140)<br>
<br>
<br>
The error appears to be that the SQL I am giving it is not terminated correctly. Here's the contents of that SQL file I'm giving it:<br>
<br>
<br>
root@db07-dc2:/opt/nagios/libexec] $cat /u01/app/oracle/sql/test.sql<br>
select DISTINCT<br>
USERNAME||'|'||<br>
STATUS||'|'||<br>
OSUSER||'|'||<br>
MACHINE||'|'||<br>
PROGRAM||'|'||<br>
SQL_HASH_VALUE||'|'||<br>
to_char(LOGON_TIME,'DD-MON-YYYY HH24:MI:SS')||'|'||<br>
substr(sql_text,1,128)||'|'<br>
from v$session a,v$sql b<br>
where status ='ACTIVE'<br>
and username is not null<br>
and a.sql_hash_value = b.hash_value(+)<br>
and<br>
(select nvl((<br>
select count(1) from v$session where status ='ACTIVE'<br>
and username is not null<br>
group by status<br>
having count(1) > 0),0) from dual) > 25 /* threshold count goes here */<br>
order by 1<br>
<br>
<br>
<br>
I guess what's most confusing about this is that if I go into sqlplus and open the file it does return a result:<br>
<br>
<br>
SQL> @sql/test.sql<br>
21<br>
<br>
This shows the number of connections to the database.<br>
<br>
<br>
I'd appreciate any advice you might have on how to get this check beyond this point.<br>
<br>
thanks<br>
tim<br>
<br>
I note you are running the check as root, try running it as the oracle user instead (eg it could be an environmental issue)<br clear="all"></blockquote><div><br>Ritchie <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
--<br><-- <a href="http://23.me.uk/2" target="_blank">http://23.me.uk/2</a> --><br><--Time flies like an arrow; fruit flies like a banana. --><br>
<br>
------------------------------------------------------------------------------<br>
All the data continuously generated in your IT infrastructure<br>
contains a definitive record of customers, application performance,<br>
security threats, fraudulent activity, and more. Splunk takes this<br>
data and makes sense of it. IT sense. And common sense.<br>
<a href="http://p.sf.net/sfu/splunk-novd2d" target="_blank">http://p.sf.net/sfu/splunk-novd2d</a><br>
_______________________________________________<br>
Nagiosplug-help mailing list<br>
<a href="mailto:Nagiosplug-help@lists.sourceforge.net">Nagiosplug-help@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagiosplug-help" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagiosplug-help</a><br>
::: Please include plugins version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</blockquote></div><br>