Error:

D:\PRTG Network Monitor\custom sensors\EXE\oraclevb3.vbs(14, 1) OraOLEDB: ORA-12154: TNS:could not resolve the connect identifier specified

Script:

Dim strSQL
Dim strUsername
Dim strPassword
Dim snpData
Dim dbMyDBConnection

Set snpData = CreateObject("ADODB.Recordset")
Set dbMyDBConnection = CreateObject("ADODB.Connection")
strUsername = "user"
strPassword = "pass"

dbMyDBConnection.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=MyDB;User ID=" & strUsername & ";Password=" & strPassword & ";"
dbMyDBConnection.Open

strSQL = "select count(*) from requests"

snpData.Open strSQL, dbMyDBConnection

While Not snpData.EOF
    WSCript.Echo snpData.Fields(0).Value & ":ok"
    snpData.MoveNext
Wend

snpData.Close
dbMyDBConnection.Close

Set snpData = Nothing
Set dbMyDBConnection = Nothing

Others:
1. The server has oracle client installed with tnsnames configured to MyDB.
2. Running the script on command line works ok.
EDIT by Paessler: Adjusted formatting.


Article Comments

Attention: This article is a record of a conversation with the Paessler support team. The information in this conversation is not updated to preserve the historical record. As a result, some of the information or recommendations in this conversation might be out of date.

Custom scripts are not supported by the support team here at Paessler. Hopefully someone else in the community will be able to assist you.


Sep, 2014 - Permalink