Closed markgu-coast closed 10 months ago
Are you able to open the add sensor page in the PRTG UI for this sensor type, and then (assuming using Google Chrome) press Ctrl+Shift+J to open the inspector. Locate the area on the screen that contains the setting that you would modify that contains integer_type, etc. Then, select this icon
Click on the setting for integer_type. This will bring up the HTML that backs this setting. By comparing this backing value of this setting to the settings next to it, you'll be able to find the value of the other settings too.
I couldn't see this sensor type in my PRTG install (23.4.90.1299+). Please let me know if you have any issues with the above
We have beta sensors enabled, perhaps that's the difference (23.4.90.1299+).
Get-SensorType *"REST Custom V2"*
Id Name Description
-- ---- -----------
paessler.rest.rest_custom_v2_sensor REST Custom v2 (BETA) Monitors JSON or XML REST APIs
Thanks so much for the browser tip, I was quickly able to identify the correct value:
paessler-rest-channel_section-channel_group-channel1_type : string_as_state_type
Sensor now created exactly as required.
Sincere thanks again!
What's going on?
I'm creating a new sensor using the following method:
$params = Get-Device "Device" | New-SensorParameters -RawType paessler.rest.rest_custom_v2_sensor
Get-Device "Device" | Add-Sensor $params
Before I actually create the device, I update the mandatory parameters using:
$params.<Property> = "value"
This works as expected. However, the sensor is not created correctly. This is I believe because I am not correctly defining the following property:
$params.paessler-rest-channel_section-channel_group-channel1_type
This property is populated with the value "integer_value" by default, when New-SensorParameters is used. I speculatively changed this to "string_value" although this did not work; no error although the sensor is not created as required.
Having no terms of reference here for valid values I decided to check the properties of an existing sensor as follows:
Get-Sensor -Id <Manually Created REST API v2 Sensor> | Get-ObjectProperty -Raw
Alas, the property of interest, channel 1 type, is not returned:
Based on objects returned by New-SensorParameters below, I was hoping that the desired property would also be returned above:
Any thoughts on how I can correctly identify correct values for paessler-rest-channel_section-channel_group-channel1_type?
Thanks in advance!
Due Dilligance