Dashlets vs. Components

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hornseym
Posts: 13
Joined: Wed Nov 16, 2016 6:21 am

Dashlets vs. Components

Post by hornseym »

Hopefully this is a simple question...

I'm looking to develop some custom functionality for our Nagios XI installation and I have a choice of doing it via a Dashlet or a Component. The fundamental use case is to take an input from a user and relay it back to the server the server to do something with (I'm writing another script to cover this bit).

What's the difference between Dashlets and Components? What use cases are each suited to?

I notice that the documentation on Dashlets is particularly sparse (aka I can't find it) so are Components preferred over Dashlets?

I can't really find any API documentation for either of them. I have found the "How To Write Custom Components" guide, but this doesn't really have the detail I was expecting (e.g. registering callbacks - what can I register, when will it be called and what information will I get back). Does API documentation exist for either of these?

Many thanks,
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Dashlets vs. Components

Post by rkennedy »

Dashlets are more geared to be used on the Dashboards, where as a component strings in to XI as a whole.

As a side note - does the custom includes component work for your needs? I imagine you just need a small front end spot to place your input box / link, and that should work. Any PHP / script that goes with it could just be uploaded to the XI machine.
Former Nagios Employee
hornseym
Posts: 13
Joined: Wed Nov 16, 2016 6:21 am

Re: Dashlets vs. Components

Post by hornseym »

It might work, it might not...

I did simplify the example slightly. The input from the user would be specific to a host; this would either be by selecting it from, say, a drop down, a row in a table, etc or it could even be a new tab on the Host Detail screen.

I'm not 100% sure which is best right now as we're still working on what screen our end user wants to see. Hence my question is geared towards finding as much information (and ideally documentation) as possible so that I understand what choices I have.

On that note, the suggestion of the the custom includes component is useful as it provides another option to consider. Thank you.

What makes Dashlets/Components more geared towards those uses? I'm struggling to find significant documentation (may be I'm not looking in the right places) so I'm having to do a lot of guess work from other people's code how the APIs are intended to be used. Do you know where there's any documentation of the APIs of these? Or do I only have guide below plus the tutorial videos on YouTube?

Many thanks,
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Dashlets vs. Components

Post by ssax »

You could also look at utilizing the actions component as well (or use it as reference) for putting links and stuff on the hosts/services detail pages:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Dashlets vs. Components

Post by ssax »

Dashlets are only available for use on the Dashboards, components can be anything really (except a wizard), you'll likely use the actions component or write your own component to do what you are trying to do though.

These may be helpful:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://support.nagios.com/kb/article.php?id=439
Locked