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

Using trace route script shows hop count in PRTG monitor

Votes:

0

Hi Guys According to this article https://kb.paessler.com/en/topic/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.

exe hop-count script trace-route

Created on Jul 23, 2022 12:13:23 PM



3 Replies

Votes:

0

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

Created on Jul 29, 2022 8:59:06 AM by  Chan Siau Hen [Paessler Technical Support]



Votes:

0

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!

Created on Aug 2, 2022 8:04:06 AM

Last change on Aug 2, 2022 9:51:58 AM by  Felix Wiesneth [Paessler Support]



Votes:

0

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 [email protected]? Please put PAE2308683 as the email subject.

Thanks!


With kind regards,
Chan Siau Hen
Technical Support Team, Paessler AG

Created on Aug 15, 2022 1:57:25 AM by  Chan Siau Hen [Paessler Technical 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.