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

Issue with PS script

Votes:

0

Hi,

I have an issue with my powershell sensor

$found=Get-Process -ComputerName "srv-bi-01" | WHERE {$_.ProcessName -eq "svchost"}
Write-Host "<prtg>"
Write-Host "<result>" 
"<channel>svchost UP</channel>" 
    
"<value>"+ @($found).Count +"</value>" 
"</result>"
"<text></text>"
Write-Host "</prtg>"

This count 0 (and its not true)

And when I remove -ComputerName "srv-bi-01" it count correctly (but on the wrong computer obviously)

When I test my script outside of PRTG it work fine

issue powershell prtg

Created on Aug 12, 2022 1:49:18 PM



2 Replies

Accepted Answer

Votes:

1

Hello,
a few things you could check:

1) Did you use the 32 bit Powershell while testing the script manually? As PRTG is using the 32 bit Powershell

2) Did you select "Use Windows credentials of parent device" as "Security Context" within the sensor settings?

3) There are sensor log files which might give you further hints. For this you can go to the settings of the sensor and activate the "Store Result" option. Log files are then stored at "C:\ProgramData\Paessler\PRTG Network Monitor\Logs\sensors" on the system of the probe.

Created on Aug 17, 2022 8:00:31 AM by  Timo Dambach [Paessler Support]



Votes:

0

Hi,

It was the 2 point, tx a lot

Created on Aug 18, 2022 7:03:12 AM




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.