New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


How could I monitor powershell based command including folder with file copy time by PRTG

Votes:

0

Your Vote:

Up

Down

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

api copy custom custom-script-exe custom-sensor powershell prtg

Created on Jul 17, 2015 2:57:54 AM by  kelvin_xue (0) 1

Last change on Jul 17, 2015 9:23:08 AM by  Luciano Lingnau [Paessler Support]



1 Reply

Votes:

0

Your Vote:

Up

Down

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,

Created on Jul 17, 2015 9:22:27 AM by  Luciano Lingnau [Paessler Support]

Last change on Jul 24, 2018 7:36:12 AM by  Brandy Greger [Paessler Support]



Please log in or register to enter your reply.


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.