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

tns could not resolve when using vbs script with oracle connector




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


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 & ";"

strSQL = "select count(*) from requests"

snpData.Open strSQL, dbMyDBConnection

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


Set snpData = Nothing
Set dbMyDBConnection = Nothing

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.

oracle sensor vbs

Created on Sep 1, 2014 2:42:10 AM

Last change on Sep 2, 2014 11:18:59 AM by  Konstantin Wolff [Paessler Support]

1 Reply



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

Created on Sep 3, 2014 12:02:09 PM by  Greg Campion [Paessler Support]

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.