ndo2db oracle development

Andreas Ericsson ae at op5.se
Thu Nov 22 11:28:09 CET 2007


David Schmidt wrote:
> Hello,
> 
> Well, I was trying to mail Nathan directly via his website contact
> form but upon submitting an error occurred > "You don't have
> permission to access /contact/query.php on this server."
> I am subscribed to the nagios-devel mailinglist because I read that
> ndo2db is about to become a part of the nagios core. If I am wrong
> here I sincerily apologize.
> 

ndo2db is not to become a part of the nagios core. Support for loading
dso's was added into the nagios core explicitly to *avoid* having to
support everything in-core.

That being said, Ethan is promoting ndoutils as the standard way of
getting log-data into databases, but it has some performance issues.

> I am working at the university of vienna and we heavily use Nagios for
> server monitoring.
> Recently I have been assigned the task to enhance ndo2db to support
> oracle databases.
> 

I think you'd be better off rewriting it as an entirely new NEB-module.
It's not that hard to do, really.

> I reached a point where I have to change code outside of "#ifdef
> USE_ORACLE" blocks and would like to ask for your opinion on how to
> format things.
> 
> The problem I am having is that certain SQL statements uses are not
> ORACLE compatible.
> 
> e.g.:
> MySQL >> INSERT INTO TBL_NAME SET col1=val1, col2=val2, ...
> This statement is not understood by Oracle which only accepts INSERT
> statements of the form >> INSERT INTO TBL_NAME (col1, col2, ...)
> VALUES (val1, val2, ...)
> 

Rewrite these in the form Oracle supports. It's ANSI SQL and should
work everywhere. Make sure it doesn't break anything and submit a patch
for that separately. I'll review it and comment on it.

> Another thing would be the numerous "INSERT ... ON DUPLICATE KEY ..."
> statements beeing used in ndo2db. This kind of statement can not be
> used by ORACLE Databases and has to be rewritten using the SQL "MERGE
> INTO" Statement.
> 

Is MERGE INTO ANSI SQL? If not, you'd better do some #ifdef hackery.

> Do you have any idea in mind how to simplify porting of such databases
> specific statements? Because I would really like to see my changes
> become part of the ndo2db source and I suppose chances increase if you
> are kind of supervising critical design steps.
> 

In short, if you change things to be more portable but still work exactly
the same as they do today when used with MySQL for backend, those patches
stand on their own and should be applied to the ndoutils source. Patches
that are purely for adding support for a different database backend will
be reviewed after the fact.

On a side-note, you might be better off trying to use libdbi for talking
to the backend and let the user pick which engine to use.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/




More information about the Developers mailing list