New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


tns could not resolve when using vbs script with oracle connector

Votes:

0

Your Vote:

Up

Down

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.

oracle sensor vbs

Created on Sep 1, 2014 2:42:10 AM by  dur dub (0) 1

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



1 Reply

Votes:

0

Your Vote:

Up

Down

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]



Please log in or register to enter your reply.


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.