Hi All This is a freshman of a PRTG user. I have a question on how to using PRTG monitor file copy time Bellowing is the command that I using for the copy time calculate.

$time=Measure-Command -Expression {Copy-Item C:\test\* \\njgcm02\WSUSTemp -Recurse -Force -Confirm:$False}
write-host $time

That always returned the time like the result below:

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE\copyfile.ps1
00:00:10.5960964

You could see that the time takes around 10s.

However, it shown the time result alwasy in Last Message rather than listed in graph when I set the related script into the Custom EXE/Script Sensor.

Is there anyone could help me on how to define the copy time that could be shown in the graph by either Custom EXE/Script Sensor or Custom advanced EXE/Script Sensor.

Thanks


Article Comments

Hello.

Please note that for EXE/Script Sensors PRTG expects the following script output format:

value:message

The EXE/Script Advanced Sensor on the other hand, expects the following output:

<prtg>
<result>
<channel>First channel</channel>
<value>10</value>
</result>
</prtg>

Since you're using the EXE/Script Sensor, PRTG is interpreting the first "00" as the sensor value and the rest "00:10.5960964" as the sensor's message, that's why it is not graphed but only displayed as a message.

You must process the value prior to it's output, in your example you can try using $time.Seconds instead, as it would result in "10" instead of "00:00:10.5960964"

For more details, please check the API's documentation here.

Best regards,


Jul, 2015 - Permalink