Update: As of PRTG version 16.3.26, you can create public maps with disabled links by using the maps settings.
- In the PRTG web interface, open the Settings tab of the desired map.
- Navigate to section Public Access.
- Choose the option Allow public access, disable all links (map can be viewed by using a unique URL).
- Save the settings and the map will be a non-interactive public map.
For details please see PRTG Manual: Maps Settings—Settings: Public Access.
This article applies to PRTG Network Monitor 12 through 16.3.25
Disabling Links in Public Maps
Important note: As of PRTG version 16.3.26, you can use the settings of a public map to disable its links. Please see above. |
The PRTG API can help you with this (requires PRTG 8).
Find the file scripts_custom.js in the \webroot\javascript subfolder of your PRTG installation and open it with a text editor. (Note: In versions previous to PRTG 13.2.3, the target file is customerscripts.js in \website\javascript.)
Paste the following code into the file:
$(document).ready(function() {
if ($("body.publicmapshow").length>0) // check: is this a mapshow page
{
$("a").attr("href", "#").attr("onclick", "return false;");; // disable all links on page, they still look like links
//OR
//$("a").each(function(){$(this).replaceWith($(this).text())}); //replaces all links with just their text
}
});
For previous PRTG versions (Deprecated)
$(document).ready(function()
{
if ($("#maprefreshlink").length>0) // check: is this a mapshow page
{
$("a").attr("href", "#"); // disable all links on page, they still look like links
// OR
// $("a").each(function(){$(this).replaceWith($(this).text())}); //replaces all links with just their text
}
});
The code is run everytime a PRTG page is loaded. It checks if the page is displaying a map and then iterates through all <a> tags and overwrites their HREF properties with a "#" to invalidate the links.
If you use a PRTG version newer than V8.4.x, please apply the following patch to the file prtg.js:
$(function() {
$(".sensorgraph").attr("onclick", "");
$("#showamap").delegate("a", "click", function(e) {
e.preventDefault();
});
});
If you use a PRTG version 13.4.x.x or newer, please apply the following patch to the file scripts_custom.js:
$(function(){
$("body.publicmapshow").on('click','a',function(){return false;});
});
Note: If you use a PRTG version previous to V8.1.0.1678 you must either update or apply the following patch to the file "prtg.js":
Remove this line (2nd last line of the file)
<#comment Include customer's own Javascript>
Add comment