Unable to connect to MSSQL using user Macros

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mohan.sharma
Posts: 5
Joined: Thu Jan 02, 2020 3:40 pm

Unable to connect to MSSQL using user Macros

Post by mohan.sharma »

Hi All,

I am getting error when I add service account in user macros.

$USER1$=[DOMAIN\USERNAME]
$USER2$=PASSWROD

When I add new MS SQL server to monitor using user macros 1&2 , it is giving error but when I type domain\username and pass $USER2$ in password it works fine.

Please let me know which format I should pass the service account in user macros.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Unable to connect to MSSQL using user Macros

Post by tgriep »

Couple of things to try.
When using the backslash between the domain and username, it should be escaped so add a second back slash like the example below.

Code: Select all

$USER1$=DOMAIN\\USERNAME
Sometimes, using a forward slash works as well.

Code: Select all

$USER1$=DOMAIN/USERNAME
Be sure to check out our Knowledgebase for helpful articles and solutions!
mohan.sharma
Posts: 5
Joined: Thu Jan 02, 2020 3:40 pm

Re: Unable to connect to MSSQL using user Macros

Post by mohan.sharma »

I am getting below error
(18452, 'Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.DB-Lib error message 20018, severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20002, severity 9:\nAd
mohan.sharma
Posts: 5
Joined: Thu Jan 02, 2020 3:40 pm

Re: Unable to connect to MSSQL using user Macros

Post by mohan.sharma »

All set by using below format

$USER1$='DOMAIN\\USERNAME'
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Unable to connect to MSSQL using user Macros

Post by tgriep »

I was just going to post that but thanks for letting us know that you figured it out.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked