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

Custom EXE - Powershell: get IP/DNS

Votes:

0

Hi all, I know, this has been already discussed - but I really cannot get it running even after reading everything I could find here.

I have "PSWindowsUpdate PowerShell Module" running on my servers, which is pretty handy to manage all WSUS tasks. And it can be easily used to e.g. check for pending reboots.

My powershell script seems to be running fine:

param(
    [string]$hostip = "default"
)
$pendingboot = Get-WURebootStatus -ComputerName $hostip -silent
$value = switch($pendingboot){"True" {1}; "False" {0}}
if ($value -eq 1){
    Write-Output "$($value):reboot pending"
}else{
    Write-Output "$($value):no reboot required"
}

I can confirm valid output if I run it manually on PRTG Probe "PRTGSRV"

PS C:\Users\Administrator> Get-WURebootStatus -ComputerName SERVER01 -silent
True                                                        
PS C:\Users\Administrator> Get-WURebootStatus -ComputerName PRTGSRV -silent
False

However, when I add the Custom EXE sensor to SERVER01, it will always report "false/no reboot required". Parameters are -hostip '%host'

SERVER01: srv2016 PRTGSRV_ srv2019 both have Powershell 5.1 and PSWindowsUpdate Module installed. PRTG Version is 23.1.82.2175+

Any Ideas, how to get this running?

custom-sensor parameters powershell

Created on Mar 29, 2023 4:01:27 PM

Last change on Mar 31, 2023 1:56:22 PM by  Felix Wiesneth [Paessler Support]



1 Reply

Votes:

0

Hello
Please open a ticket with us here:

So that we can take a closer look here.
https://www.paessler.com/contact

Created on Apr 7, 2023 5:04:15 PM by  Luis Quesada (Paessler Technical 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.