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

Send ps script respons to prtg



How do i get the respons back to prtg to set the monitor to red if the valviu is "Files are different" and to grren when the valviu is "Files are the same"

$SourceDocs = Get-ChildItem –Path C:\Temp\EXE\am0ytil.exe | foreach {Get-FileHash –Path $_.FullName} $DestDocs = Get-ChildItem –Path C:\Temp\EXE1\am0ytil.exe | foreach {Get-FileHash –Path $_.FullName}

if(compare-object ($SourceDocs.Hash) ($DestDocs.Hash)){ Write-Host 'Files are different "2"' -fore red }else{ Write-Host 'Files are the same "0"' -fore green }

custom-sensor powershell prtg

Created on May 22, 2019 12:33:31 PM

1 Reply



Hi there,

The output must match the format that PRTG expects.
Just to check, did you already review PRTG's File sensor which might suit your requirements here as well?

Best regards,

Created on May 24, 2019 10:51:48 AM by  Sebastian Kniege [Paessler 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.