Create own icingaweb2 module incl. DB-access, icingaweb-ressources, access foreign API etc

Hi guys,

After some time I went back into the topic to create own icingaweb2 modules. Since my last look into this, the Icinga php library with the sub-modules ipl-html, ipl-sql etc. is released.

I know the Training, the slides from OSMC-talk from 2017, the 2017’ blog post from Netways as well the blog post from 2020 on icinga.com. On the last one we can read the announcment of a developer guide. Are there any news about this? Or is this still the training?
If I would have a free wish, it would be great if it’s like the dev. guide like for Icinga for Windows from @cstein . Because this helped me a lot to understand the framework to build own checks. As well if I had to debug the framework/checks, if something was not working like excpected after the upgrade and and create issue on GitHub afterwards :wink:
The dev. guide for icinga is also very extensive :wink:

Now I try to understand the framework to build own modules. For this I analyse the source of some modules like mentioned in the blog post on icinga.com. e.g. director, grafana, business processes. But it’s pretty hard to understand the code without comments (why there aren’t any commets what the function is doing? I know it’s not every programmers thing to document something :sweat_smile:) as well if the code is also very extensive. And reading every file it’s like getting old very fast :slight_smile: It’s also like: where to start? The structure like mentioned in the training helps a little bit.

What I want to do is for example:

  • accessing data sources configured in icingaweb (configuration → application → ressources) .
  • I also want to access APIs from other programs, websites etc and combine the data with the data from icinga
  • etc. etc.

For this I’m missing examples. e.g. if the framework offers some “special” objects to use in the own code. As well would be interesting if there are some base functions we could use, so as not to have to reinvent every wheel.
And also can/should we use the function from IPL for our modules by now or should we use the “old way” like mentioned in the training. As well the PDO functions of PHP. While looking in some other modules, I saw not everybody is still using the new IPL.

Every hint, every example, link to a code (on GitHub) etc. would be very helpful to make life a little easier :grinning:. Especially if we probably have to wait longer for the dev guide.

So, the development guidelines (also for Icinga Web) are still in the making - we had to put them on halt for a little bit because of the Icinga DB that we put in focus for now.
We have not forgotten about it though!

For now you can also look through the how to section here in the forum for now.

I will ask around a little, if there are any more ressources available right now that I might also not know about and update you later :slight_smile:

2 Likes

Thank you for the update.

In this sitatuion It would also help a little bit, with real life code examples. Like “line a-c from file x is doing z” I think :wink:
Because now it’s really looking in every file would might could be what I’m looking for, try to understand and also try some objects, function in my module.