Hi Guys According to this article https://helpdesk.paessler.com/en/support/solutions/articles/62199-how-can-i-use-prtg-to-trace-the-route-to-a-target , I put the powershell script on remote probe , but when I create the sensor , it shows the error message ?System Error Code : PE022?, I have no idea about the error. Below is my EXE sensor setting :
?Parameters : my server host name ( like myhost.com.tw)?
?Environment : default enviroment?
?security Context : use security context of PRTG probe service?
?Mutex Name : empty ?
?Timeout : 60 seconds ?
?value Type : Integer ?
?If Value Changes : Ignore?
?Result Handling : Discard?
I want to use this exe script sensor to monitor specified server , when the server has some loading issue , I want to know the trace route value of the hops , so I can determine the loading issue is on router or firewall or server.
Article Comments
Dear Siau Hen,
Thanks your reply , I run the script manually in PowerShell
param(
[string]$target
)
$trace=tnc $target -TraceRoute
$count=[string]$trace.TraceRoute.Count
foreach ($ip in $trace.TraceRoute) {
$result=$result+$ip+" > "
}
$result=$result.Substring(0,$result.Length-3)
$message=$count+" hops to reach "+$target+" via "+$result
write-host $count":"$message
but reports error below
Resolve-DnsName : ???? 'Name' ?????????? Null ??????????? Null ??????,????????????
?? C:\windows\system32\WindowsPowerShell\v1.0\Modules\NetTCPIP\Test-NetConnection.psm1:313 ??:74
+ ... ctionResult.DNSOnlyRecords = @( Resolve-DnsName $ComputerName -DnsOnl ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Resolve-DnsName],ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.DnsClient.Commands.ResolveDnsName
I think this error due to there is no parameter input , so I assign the parameter in the script like below, and marking the variable param with "# "
#param( #[string]$target #) $target="www.google.com.tw" $trace=tnc $target -TraceRoute $count=[string]$trace.TraceRoute.Count foreach ($ip in $trace.TraceRoute) { $result=$result+$ip+" > " } $result=$result.Substring(0,$result.Length-3) $message=$count+" hops to reach "+$target+" via "+$result write-host $count":"$message
It is worked , so I think this problem is PRTG can't send parameter back correctly ,
Any suggestion will be appreciated .
If you have e-mail , I can send more detail information to you , by the way , our PRTG major distributor tells me , this question is out off scope of our maintenance , Oh my god! , dumbfounding!
Aug, 2022 - Permalink
Hi Tenshin,
If you check the settings of the sensor, you may see the Parameter fields there for you to key in.
Paessler indeed doesn't support the script, but we will help our user to solve the issue if it's related to PRTG.
In case you still face an issue, could you please send in your query to support@paessler.com? Please put PAE2308683 as the email subject.
Thanks!
With kind regards,
Chan Siau Hen
Technical Support Team, Paessler AG
Aug, 2022 - Permalink
Hello Tenshin,
Thanks for the KB post.
Can you run the script that the sensor uses, manually in PowerShell and check if you get valid results? Also, please send me the result of the output you get from the script.
With kind regards
Chan Siau Hen
Technical Support Team, Paessler AG
Jul, 2022 - Permalink