What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

MS SQL V2: Diagnosing "Can not log in using the specified credentials!"

Votes:

0

The server is MS SQL 2014 with SSL enabled/enforced

I have verified the credentials are correct. Using Windows authentication. I tried all three encryption settings (server default, force with no chain of trust, force with chain of trust) I can log in with other tools (linqpad, ssms...)

Is there a log somewhere with an error code to find out why it failed to log in?

prtg sensor sql-v2

Created on Apr 20, 2016 3:07:44 AM



5 Replies

Votes:

0

I am not using a MSSQL-V2-sensor but it might help..

Did you specify the database credentials in the device settings or did you say it have to use Windows authentication? I tried that right now and I can't set both at the same time. Either credentials or Windows authentication. If it is set to Windows authentication I think the sensor is using the account that also runs the PRTG-service on your monitoring-machine.

Could you just check that?

I hope I could help you :)

Created on Apr 20, 2016 11:15:04 AM



Votes:

0

Hello,

Can you confirm that the password do not contain the Special caraters "<" or ">"?

Created on Apr 21, 2016 12:15:55 PM by  [email protected]



Votes:

0

I don't have the special characters in the password. Tried different accounts, too.

Created on Apr 21, 2016 4:28:36 PM



Votes:

0

Hello,

In the sensor settings, please enable the option "Write sensor result to disk" let the sensor run on schedule or force it manually to "check now" and then send us the file to [email protected]. Please refer to this kb post.

Thank you

Created on Apr 26, 2016 7:40:25 AM by  [email protected]



Votes:

0

Danke Jochen fuer den Support :)

The diagnostic data didn't reveal anything new, so I ended up writing my own SQL sensor. This uses the MS SQL client libraries (it requres Sql Managment Objects (SMO) installed on the probe, a free download from Microsoft)

Script goes into CustomSensors\EXE To make use of it, write a query that returns a single integer indicating error count. Mine often look like

Query.sql SELECT COUNT(1) FROM Log WHERE Level = 'Error'

Put this in a file on its own and put that file into CustomSensors\EXE as well.

Then, create a new EXE sensor Sql.ps1 as the custom exe <ServerName> <Scriptname> as arguments

Sql.ps1

[CmdletBinding()]
Param(
   [Parameter(Mandatory=$True, Position=1)]
   [string] $Server,
    
   [Parameter(Mandatory=$True, Position=2)]
   [string] $QueryFile
)

Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

# If we don't have a fully qualified path, look in the script folder for the query file
if (!(Test-Path $QueryFile))
{
    $ScriptPath = Split-Path -Parent $PSCommandPath
    $QueryFile = Join-Path $ScriptPath $QueryFile
}

$Query = Get-Content $QueryFile
$ConnectionString = "Data Source=$Server; Integrated Security=SSPI"

$Conn = New-Object System.Data.SqlClient.SqlConnection($ConnectionString)
$Conn.Open()
$Command = $Conn.CreateCommand()
$Command.CommandText = $Query
$Result = $Command.ExecuteScalar()

if ($Result -gt 0)
{
  Write-Host "$($Result):Error"
  exit 1
}

Write-Host "$($Result):Ok"
exit 0

Created on May 4, 2016 5:06:07 PM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.