-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Create a SNMP Custom Table Sensor Error #343
Comments
Hi @noaboa97
|
Hello @schoenm1 So how I understand you. I would need to do this?
With But still the same error. Could you please elaborate further? Best Noah |
Hi @noaboa97
I always use "channel1unit" = "ValueLookup" and define the lookup table "channel1valuelookup" = "oid.mylookup". |
Hello @schoenm1 I get the same error. Okay. I don't define any custom lookup. So I have to figure out what logic is implemented in the frontend of prtg that I can't access when I connect over the api directly to the backend. And unfortunatly currently I don't have access to an unsecured prtg installation to record what the frontend sends to the backend. Maybe that would help me. |
So I was curious and tried to find something in the wiki for me to acomplish my goal of just monitoring the uplink port of the switch by looking at the custom snmp table and determining which one was is in use. To my understanding after carefully reading the wiki it should work as I expected it to work. I did some research and found this issue. Which is not relevant to my issue. But it gave me another idea, to try it with
Now I got the targets in
Anyway now I could create my own objects from this and know which one is the uplink but I still wouldn't have a way how to add only one sensor with this target. So my question @lordmilko is this a bug? Thank you and best regards Noah |
Hello @schoenm1 Thank you for your effort. Sounds really good. Unfortunatly it's not working. I also had to change somethings because I guess my data is a little diffrent. Here's my code and the error:
Here's my data so you can understand why I changed the where clause:
And here are where clauses what they filter for:
|
As the error indicates, you need to specify the table name. From the wiki
Generally speaking, you do not actually need to use
New versions of PRTG have broken PrtgAPI's ability to create sensors. As per #341 I am not in a position to fix this any time soon, and would recommend using an older version of PRTG (if possible) if this is absolutely critical. I don't know what version broke PrtgAPI |
Hello @lordmilko Thank you for your input. We aren't running the newest PRTG Version, so we are fine for now and we can still create sensors (I created the Meraki License and Health Sensor yesterday over PRTG API). But we wanted to upgrade soon but then we really have to think about it and test that in a test environment and investigate in which version it breaks. We run 22.4.81.1532+ Have you talked to Paessler about this Issue? I'm sorry to hear about your medical issue. I hope you get well soon! Take care! @schoenm1 were you able to check on your script server? Best Noah |
Hi @noaboa97, The error you are getting "Nothing was selected" is indicative that the version of PRTG you are running is affected by the same issue as #341. I don't know what version the issue was introduced in. This issue seems like it may affect all sensor types when selecting a sensor target that is not the first one in the list. |
Thanks @lordmilko So this error only affects sensors, where a sensor target needs to be selected? |
Thats what it seems based on the information gathered so far in #341 |
Hi @noaboa97
On this example, my table will give me just one sensor back, because this is a standalone switch and not a stack. |
Hello @schoenm1 Thanks for checking. Unfortunatly with your sensor there is only one entry in the table which aparently works but if there are more than one it's not working. I have to check with my collegeagues at work if we can use another sensor. But the snmpcustomtable is the one they have been using since other don't work and they never cared to investigate. I tried to look at the prtgAPI code to figure out where the Tomorrow I'm leaving for holiday and maybe I can further investigate this after I'm back from vacation. I still need the get a unsecured PRTG Server at work so I can check and record the API request to compare them. This could maybe help. @lordmilko Best Noah |
Hi @noaboa97
After PowerShell commands: |
If you specify |
I tried again and it's not working. Same error.
Output:
So maybe they fixed it with the newest version of PRTG (23.2.84.1566+)? Because @carsten0407 is running 23.2.83.1760 And I'm running 22.4.81.1532+ |
Hello guys Thank you for your support. Here's the code: # defining port number
$number = 2
# get the device
$device = get-device -id 88195 #87701
# generate sensor parameters of type snmpcustomtable needs the queryparameters snmp table oid
$param = $device | New-SensorParameters -RawType snmpcustomtable -QueryParameters @{ "tableoid" = "1.3.6.1.2.1.31.1.1"}
# name of the new sensor
$param.Name = "port$number / INET"
# row to choose from the table and filter by name
$param.snmptable__check = $param.targets.snmptable__check | where {$_.name -eq "port$number"}
# column to choose we use all didn't have a use case where I need to filter
$param.columns__check= $param.targets.columns__check
# name of the first channel
$param.channel1name = "Traffic IN"
# snmptype in webinterface it's called value type possible values: float=Absolute (float),diff=delta (counter),abs=(unsigned integer),sign=Absolute (signed integer)
$param.channel1snmptype = "diff"
# Channel Unit the see options check the dropdown in the webinterface of PRTG
$param.channel1unit = "BytesBandwidth"
# Use channel 2
$param.usechannel2 = 1
$param.channel2name = "Traffic OUT"
$param.channel2snmptype = "diff"
$param.channel2unit = "BytesBandwidth"
# Identification Column
$param.identcolumn = $param.Targets.identcolumn | Where-Object {$_.name -eq "ifName"}
# Column which value to show as sensor
$param.channel1column= $param.Targets.channel1column| Where-Object {$_.Name -eq "ifHCInOctets"}
$param.channel2column= $param.Targets.channel1column| Where-Object {$_.Name -eq "ifHCOutOctets"}
# Add Sensor to device
$device | Add-Sensor $param -verbose We create two channels one for traffic in and the other for traffic out. |
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.
I get the following error when I run the code above:
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
The text was updated successfully, but these errors were encountered: