Hello,
with Nagios XI 5R1.0 a component freevariabletab is shipped and I wanted to use this as base template to create a new component.
I replaced every free* word by a new component name, but the component does not show? Do I have to register it?
I want to write a component which shows the whole configuration of a host / service in a tab. The data is available, so it should be possible to display it.
How to write my own component
Re: How to write my own component
Here's our official documentation on writing custom components in XI. This should get you started.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: How to write my own component
I already read the document. Is it enough to copy the files into the component directory? It is not mentioned in the document. Will the component automatically register if it is in the component directory or do I have to run a command to register it?lmiltchev wrote:Here's our official documentation on writing custom components in XI. This should get you started.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
As the free variable tab component is very short I used it as base and just changed the necessary things, but I cannot see it and do not get any error message.
Re: How to write my own component
As long as
- The component code does not error
- The component folder is in the right place
- The permissions are correct
Former Nagios employee
Re: How to write my own component
I managed to add a sample component, hopefully the following information is useful.
There are some more requirements which are mentioned in the document https://assets.nagios.com/downloads/nag ... ios-XI.pdf, but for me these were not marked as a requirement.
Create a directory /usr/local/nagiosxi/html/includes/components/mytest
Create a file mytest.inc.php in the directory mytest. The file mytest.inc.php has to have the same name as the directory.
The COMPONENT_NAME in mytest.inc.php has to have the same name as the diretory, too. In this case mytest
I would recommend to modify an existing component, in my case I used freevariabletab. Replace every occurrence of the word free by a new name. The component will not work if some of the names are duplicate.
In the Nagios XI Admin menu go to Manage Components, the component is visible immediately. If you do not see your component or the page does not load you did a mistake.
I didn' t find any log file which could help to identify the problem, but I' m pretty sure you can enable some kind of debug mode.
There are some more requirements which are mentioned in the document https://assets.nagios.com/downloads/nag ... ios-XI.pdf, but for me these were not marked as a requirement.
Create a directory /usr/local/nagiosxi/html/includes/components/mytest
Create a file mytest.inc.php in the directory mytest. The file mytest.inc.php has to have the same name as the directory.
The COMPONENT_NAME in mytest.inc.php has to have the same name as the diretory, too. In this case mytest
I would recommend to modify an existing component, in my case I used freevariabletab. Replace every occurrence of the word free by a new name. The component will not work if some of the names are duplicate.
In the Nagios XI Admin menu go to Manage Components, the component is visible immediately. If you do not see your component or the page does not load you did a mistake.
I didn' t find any log file which could help to identify the problem, but I' m pretty sure you can enable some kind of debug mode.
Re: How to write my own component
Did you try uploading your component through the interface? I never had any issues with the directory stuff.
Former Nagios Employee.
me.
me.