Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netappcdotio Sensor param timeout #305

Open
schoenm1 opened this issue Sep 15, 2022 · 4 comments
Open

netappcdotio Sensor param timeout #305

schoenm1 opened this issue Sep 15, 2022 · 4 comments
Labels
alleged-bug Bugs raised by people helpfully using the Bug Report template!

Comments

@schoenm1
Copy link

Describe the bug

It is not possible to add a new Sensor 'netappcdotio' with mandatory parameters.
If param 'timout' is not given for 'New-sensorParemters' , I see following error:
New-SensorParameters : Failed to process request for sensor type 'netappcdotio': sensor query target parameters did not include mandatory parameter 'timeout_'.
It 'timeout' parameter ist given, 'New-sensorParemters' is working, but not the 'Add-Sensor'.
Do I have to add 'timeout' param as -RawProperty and -RawValue?
Not really sure if this is a bug...

Steps to reproduce

missing 'timeout' param -> not possible for New-SensorParameter
----------------------------------------------------------------
$device = Get-Device -id 49472
PS C:\Users\micha.schoenenberger> $device | New-SensorParameters -RawType netappcdotio -qp @{defaultlogin_="1";user_="";password_="";port_="443";;transporttype_="1"}
New-SensorParameters : Failed to process request for sensor type 'netappcdotio': sensor query target parameters did not include mandatory parameter 'timeout_'.
At line:1 char:11
+ $device | New-SensorParameters -RawType netappcdotio -qp @{defaultlog ...
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-SensorParameters], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,PrtgAPI.PowerShell.Cmdlets.NewSensorParametersCommand

'timeout' param given -> possible for New-SensorParameter, but not for Add-Sensor
-----------------------------------------------------------------------------------
$device = Get-Device -id 49472
$sensor = $device | New-SensorParameters -RawType netappcdotio -qp @{defaultlogin_="1";user_="";password_="";port_="443";timeout_="60";transporttype_="1"}
-> 'timout' param given, but no visible in $sensor
$sensor

defaultlogin        : 1
user                :
password            :
port                : 443
transporttype       : 1
cdotnodename        : 1
cdotnodename__check : Node01
anti-csrf-token     : ******
Targets             : {[cdotnodename__check, PrtgAPI.Targets.GenericSensorTarget[]]}
Source              : Netapp - Test mischoe
SensorType          : netappcdotio
Priority            : Three
InheritTriggers     : True
InheritInterval     : True
Interval            : 00:01:00
IntervalErrorMode   : OneWarningThenDown
DynamicType         : False
Name                : NetApp I/O
Tags                : {netapp, cdot, ontap, soap}
Cookie              : False

$device | Add-Sensor $sensor
Add-Sensor : Failed to process request for sensor type 'netappcdotio': sensor query target parameters did not include mandatory parameter 'timeout_'.
At line:1 char:11
+ $device | Add-Sensor $sensor
+           ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-Sensor], InvalidOperationException
    + FullyQualifiedErrorId : System.InvalidOperationException,PrtgAPI.PowerShell.Cmdlets.AddSensor

What is the output of 'Get-PrtgClient -Diagnostic'?

PSVersion      : 5.1.17763.2931
PSEdition      : Desktop
OS             : Microsoft Windows 10 Enterprise LTSC
PrtgAPIVersion : 0.9.17
Culture        : de-CH
CLRVersion     : .NET Framework 4.8 (528049)
PrtgVersion    : 22.3.78.1873
PrtgLanguage   : english.lng

Additional context

No response

@schoenm1 schoenm1 added the alleged-bug Bugs raised by people helpfully using the Bug Report template! label Sep 15, 2022
@lordmilko
Copy link
Owner

I believe normally the response returned from PRTG will contain any properties required to create the object (including any sensor query parameters you may have specified). Otherwise, you'd expect it to fail when PRTG tries to add the sensor itself

Can you try Unlock the parameters, add the missing parameter and see if it works then?

@schoenm1
Copy link
Author

Hi @lordmilko
This one is working

$device | New-SensorParameters -RawType netappcdotio -qp @{defaultlogin_="1";user_="";password_="";port_="443";timeout_="60";transporttype_="1"} -Target *
$sensor.unlock()
$sensor.timeout_="60"
$device | Add-Sensor $sensor

So this is a PRTG 'issue', that the param timout is not in the return value and must be added manually again with the unlock()?

@lordmilko
Copy link
Owner

Based on a quick perusal of the PrtgAPI source code I don't see anywhere where I would be manually adding in the sensor query parameters, however I'll have to check with another sensor type to see how it normally works. In the meantime, the above is certainly a workaround you can use for now

@schoenm1
Copy link
Author

Thanks for you really fast reply! Yes, I can use this workaround.
The netapp sensor are the first one I see where the question for credential are mandatory asked for in PRTG UI.
I tested with netappcdotio + netappcdotaggr. For both 'timeout' is required for 'New-SensorParameters', but not set in return value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alleged-bug Bugs raised by people helpfully using the Bug Report template!
Projects
None yet
Development

No branches or pull requests

2 participants