Writing own components

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

Writing own components

Post by SDohmen »

Here i am again with the next question.

For our central we want to create 1 or more own components which include tree forms etc. The problem is however that there is no documentation for this subject about creating them. Is this documentation only available on request or is there no documentation available?

If there is no documentation available are there any pointers we need to include to make them work and all?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Writing own components

Post by lmiltchev »

Currently, we don't have any documentation on the topic, however it is on our TODO list. Your best bet would be to download a component and see how it is done.
Maybe this one would be a good start:

http://exchange.nagios.org/directory/Ad ... nt/details
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: Writing own components

Post by niebais »

If you look in the directory /usr/local/nagiosxi/html/includes/components on your server, there are several components already built. For the most part it is just PHP with a few plugin options for Nagios.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Writing own components

Post by Box293 »

It's not too hard, I cut my teeth on customizing configuration wizards first and this made it easier to fiddle about with components.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

Re: Writing own components

Post by SDohmen »

Yesterday my co-worker finished working on the component we are creating however when we tried to upload it we got a error that its not a component. We used the mass acknowledge as base and just changed the values so they are what we want. My question is if there are logs or something available to see what kinda errors we are getting while uploading the component.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Writing own components

Post by mguthrie »

This is most likely an issue with your naming convention. The component name, directory name, zipfile name, and <componentname>.inc.php script must all be named the same. It's also recommended that you prepend all of your component's functions with the component name.
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

Re: Writing own components

Post by SDohmen »

Thank you for the input. We got the component to work now. We just need to clean up the code and we might be able to share it.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Writing own components

Post by mguthrie »

Good deal. Thanks for the update
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

Re: Writing own components

Post by SDohmen »

Just to give this post a swift kick. We have developed several components atm (which i hope to share later on) but i do have a question about our latest one.

It is sort like the BPI component but a bit different. The thing i want is to be able to have the configuration link listed in the configuration menu part. Preferred with the user authentication etc. Now is my question if this is even possible or is it not possible due too it being modified gui?

If it is possible, where or what do i need to do to get it there.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Writing own components

Post by Box293 »

Have a look at the Active Directory Integration component as an example of how this is done.

In the active_directory.inc.php file look at the section COMPONENT_CONFIGMODE_GETSETTINGSHTML between lines 157 - 263. This is the screen that appears when you click the Edit Settings icon.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked