Closed marcelo-0511 closed 3 years ago
Hi @marcelo-0511,
The implication here is there's something wrong with your sensor parameters.
Can you do
$sdwan_state
and provide the output?
Furthermore, if you add the -Verbose
parameter to your invocation of Add-Sensor
, are you able to provide the output? Please be sure to redact any sensitive information
There is below the output:
Hi @marcelo-0511,
Can you also provide the -Verbose
log output as mentioned above?
In additon, what happens if you simply target a single specific interface? (change -Target *
to something more specific)
Are you able to add snmplibrary sensors for other OIDLIBs?
Yes, there are print screens below:
Yes, I am able to add sensors.
I will try to do with a especific interface.
I have an important thing to say, this script worked before in this device and now it worked to another device, the difference between the devices are the quantity os sensors(more in device that is not working yet).
Hi @marcelo-0511,
Based on this information this appears to be a duplicate of #80; as such, in order to work around this for now you will need to split this into several API calls, with each API call only specifying a few interfaces.
You can easily do this by "chunking" the interfaces you'd like to add up into several smaller groups (the following code has not been tested but should more or less work)
$device = Get-Device -Id $id
# Get your parameters as normal
$params = $device | New-SensorParameters -rt snmplibrary -qt sdwan_state.oidlib -DynamicType
# Now chunk the interface targets up into groups of 4
# Taken from https://stackoverflow.com/questions/13888253/powershell-break-a-long-array-into-a-array-of-array-with-length-of-n-in-one-line
$counter = [pscustomobject] @{ Value = 0 }
$groupSize = 4
$groups = $params.Targets.interface__check | Group-Object -Property { [math]::Floor($counter.Value++ / $groupSize) }
# Now add the sensors to your device, 4 interfaces at a time
foreach($group in $groups)
{
$params.interface__check = $group.Group
$device | Add-Sensor $params
}
Regards, lordmilko
Describe the bug
When I am trying add sensors i am getting following errors:
Steps to reproduce
What is the output of 'Get-PrtgClient -Diagnostic'?
Additional context
No response