Creating a new openITCOCKPIT module¶
For this article you will need an openITCOCKPIT development environment. Read guide on how to create an openITCOCKPIT development environment.
This article contains the best practices for adding new features to openITCOCKPIT by creating a custom module. Developing your own module ensures that your system remains updatable and maintainable by our experts.
Getting started with development¶
The backend of openITCOCKPIT is written in PHP and uses the CakePHP 4 framework.
The frontend is based on an AngularJS, jQuery and Bootstrap 4 stack.
We recommend JetBrains PHPStorm as your IDE and Mozilla Firefox as your Browser.
The sample code is available on GitHub: https://github.com/it-novum/openITCOCKPIT-ExampleModule
Prerequisites¶
This document exclusively describes the development of modules for openITCOCKPIT. You must have experience with CakePHP and AngularJS before attempting to create any bespoke modules.
Working directory¶
The working directory for openITCOCKPIT is /opt/openitc/frontend
.
Make sure you are in this folder before you begin.
It is also recommended you use git for tracking your changes.
Activating debug mode¶
Important
Be aware that enabling debug mode can lead to data leaks and the loss of sensitive information.
By default, openITCOCKPIT runs in production mode. To get error messages and uncompressed (not minified) JavaScript, you will have to enable debug mode.
To do this, open the file /etc/nginx/openitc/master.conf
and set the parameter OITC_DEBUG
from 0
to 1
.
fastcgi_param OITC_DEBUG 1;
In order for your changes to be enabled, you must execute the following command:
openitcockpit-update --no-system-files
Important
Again, be aware that enabling debug mode can lead to data leaks and the loss of sensitive information.
Deactivating debug mode¶
To deactivate debug mode in openITCOCKPIT, you must execute the following command:
openitcockpit-update