Discovery pattern connection for MySQL

mehak1890
Tera Expert

Hi All,

I have one query for discovery pattern.

I'm adding one step under pattern for fetching sql data but I'm getting error that 

 

mehak1890_0-1692039770739.png

 

Example: "sqlcmd -U $$username$$ -P $$password$$ -Stcp:" + $computer_system.primaryHostname + "," + $tcp_port + " -Q \"sql query;\""

 

"sqlcmd -U $$username$$ -P $$password$$ -Stcp:" + $computer_system.primaryHostname + "," + $tcp_port + " -Q \"select * from (SELECT @@SERVERNAME FROM sys.availability_groups AS ABC INNER JOIN sys.dm_cluster_states AS RGS) a left join (select @@SERVERNAME s1,cluster_name from sys.dm_cluster) b on a.s1=b.s1;\""

 

Error is : Failed to retrieve remote data: Applicative credentials for CI type cmdb_ci_appl are not defined.

mehak1890_1-1692039829274.png

 

I have added the Applicative credentials and provide sql access server as well. But still I'm getting same error.

 

 

mehak1890_3-1692040021197.png

 

Can anyone help me on below? 

1) is my sql query format is correct?

2) Did i correctly setup the credentials?

3) if yes then why I'm getting this error?

 

Thanks

Mehak

 

 

 

 

4 REPLIES 4

Niklas Peterson
Mega Sage
Mega Sage

Hi @mehak1890 ,

Your error complains about credentials for cmdb_ci_appl but your credentials are for cmdb_ci_db_mssql_instance.

Try to connect your parse operation to the cmdb_ci_mssql_instance ci type. Something like this:

 

operation.png


Regards,
Niklas

Hi Niklas,

I tried this but now I'm getting another error that "msva is not recognised as an internal or external command operable program or batch file"

 

mehak1890_0-1692087751189.png

 

Can you or anyone pls help me?

 

Thanks,

Mehak

 

Hi All, can anyone reply on this? I'm getting this error under pattern that "msva is not recognised as an internal or external command operable program or batch file"

 

Pls help.

 

Thanks

Mehak

Hi,

That looks very strange. Can't say I have any clue on where "MsVa" comes from. My first guess would be that the command string is not built correctly but I can't find any logic in how it would combine those 4 letters into a command.

Can you test with another command string?

Regards,
Niklas