3
responses

Hello,

I am attempting to use the im_odbc module to gather table data from mssql into nagios log server.

conf snippet

<Input in>

Module im_odbc
ConnectionString DSN=mysql://USERNAME:PASSWORD@IPADDRESS:PORT;database=DATABASENAME;
SQL Select RecordNumber as id, DateOccured as EventTime, data as Message from logtable WHERE RecordNumber > ?
SavePos TRUE
</Input>

 

<Output out>
Module om_tcp
Host IPADDRESS
Port 1337
OutputType Binary
</Output>

 

<Route 1>
Path in => out
</Route>

Error

ERROR im_odbc couldn't connect to the database, IM010:1:0:[Microsoft][ODBC Driver Manager] Data source name too long

 

Please Help!

Thanks 

GC.

AskedMay 11, 2015 - 9:26pm

Answer (1)

The DSN has mysql in it, typo perhaps?

There is an odbc configuration tool called odbcad32.exe in windows that allows testing DSNs. Make sure to set up your DSN with that first.

Comments (2)

  • ghostcat's picture

    Thanks, I looked into that and configured and tested the data source, i also tried switching to odbc and mssql to declare the driver however the error persists.

     

  • adm's picture
    (NXLog)

    If you look at the example "Reading from an ODBC data source" in the NXLog Reference Manual, the ConnectionString is quite short there. I suspect that the ConnectionString you are trying to use is for a different ODBC driver (hence mysql). See the Microsoft ODBC Data Source Administrator guide for more information about their implemetation.

    The error message comes from the ODBC driver and this falls outside the boundaries of the product. As noted earlier, if you configure the data source and use the DSN it should work.