PrtgAPI: Create a SNMP Custom Table Sensor Error
What’s going on?
Hello
I’m trying to create a snmpcustomtable sensor and filter what I want to select.
Here’s the code that’s giving me a hard time.
$device = get-device -name XXX
$device | get-sensortarget -rawType "snmpcustomtable" -QueryParameters @{
"tableoid" = "1.3.6.1.2.1.31.1.1"
} -Timeout 5000 -ErrorAction Stop
I get the following error when I run the code above:
get-sensortarget : Cannot guess sensor target table: multiple tables found. Available tables: snmptable__check, columns__check, identcolumn, channel1column, channel1valuelookup, channel2column,
channel2valuelookup, channel3column, channel3valuelookup, channel4column, channel4valuelookup, channel5column, channel5valuelookup, channel6column, channel6valuelookup, channel7column, channel7valuelookup,
channel8column, channel8valuelookup, channel9column, channel9valuelookup, channel10column, channel10valuelookup.
In Zeile:1 Zeichen:11
+ $device | get-sensortarget -rawType "snmpcustomtable" -QueryParameter ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-SensorTarget], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,PrtgAPI.PowerShell.Cmdlets.GetSensorTarget
Here’s what PRTG outputs if I do it manual in the webinterface:

I would of expected some sort of array with objects inside of it to iterate over them.
What am I missing? Or is this maybe a bug?
Best regards
Noah
Due Dilligance
- It wasn’t covered by the wiki, I swear!
- I have tried doing some basic research on this issue but haven’t been able to come up with anything. Please help!
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 18 (4 by maintainers)
Hi @noaboa97 I tested with a table more than one entry. On GUI:
before PowerShell Module commands:

After PowerShell commands:
In my case, this is also working with more than one entry in Table.