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

FR: Add option to add filters to NetBox requests #15

Open
bb-Ricardo opened this issue Oct 13, 2020 · 10 comments
Open

FR: Add option to add filters to NetBox requests #15

bb-Ricardo opened this issue Oct 13, 2020 · 10 comments

Comments

@bb-Ricardo
Copy link

Collection all the information in our current NetBox environment takes too long and runs into a timeout.

As Icinga might need different attributes from different devices I would propose to add a filter option to this module.

Appending a ?role=Server (as an example) to the request URL would be great. This limits the amount of returned data and we can change the imported data based on the device type.

A text field should be sufficient. The content should be added to the URL upon request.

Just putting this here as a reminder. Currently on Holidays but will try to give it a shot myself once I'm back. From what I've seen it should not be too difficult to implement.

joni1993 added a commit to joni1993/icingaweb2-module-netboximport that referenced this issue Oct 19, 2020
joni1993 added a commit to joni1993/icingaweb2-module-netboximport that referenced this issue Oct 19, 2020
@joni1993
Copy link
Contributor

Try if this works for you 😃

@luto
Copy link
Member

luto commented Oct 19, 2020

@joni1993 Having one filter field per object type (i.e. one for devices and one for VMs) would be nice. What do you think?

@joni1993
Copy link
Contributor

joni1993 commented Oct 19, 2020

Hm, i don't know - i think multiple filter fields are a bit confusing. Normally you want to apply the filter to all objects - if you need two filters i think cloning the import source may be cleaner (one for the devices, one for the vms).

We could also convert the two yes/no boxes to one select box like => Import: [Devices and VMs, only Devices, only VMs]

@bb-Ricardo
Copy link
Author

Cloning the import source is exactly what we currently do. But this looks promising.

@bb-Ricardo
Copy link
Author

tried it out with virtual machines but getting this response now.
image

@joni1993
Copy link
Contributor

That's interesting, this line wasn even touched - I will try again with VMs only, fetching both worked for me today.

@joni1993
Copy link
Contributor

Could it be that your filter is too restrictive and the result is empty? I can see why the listColumns should fail if data is returned - anyway this shouldn't happen of course.

@bb-Ricardo
Copy link
Author

Could it be that your filter is too restrictive and the result is empty? I can see why the listColumns should fail if data is returned - anyway this shouldn't happen of course.

This might be the case. Will test again:

@joni1993
Copy link
Contributor

Couldn't reproduce it even with a filter that returns zero elements.

@bb-Ricardo
Copy link
Author

Thank you for taking the time to test this.

Will have a look to see what the response contains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants