Awesome, thanks Greg. Makes me feel better I'm not the only one.
I'm building out some scripts to help with the installation and management of the remote probes. Just wanted to share what I have so far.
We're currently running version 15.1.15.2022
This script below installs the PRTG remote probe software on the computer the script runs on.
Some things you need:
- PRTG_Remote_Probe_Installer.exe in the same directory as the script.
- Replace <IP> wtih the IP (or DNS name?) of the PRTG server
- The reg key for "Password" needs to be looked up on an existing, working remote probe's registry and applied to this script. The reg password string is your PRTG access key but in a different (dword?) format.
@echo off
"%~dp0PRTG_Remote_Probe_Installer.exe" /SILENT /HIDDEN
net stop PRTGProbeService
reg add "HKLM\SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Probe" /v Server /t REG_SZ /d "<IP>"
reg add "HKLM\SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Probe" /v ServerPort /t REG_SZ /d 23560
reg add "HKLM\SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Probe" /v Password /t REG_DWORD /d <string>
reg add "HKLM\SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Probe" /v Name /t REG_SZ /d %computername%
net start PRTGProbeService
After the program installs you'll need to go into PRTG and approve the remote probe in the GUI. I didn't find any way to approve remote probes in the API unfortunately so that has to be done manually.
After the remote probe is approved, then the next process for me is to run a discovery on the probe to pull in data for CPU, memory and disk size. After that we rename the remote probe from the name "Remote Probe" to the Group name (which we had set to the remote probe's computer name). That makes alerts a little more descriptive. Otherwise alerts com in as "Remote Probe" and you ask yourself, "Which one?" when all your other remote probes are named "Remote Probe".
This uses the PRTG API using Powershell.
Just need to change the <IP> to your PRTG IP/DNS name.
####################### Ignore HTTPS errors ########################
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
######################## Intro ###############################
Write-host @"
**********************************************
* *
* This script issues a 'discover now' to *
* all remote probes named Remote Probe *
* It then renames all remote probes *
* that are named "remote probe" to the *
* actual name of the server the remote *
* remote probe is on. Remote Probe. *
* *
**********************************************
"@
$serverip = <IP>
######################### Password check ################################
$pwd = Read-host "Password for prtgadmin please"
$error.clear()
iwr -Uri "https://$serverip/api/table.xml?&content=devices&output=csvtable&columns=group,objid,device&username=prtgadmin&password=$pwd" | Out-null
if ($error)
{
Write-Host -ForegroundColor yellow "Password/credentials are incorrect. Please enter the correct password"
pause
exit
}
else
{
Write-host -ForegroundColor Green "Password is valid"
}
########################## Display results ################################
$toberenamed = iwr -Uri "https://$serverip/api/table.xml?&content=devices&output=csvtable&columns=group,objid,device&username=prtgadmin&password=$pwd" | Select -expand Content | convertfrom-csv | select group,id,device | where {$_.device -match "Probe Device"}
if ($toberenamed -eq $null)
{
write-host -fore yellow "No remote probes are named Remote Probe. Or there is an error. Try again next time."
read-host "Hit enter to exit"
exit
}
else
{
$toberenamed
write-host -fore yellow "These remote probes will be renamed and discovered."
read-host "Hit enter to continue"
}
############################# Start rename #####################################
iwr -Uri "https://$serverip/api/table.xml?&content=devices&output=csvtable&columns=group,objid,device&username=prtgadmin&password=$pwd" | `
Select -expand Content | convertfrom-csv | select group,id,device | where {$_.device -match "Probe Device"} | `
ForEach {
$id = $_.id
$newname = $_.group
$id
$newname
iwr -Uri "https://$serverip/api/discovernow.htm?id=$id&username=prtgadmin&password=$pwd" | Select -expand Content
iwr -Uri "https://$serverip/api/rename.htm?id=$id&value=$newname&username=prtgadmin&password=$pwd" | Select -expand Content
}
$pwd = $null
This is a very brief description of the process so far, but hope this helps any one that may be in the same situation as us.
Add comment