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

How can I use my vbscript with the PRTG API?

Votes:

0

I am trying to get xml data from the api via vbscript on Windows 2000.

My simple VB script :

URL = "http://prtgserver1/api/table.xml?content=sensors&columns=sensor&username=xx&password=xx"

' {note : xx replaced with a real username/password}

Set WshShell = WScript.CreateObject("WScript.Shell")

Set http = CreateObject("Microsoft.XmlHttp")
'http.setoption 2,13056
http.open "GET", URL, FALSE
http.send ""
WScript.Echo http.responseText

set WshShell = nothing
set http = nothing

This returns the error: 0x800C000E

In researching this error, it appears to be related to the security certificate not being trusted. Any idea how to work around this in vbscript?

api vb xml

Created on Nov 22, 2010 9:50:54 PM

Last change on Nov 23, 2010 4:07:34 PM by  Daniel Zobel [Product Manager]



1 Reply

Accepted Answer

Votes:

0

In case this helps someone else in the future, I managed to find something that works:

URL = "http://prtgserver1/api/table.xml?content=sensors&columns=sensor&username=xx&password=xx"

' {note : xx replaced with a real username/password}

Set WshShell = WScript.CreateObject("WScript.Shell")

Set http = CreateObject("msxml2.serverXmlHttp")
http.open "GET", URL, FALSE
http.setoption 2,13056
http.send ""
WScript.Echo http.responseText

set WshShell = nothing
set http = nothing

13056 =  SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS

PS : I'm not a strong VB coder. Your mileage may vary. :)

Created on Nov 23, 2010 4:39:02 PM

Last change on Nov 26, 2010 1:11:16 PM by  Daniel Zobel [Product Manager]




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.