lordmilko / PrtgAPI

C#/PowerShell interface for PRTG Network Monitor
MIT License
301 stars 37 forks source link

Wait longer for New-SensorParam #277

Closed schoenm1 closed 2 years ago

schoenm1 commented 2 years ago

What's going on?

I have some slow SNMP Devices. When I try $temp = $device | New-SensorParameters -RawType snmplibrary -qt "*HUAWEI-SYS-MAN-MIB*" -Target * I will get an error

$temp = $device | New-SensorParameters -RawType snmplibrary -qt "*HUAWEI-SYS-MAN-MIB*" -Target *
New-SensorParameters : Failed to retrieve sensor information within a reasonable period of time. Check target device is accessible and that valid credentials have been supplied.
At line:1 char:19
\+ ... = $device | New-SensorParameters -RawType snmplibrary -qt "*HUAWEI-SY ...
    \+ CategoryInfo          : NotSpecified: (:) [New-SensorParameters], TimeoutException
    \+ FullyQualifiedErrorId : System.TimeoutException,PrtgAPI.PowerShell.Cmdlets.NewSensorParametersCommand```

I tried:

but with no success. Is there a possiblity to wait longer for a reply? If I do this in GUI, it will take a long time, but after the sensor will be displayed. thanks

Due Dilligance

lordmilko commented 2 years ago

You can specify a -Timeout (in seconds)

schoenm1 commented 2 years ago

Perfect!