Page 1 of 2
Writing own components
Posted: Thu Nov 10, 2011 4:21 am
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?
Re: Writing own components
Posted: Thu Nov 10, 2011 10:32 am
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
Re: Writing own components
Posted: Tue Nov 15, 2011 3:13 pm
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.
Re: Writing own components
Posted: Tue Nov 15, 2011 5:47 pm
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.
Re: Writing own components
Posted: Wed Nov 23, 2011 3:30 am
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.
Re: Writing own components
Posted: Wed Nov 23, 2011 11:01 am
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.
Re: Writing own components
Posted: Mon Nov 28, 2011 4:25 am
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.
Re: Writing own components
Posted: Mon Nov 28, 2011 10:58 am
by mguthrie
Good deal. Thanks for the update
Re: Writing own components
Posted: Sun Feb 12, 2012 3:03 pm
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.
Re: Writing own components
Posted: Sun Feb 12, 2012 5:38 pm
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.