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

Integrate PRTG

Votes:

0

Hi, I am integrating prtg with salesforce. I installed localhost prtg. i am trying
"http://127.0.0.1/api/table.xml?content=sensors&columns=sensor&username=prtgadmin&password=xxxx"
and
"http://127.0.0.1//api/getsensordetails.xml?id=1002"
api on postman. this url is working on postman but not in class, it is giving me error as status code=403, forbidden . Not getting what is going wrong, do i have to mention somewhere in prtg about salesforce.

Please help..!!

api prtg salesforce

Created on Dec 18, 2018 12:10:31 PM

Last change on Dec 18, 2018 1:53:05 PM by  Dariusz Gorka [Paessler Support]



14 Replies

Votes:

0

Hi there,

The error 403 means that you are not authenticated and that you are not allowed to open that page. Please make sure that you either add:

username=USER&password=PASSWORD

or

username=USER&passhash=PASSHASH

To the URL so the call is authenticated. The first request should work, when the password is correct.

What do you get in a browser in a private tab?

Best regards.

Created on Dec 18, 2018 1:54:37 PM by  Dariusz Gorka [Paessler Support]



Votes:

0

i am using same combination of URL. i installed prtg in desktop with server as localhost. prtg is not getting opened in private browser it is opening in chrome. The same url is working in postman api app. it is giving me 200 response but when i call it from class it is giving 403 forbidden reply...

Created on Dec 19, 2018 5:29:55 AM



Votes:

0

Hi there,

The question is what result do you get with the very same URL in a browser (when you are not logged in) in class?

If I understood you correctly, you use a different PRTG installation locally and in class, please check if the password or passhash maybe different between these installations.

Best regards.

Created on Dec 19, 2018 6:56:58 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

when i put this url in browser and press enter .. it creates a xml file with proper response

Created on Dec 19, 2018 7:02:35 AM



Votes:

0

Hi there,

Where exactly do you get the 403 error? Within a script?

Best regards.

Created on Dec 19, 2018 7:19:39 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

following is my apex class..

public String baseUrl = 'https://127.0.0.1/api/table.xml?content=sensors&columns=sensor&username=prtgadmin&password=Pune@123'; // Base URL of your JIRA instance
public void PRTGIntegration1(){   
HttpRequest req = new HttpRequest();
Http http = new Http();
Blob headerValue = Blob.valueOf(username+':'+password);
req.setHeader('Authorization','Basic '+ EncodingUtil.base64Encode(headerValue));
req.setMethod('GET');
req.setEndpoint(baseUrl);
        
    try{
            //Execute web service call here      
    HTTPResponse res = http.send(req);  ///GETTING ERROR AFTER THIS CALLOUT
    String ResponseJsonString = res.getStatus();    
    system.debug('ResponseJsonString ======>'+ResponseJsonString );

Created on Dec 19, 2018 7:22:48 AM

Last change on Dec 19, 2018 7:30:26 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi there,

Any reason you send a "Basic Authentication"-Header?

Also please try to use the passhash of that user instead to avoid issues with the special-chars in the password. You can get the passhash from under "Setup > Account Settings > My Account" by clicking the "Show Passhash"-button.

Best regards.

Created on Dec 19, 2018 7:31:37 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

i passhash url.. still the same error status code.

do we have to put something in PRTG network monitor tool regarding who wants to communicate with PRTG.

do i have to mention salesforce url anywhere in PRTG or is there in connected app concept in PRTG

Created on Dec 19, 2018 7:42:10 AM



Votes:

0

Hi there,

What do you get within PowerShell?

Invoke-WebRequest -uri "https://127.0.0.1/api/table.xml?content=sensors&columns=sensor&username=prtgadmin&password=Pune@123"

Also where do you execute this class? On the same server/computer where PRTG is installed on?

Best regards.

Created on Dec 19, 2018 7:51:02 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

I havenot tried with powershell.

salesforce in cloud based.. so call will be going through cloud to PRTG installed in my machine

Created on Dec 19, 2018 8:23:56 AM



Votes:

0

Hi there,

So you try to reach "https://127.0.0.1/api/table.xml...." from the Cloud? Correct? How should that work? You need to enter the correct IP-Address under what you can reach the PRTG Server externally. Otherwise Salesforce might not be able to connect.

Best regards.

Created on Dec 19, 2018 8:30:00 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

thanks for suggestion i am looking integration with external IP. hi just a doubt, where to find server name of prtg i installed in my machine? why is 127.0.0.1 is appearing in url ? i searched for PRTG help video where there is no 127.0.0.1 in there url, some domain name is mentioned? how can i find domain name?

Created on Dec 19, 2018 11:47:23 AM



Votes:

0

hi i am trying with external IP,

Just have doubt why is 127.0.0.1 is there in url. there can not be any domain name? I watched some prtg video where there is no 127.0.0.1 like address there are name like https://demoorg/wel...

How to find server name in PRTG?

Created on Dec 19, 2018 12:30:12 PM



Votes:

0

Hi there,

The IP "127.0.0.1" translates to "localhost" and will only work on the Core Server itself. On any other device or server you won't reach the PRTG Webinterface via this URL. There you need to enter the correct IP address, FQDN or Hostname.

Best regards.

Created on Dec 19, 2018 7:51:31 PM by  Dariusz Gorka [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.