IT Operations Discussions
All the up-time. All the nines.

Connection from SPLUNK to SCCM

dominiqued
Explorer

Hello,

I got the below connection failed message when I’m trying to establish a connection from Splunk server to SCCM database.

jdbc:sqlserver://VITSCCMCB:1433;instanceName=CONFIGMGR;databaseName=CM_UCT;

Please see if there is any firewall blocks or any other settings/permissions to be enabled for the service account.

Splunk server details as below:

Hostname:   lspsplkap16.ad

IP Address: 10.12.173.68

SQL JDBC.png

 The SPLUNK server is in Domain ad, the SCCM Server is in Domain Med which is different...

SCCM Installed:

server SCCM(Test): Java SDK jdk-8u271-windows-x64
JDBC driver is in: 
C:\Program Files\Microsoft JDBC Driver 8.4 for SQL Server\sqljdbc_8.4\enu\mssql-jdbc-8.4.1.jre8.jar
 
Anything else to be loaded, installed? Anything to do with the driver above? load? install?

Thanks,

Dom

0 Karma

dominiqued
Explorer

Hello, 

It seems my issues is because I am using a connection accross domains... 

This test was done within ADTEST domain. I will do a new test across domains AD to ADTEST as SPLUNK has restrictions on the JDBC string when doing a connection across domains. The parameter “integratedSecurity=true” does not work when using “Windows Authentication”. So to continue to use the “Windows Authentication” you need to specify the “domain_name” parameter.

“Windows Authentication” with “Microsoft JDBC Driver for SQL Server” is the recommended solution for a connection to a Windows SQL Server.

How to specify the domain in my statement:

on the url line?

on the connection line?

or both?

Both the account and server are in ADTEST when the SPLUNK server is in AD domain.

Any comment(s),

Thanks,

Dom

0 Karma

dominiqued
Explorer

2020-12-17_12-24-45 VITSCCMCB Driver location.png2020-12-17_12-28-40 VITSCCMCB Java Location.png

0 Karma

dominiqued
Explorer

2020-12-17_8-36-48 SCCM VITSCCMCB 02.png2020-12-17_8-38-23 SCCM VITSCCMCB 03.png2020-12-17_8-39-09 SCCM VITSCCMCB 01.png

0 Karma

scelikok
Champion

@dominiqued,

You may have problem with sql jdbc driver. You must use 4.2 version as stated in the documentation.

https://docs.splunk.com/Documentation/DBX/3.4.1/DeployDBX/Installdatabasedrivers#Install_the_SQL_Ser...

If this does not work you can try with SQL authentication rather than Integrated.

If you need to use Integrated authentication try jTDS driver too. This works better than MS version.

https://docs.splunk.com/Documentation/DBX/3.4.1/DeployDBX/Installdatabasedrivers#Install_the_SQL_Ser... 

 

If this reply helps you, upvote appreciated. 

If this reply helps you an upvote is appreciated.

dominiqued
Explorer

Hello,

Apparently there is an issue with the path...

c:\Program Files\Microsoft JDBC DRIVER 8.4 for SQL Server\sqljdbc_8.4\enu>"c:\Program Files\Java\jdk1.8.0_271\bin\javac.exe" -cp jdbc.java
javac: no source files
Usage: javac <options> <source files>
use -help for a list of possible options

The driver is in C:\Program Files\Microsoft JDBC DRIVER 8.4 for SQL Server\sqljdbc_8.4\enu

Java is in C:\Program Files\Java\jdk1.8.0_271\bin

Anything missing?

Thanks,
Dom

0 Karma

dominiqued
Explorer

Hello,

Some updates:

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class sqljdbc42
{
public static void main(String[] args)
{
Connection connection = null;
try
{
// the sql server driver string
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

// the sql server url
String url = "jdbc:microsoft:sqlserver://VITSCCMCB:1433;InstanceName=Configmgr;DatabaseName=CM_UCT";

// get the sql server database connection
connection = DriverManager.getConnection(url,"svc_ConfigMgr_SQL", "MNdOrQqk6HXef2PagZZe");

// now do whatever you want to do with the connection
// ...

}
catch (ClassNotFoundException e)
{
e.printStackTrace();
System.exit(1);
}
catch (SQLException e)
{
e.printStackTrace();
System.exit(2);
}
}
}

this compile properly with no error anymore...

C:\Program Files\Java\jdk1.8.0_271\bin>javac -cp . "C:\Program Files\Microsoft JDBC Driver 4.2 for SQL Server\sqljdbc_4.2\enu\jre8\sqljdbc42.java"

 C:\Program Files\Java\jdk1.8.0_271\bin>

Next step trying to confirm the connection to the database...

Thanks,

Dom

 

0 Karma