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


Article Comments

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.


Aug, 2022 - Permalink

Hi,

It was the 2 point, tx a lot


Aug, 2022 - Permalink