Page 8 of 9
Re: MSSQL using NSClient++
Posted: Mon Jul 08, 2013 3:23 pm
by abrist
ofadl wrote:[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect
ODBC is still not finding the Driver line in the ini file.
Re: MSSQL using NSClient++
Posted: Mon Jul 08, 2013 3:51 pm
by ofadl
hmm any idea of what to do next?
Re: MSSQL using NSClient++
Posted: Mon Jul 08, 2013 4:36 pm
by abrist
Well, not really Lets check the linking on your driver:
Re: MSSQL using NSClient++
Posted: Tue Jul 09, 2013 8:55 am
by ofadl
ok so that file is located in here:
/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
and i ran:
ldd /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
and got this as a result:
linux-vdso.so.1 => (0x00007fff64fec000)
libodbcinst.so.1 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.1 (0x00007f 525ff1f000)
libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00007f52 5fc63000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f525fa5a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f525f83 d000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f525f47e000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f525f2730 00)
libtasn1.so.3 => /usr/lib/x86_64-linux-gnu/libtasn1.so.3 (0x00007f525f06 2000)
libgcrypt.so.11 => /lib/x86_64-linux-gnu/libgcrypt.so.11 (0x00007f525ede 4000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f525ebcc000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f52 5e9ba000)
/lib64/ld-linux-x86-64.so.2 (0x00007f526039d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f525e7b6000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f52 5e5b1000)
Re: MSSQL using NSClient++
Posted: Tue Jul 09, 2013 12:59 pm
by abrist
ofadl wrote:ok so that file is located in here:
/usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Change the paths in the file /usr/local/etc/odbcinst.ini to match the above path. Additionally, change the path for /usr/lib/odbc/libtdsS.so to where ever your is as well.
Re: MSSQL using NSClient++
Posted: Wed Jul 10, 2013 8:52 am
by ofadl
ok, so i just figured out i have TWO odbcinst.ini files:
/etc/odbcinst.ini
/usr/share/tdsodbc/odbcinst.ini
In which i have this step:
Then, finally, set up the DSN within ODBC in the odbc.ini file here
/usr/local/etc/odbc.ini
By adding this bit to the file:
[MSSQL]
Description = MS SQL Server
Driver = /usr/local/lib/libtdsodbc.so
Server = 192.168.2.3
UID = devuser
PWD = devpass
ReadOnly = No
Port = 1433
set up in :
/usr/share/tdsodbc/odbcinst.ini
which looks like :
[FreeTDS]
Description = TDS driver (Sybase/MS SQL)
Driver = libtdsodbc.so
Setup = libtdsS.so
CPTimeout =
CPReuse =
[FreeTDS]
Description = FreeTDS driver
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup=/usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
FileUsage = 1
UsageCount = 1
Re: MSSQL using NSClient++
Posted: Wed Jul 10, 2013 10:14 am
by ofadl
woops, my mistake, i didint do the last step of the guide. Its working fine and connecting now. Any ideas on how to set up a check/command for this?
Re: MSSQL using NSClient++
Posted: Wed Jul 10, 2013 10:28 am
by sreinhardt
Have you gone back to attempting the commands from before, I thought we had already been testing a plugin and command?
Re: MSSQL using NSClient++
Posted: Wed Jul 10, 2013 10:38 am
by ofadl
i have not, i just followed this guide thoroughly and now i can connect to the database. I am not sure about what check command to define, dont want to get more lost
Re: MSSQL using NSClient++
Posted: Wed Jul 10, 2013 10:57 am
by slansing
The -h function of most nagios plugins can be very helpful and will show you how to format your command, to view the help section run the plugin with a -h after the scripts name:
Code: Select all
/usr/local/nagios/libexec/check_pluginname -h
If you share the output we can help as best as we can from here.