Leftovers
Testing Icinga 2¶
Please follow the documentation for build and test instructions.
You can help test-drive the latest Icinga 2 snapshot packages inside the Icinga 2 Vagrant boxes.
Source Code Patches¶
Icinga 2 can be built on Linux/Unix nodes and Windows clients. In order to develop patches for Icinga 2, you should prepare your own local build environment and know how to work with C++.
Please follow the development documentation for development environments, the style guide and more advanced insights.
Contribute CheckCommand Definitions¶
The Icinga Template Library (ITL) and its plugin check commands provide a variety of CheckCommand object definitions which can be included on-demand.
Advantages of sending them upstream:
- Everyone can use and update/fix them.
- One single place for configuration and documentation.
- Developers may suggest updates and help with best practices.
- You don’t need to care about copying the command definitions to your satellites and clients.
Where do I start?¶
Get to know the check plugin and its options. Read the general documentation on how to integrate your check plugins and how to create a good CheckCommand definition.
A good command definition uses:
- Command arguments including
value,description, optional:set_if,required, etc. - Comments
/* ... */to describe difficult parts. - Command name as prefix for the custom attributes referenced (e.g.
disk_) - Default values
- If
host.addressis involved, set a custom attribute (e.g.ping_address) to the default$address$. This allows users to override the host’s address later on by setting the custom attribute inside the service apply definitions. - If the plugin is also capable to use ipv6, import the
ipv4-or-ipv6template and use$check_address$instead of$address$. This allows to fall back to ipv6 if only this address is set. - If
set_ifis involved, ensure to specify a sane default value if required.
- If
- Templates if there are multiple plugins with the same basic behaviour (e.g. ping4 and ping6).
- Your love and enthusiasm in making it the perfect CheckCommand.
I have created a CheckCommand, what now?¶
Icinga 2 developers love documentation. This isn’t just because we want to annoy anyone sending a patch, it’s a matter of making your contribution visible to the community.
Your patch should consist of 2 parts:
- The CheckCommand definition.
- The documentation bits.
Fork the repository and ensure that the master branch is up-to-date.
Create a new fix or feature branch and start your work.
git checkout -b feature/itl-check-printer
Add CheckCommand Definition to Contrib Plugins¶
There already exists a defined structure for contributed plugins. Navigate to itl/plugins-contrib.d
and verify where your command definitions fits into.
cd itl/plugins-contrib.d/
ls
If you want to add or modify an existing Monitoring Plugin please use itl/command-plugins.conf instead.
vim itl/command-plugins-conf
Existing Configuration File¶
Just edit it, and add your CheckCommand definition.
vim operating-system.conf
Proceed to the documentation.
New type for CheckCommand Definition¶
Create a new file with .conf suffix.
vim printer.conf
Add the file to itl/CMakeLists.txt in the FILES line in alpha-numeric order.
This ensures that the installation and packages properly include your newly created file.
vim CMakeLists.txt
-FILES ipmi.conf network-components.conf operating-system.conf virtualization.conf vmware.conf
+FILES ipmi.conf network-components.conf operating-system.conf printer.conf virtualization.conf vmware.conf
Add the newly created file to your git commit.
git add printer.conf
Do not commit it yet but finish with the documentation.
Create CheckCommand Documentation¶
Edit the documentation file in the doc/ directory. More details on documentation
updates can be found here.
vim doc/10-icinga-template-library.md
The CheckCommand documentation should be located in the same chapter similar to the configuration file you have just added/modified.
Create a section for your plugin, add a description and a table of parameters. Each parameter should have at least:
- optional or required
- description of its purpose
- the default value, if any
Look at the existing documentation and “copy” the same style and layout.
Send a Patch¶
Commit your changes which includes a descriptive commit message.
git commit -av
Add printer CheckCommand definition
Explain its purpose and possible enhancements/shortcomings.
refs #existingticketnumberifany
Push the branch to the remote origin and create a pull request.
git push --set-upstream origin feature/itl-check-printer
hub pull-request
In case developers ask for changes during review, please add them to the branch and push those changes.