uberspace / icingaweb2-module-netboximport Goto Github PK
View Code? Open in Web Editor NEWImport devices and virtual machines from netbox into icinga2 to monitor them.
License: MIT License
Import devices and virtual machines from netbox into icinga2 to monitor them.
License: MIT License
Cannot run an import from NetBox to Icingaweb2:
#0 /usr/share/icingaweb2/modules/netboximport/library/Netboximport/ProvidedHook/Director/ImportSource.php(93): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(Integer, String, String, Integer, Array)
#1 /usr/share/icingaweb2/modules/netboximport/library/Netboximport/ProvidedHook/Director/ImportSource.php(167): Icinga\Module\Netboximport\ProvidedHook\Director\ImportSource->fetchInterfaces()
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Table/ImportsourceHookTable.php(109): Icinga\Module\Netboximport\ProvidedHook\Director\ImportSource->fetchData()
#3 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Web/Table/SimpleQueryBasedTable.php(29): Icinga\Module\Director\Web\Table\ImportsourceHookTable->prepareQuery()
#4 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Web/Table/SimpleQueryBasedTable.php(15): dipl\Web\Table\SimpleQueryBasedTable->getQuery()
#5 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Web/Table/QueryBasedTable.php(56): dipl\Web\Table\SimpleQueryBasedTable->getPaginationAdapter()
#6 /usr/share/icingaweb2/modules/director/library/vendor/ipl/Web/Table/QueryBasedTable.php(237): dipl\Web\Table\QueryBasedTable->getPaginator(Object(dipl\Web\Url))
#7 /usr/share/icingaweb2/modules/director/application/controllers/ImportsourceController.php(74): dipl\Web\Table\QueryBasedTable->renderTo(Object(Icinga\Module\Director\Controllers\ImportsourceController))
#8 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Controllers\ImportsourceController->previewAction()
#9 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#11 /usr/share/php/Icinga/Application/Web.php(409): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#12 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
#13 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#14 {main}
Hey guys,
we love this tool, and its super handy. We have cloned the repo privately and added some features and fixes we needed. Happy to contribute or fork or whatever, can you please let us know what license you want to use? Thanks for your work in creating it, it has really helped with a few projects.
NetBox allows to assign the same name for different objects as long as there is a secondary unique key.
Descussion on this issue: netbox-community/netbox#2669
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.
Import should work.
If you try to import data from Netbox 2.4.7 it doesn't allow you to import because of the long names produced by the context_data in netbox like local_context_data__last_inform__port_table__3__mac_table__0__uptime
.
The Director team doesn't want to increase the limit of the names for performance reasons and also because they think this module shouldn't flatten the data at all because the director supports structured data.
A. Don't flatten the data
B. Dont expose the context_data to Icinga
I did try to disable the flattening in the module but this resulted in probably invalid JSON (see Icinga/icingaweb2-module-director#1711 (comment))
See Icinga/icingaweb2-module-director#1711
icinga2 --version
): r2.9.2-1Is this icingaweb2 module also compatible to the Nautobot API?
https://github.com/nautobot/nautobot
Add an issue template to this repo asking for
Trying to use this plugin with different versions of NetBox (2.8.3 and 2.9.3). Unfortunately it always ends in the same stack trace.
#0 /usr/share/icingaweb2/modules/netboximport/library/Netboximport/ProvidedHook/Director/ImportSource.php(138): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(Integer, String, String, Integer, Array)
#1 /usr/share/icingaweb2/modules/netboximport/library/Netboximport/ProvidedHook/Director/ImportSource.php(236): Icinga\Module\Netboximport\ProvidedHook\Director\ImportSource->fetchInterfaces()
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Table/ImportsourceHookTable.php(100): Icinga\Module\Netboximport\ProvidedHook\Director\ImportSource->fetchData()
#3 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/icingaweb2/src/Table/SimpleQueryBasedTable.php(29): Icinga\Module\Director\Web\Table\ImportsourceHookTable->prepareQuery()
#4 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/icingaweb2/src/Table/SimpleQueryBasedTable.php(15): gipfl\IcingaWeb2\Table\SimpleQueryBasedTable->getQuery()
#5 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/icingaweb2/src/Table/QueryBasedTable.php(56): gipfl\IcingaWeb2\Table\SimpleQueryBasedTable->getPaginationAdapter()
#6 /usr/share/icingaweb2/modules/incubator/vendor/gipfl/icingaweb2/src/Table/QueryBasedTable.php(255): gipfl\IcingaWeb2\Table\QueryBasedTable->getPaginator(Object(gipfl\IcingaWeb2\Url))
#7 /usr/share/icingaweb2/modules/director/application/controllers/ImportsourceController.php(159): gipfl\IcingaWeb2\Table\QueryBasedTable->renderTo(Object(Icinga\Module\Director\Controllers\ImportsourceController))
#8 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Controllers\ImportsourceController->previewAction()
#9 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#10 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#11 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#12 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()
#13 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#14 {main}
Fetch the NetBox data successfully
Fetching Data fails
Can't really tell. Tried with different commits in this repo and the issue does not disappear.
icinga2 --version
): 2.12.0-1icinga2 feature list
):icinga2 daemon -C
):Thank You
For GET /api/virtualization/clusters/ HTTP/1.1 the result is
{ "count": 1, "next": null, "previous": null, "results": [ { "id": 4, "name": "Proxmox", "type": { "id": 7, "url": "http://x-aachen.de/api/virtualization/cluster-types/7/", "name": "Proxmox", "slug": "proxmox" }, "group": null, "site": { "id": 1, "url": "http://x-aachen.de/api/dcim/sites/1/", "name": "x-aachen.de", "slug": "kullen" }, "comments": "", "tags": [], "custom_fields": {}, "created": "2017-12-21", "last_updated": "2017-12-21T15:12:49.124749+01:00" } ]
See https://pastebin.com/nTdUsQeJ for correct layout.
and the Script requests
GET /api/virtualization/clusters/4?limit=1000000 HTTP/1.1
gets redirected (301) to (see #3)
GET /api/virtualization/clusters/4/?limit=1000000 HTTP/1.1
This request results in a 404 because the page doesn't exist
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.