### Commit Message Examples Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md Examples of well-formatted commit messages for fixes and features, including issue references. ```git Fix missing style in detail view refs #4567 ``` ```git Add DateTime picker refs #1234 ``` -------------------------------- ### Example Variable Paths Source: https://github.com/icinga/icingadb-web/blob/main/doc/04-Security.md Demonstrates how to reference custom variable values and nested structures, including array elements, for use in security configurations. Supports wildcard matching for array elements. ```text os team.name team.on-site[0] team.on-site[*] ``` -------------------------------- ### Start Interactive Rebase Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md Initiate an interactive rebase to modify commit history, such as squashing multiple commits. ```git git rebase -i HEAD~3 ``` -------------------------------- ### Process Check Result Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Process a check result for hosts or services. This operation is documented but specific options and examples are not detailed in this section. ```APIDOC ## Process Check Result ### Description Process a check result for hosts or services. This operation is documented but specific options and examples are not detailed in this section. ### Method POST ### Endpoint - icingadb/hosts/process-check-result - icingadb/services/process-check-result ### Parameters #### Request Body Details on required parameters for processing check results are not provided in this documentation section. ``` -------------------------------- ### Fork and Clone Repository Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md Clone the forked repository and set up the upstream remote for future updates. ```bash git clone git@github.com:jdoe/icingadb-web.git cd icingadb-web ``` ```bash git remote add upstream https://github.com/icinga/icingadb-web.git ``` ```bash git fetch --all git pull upstream HEAD ``` -------------------------------- ### Copy Monitoring Configuration Source: https://github.com/icinga/icingadb-web/blob/main/doc/10-Migration.md Copy the existing monitoring module configuration file to the Icinga DB Web configuration directory. The behavior of these options remains the same. ```bash cp /etc/icingaweb2/modules/monitoring/config.ini /etc/icingaweb2/modules/icingadb/config.ini ``` -------------------------------- ### Check Now Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Trigger an immediate check for hosts or services. This operation does not require any specific options. ```APIDOC ## Check Now ### Description Trigger an immediate check for hosts or services. This operation does not require any specific options. ### Method POST ### Endpoint - icingadb/hosts/check-now - icingadb/services/check-now ### Parameters #### Request Body None. ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **data** (array) - An array of objects, each detailing the result of triggering the check. - **type** (string) - The type of the result (e.g., "success"). - **message** (string) - A message describing the result. #### Response Example ```json { "status": "success", "data": [ { "type": "success", "message": "Check triggered successfully" } ] } ``` ``` -------------------------------- ### Create Pull Request with hub CLI Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md Use the hub CLI tool to create a pull request with a descriptive subject and issue fixes. ```bash hub pull-request fixes #1234 ``` -------------------------------- ### Edit Documentation File Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md Use a text editor like Vim to modify documentation files located in the `doc/` directory. ```vim vim doc/02-Installation.md ``` -------------------------------- ### Migrate Navigation Items Source: https://github.com/icinga/icingadb-web/blob/main/doc/10-Migration.md Automatically migrate navigation items from the monitoring module to Icinga DB Web using the icingacli command. Use --user to specify users and --no-backup to remove old items. ```bash icingacli icingadb migrate navigation --user= [--no-backup] [--override] ``` -------------------------------- ### Rebase and Push Branch Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md Rebase your feature branch onto the main branch and push to your remote repository. Use force push with caution if the branch already exists. ```bash git checkout main git pull upstream HEAD git checkout fix/style-detail-view-5678 git rebase main ``` ```bash git push --set-upstream origin fix/style-detail-view-5678 ``` ```bash git push -f origin fix/style-detail-view-5678 ``` -------------------------------- ### Copy Command Transports Configuration Source: https://github.com/icinga/icingadb-web/blob/main/doc/10-Migration.md Copy the command transports configuration file. Ensure to remove any sections that do not define 'transport=api' as Icinga DB Web no longer supports commandfile transports. ```bash cp /etc/icingaweb2/modules/monitoring/commandtransports.ini /etc/icingaweb2/modules/icingadb/commandtransports.ini ``` -------------------------------- ### Configure Commits for Squashing Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md In the interactive rebase editor, change 'pick' to 'squash' for commits you wish to merge into the preceding one. ```git pick e4bf04e47 Fix style detail view squash d7b939d99 Tests squash b37fd5377 Doc updates ``` -------------------------------- ### Configure Icinga DB Database Resource Source: https://github.com/icinga/icingadb-web/blob/main/doc/03-Configuration.md Define the database resource name in the icingadb module configuration. This resource must match the name created in the Icinga Web application resources. ```ini [icingadb] resource = "icingadb" ``` -------------------------------- ### Migrate Dashboard Items Source: https://github.com/icinga/icingadb-web/blob/main/doc/10-Migration.md Automatically migrate dashboard items that reference views from the monitoring module to Icinga DB Web. Use --user to specify users and --no-backup to disable backup creation. ```bash icingacli icingadb migrate dashboard --user= [--no-backup] ``` -------------------------------- ### Create Feature/Fix Branches Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md Create new branches for specific features or bug fixes, including an issue number if applicable. ```bash git checkout -b fix/service-template-typo-1234 ``` ```bash git checkout -b feature/config-handling-1235 ``` -------------------------------- ### Add Comment via API Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Use this curl command to add a comment to a host. Ensure you have the correct user, password, and base URL. The filter is optional but recommended for targeting specific items. ```shell USER="icingaadmin" PASSWORD="icinga" BASEURL="http://localhost/icingaweb2" FILTER="host.name=docker-master" curl -H "Accept: application/json" -u $USER:$PASSWORD "$BASEURL/icingadb/hosts/add-comment?$FILTER" \ -F "comment=kaput" -F "expire_time=2023-10-05T20:00:00" -F "expire=y" ``` -------------------------------- ### Transform Filters with icingacli Source: https://github.com/icinga/icingadb-web/blob/main/doc/05-Upgrading.md Use this command to automatically transform filters affected by the new '~' and '!~' operators. Pass `--no-backup` to disable backup creation for menu items, dashboards, and roles. ```bash icingacli icingadb migrate filter [--no-backup] ``` -------------------------------- ### Fetch and Pull Default Branch Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md Before rebasing, ensure your local default branch is up-to-date with the remote. ```git git checkout main git fetch --all git pull upstream HEAD ``` -------------------------------- ### Rebase to Backup Branch Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md To mitigate risks, perform the rebase on a temporary backup branch before replacing the original. ```git git checkout fix/style-detail-view-5678 git checkout -b fix/style-detail-view-5678-rebase git rebase main git branch -D fix/style-detail-view-5678 git checkout -b fix/style-detail-view-5678 git push -f origin fix/style-detail-view-5678 ``` -------------------------------- ### Continue Rebase After Conflict Resolution Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md After resolving conflicts in a file, add the resolved file and continue the rebase process. ```git git add path/to/conflict.php git rebase --continue ``` -------------------------------- ### Set Acknowledgement Expiration Source: https://github.com/icinga/icingadb-web/blob/main/doc/03-Configuration.md Configure the default expiration time for acknowledgements. Set 'acknowledge_expire' to 1 to enable expiration and 'acknowledge_expire_time' to a duration like PT2H for 2 hours. ```ini [settings] acknowledge_expire = 1 acknowledge_expire_time = PT2H ``` -------------------------------- ### Schedule Host Downtime Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Schedules downtime for a host, optionally including all its services. ```APIDOC ## POST icingadb/hosts/schedule-downtime ### Description Schedules downtime for a host. ### Method POST ### Endpoint /icingadb/hosts/schedule-downtime ### Parameters #### Request Body - **comment** (Text) - Required - A comment describing the reason for the downtime. - **start** (DateTime) - Required - The start time of the downtime. Defaults to now. - **end** (DateTime) - Required - The end time of the downtime. Defaults to now + 1 hour (fixed) or now + 2 hours (flexible). - **flexible** (BoolEnum) - Optional - Whether the downtime is flexible. Defaults to 'n'. - **hours** (Number) - Required - The number of hours for flexible downtime. Defaults to 2. - **minutes** (Number) - Required - The number of minutes for flexible downtime. Defaults to 0. - **all_services** (BoolEnum) - Optional - Whether to schedule downtime for all services of the host. Defaults to 'n'. - **child_options** (ChildOption) - Optional - Options for child objects. ``` -------------------------------- ### Acknowledge Problem Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Acknowledge a problem for hosts or services. This operation allows specifying a comment, persistence, notifications, and expiration. ```APIDOC ## Acknowledge Problem ### Description Acknowledge a problem for hosts or services. This operation allows specifying a comment, persistence, notifications, and expiration. ### Method POST ### Endpoint - icingadb/hosts/acknowledge - icingadb/services/acknowledge ### Parameters #### Request Body (multipart/form-data) - **comment** (Text) - Required - The comment text for the acknowledgement. - **persistent** (BoolEnum) - Optional - Whether the acknowledgement should be persistent. Default: `n`. - **notify** (BoolEnum) - Optional - Whether to send notifications. Default: `y`. - **sticky** (BoolEnum) - Optional - Whether the acknowledgement should be sticky. Default: `n`. - **expire** (BoolEnum) - Optional - Whether the acknowledgement should expire. Default: `n`. - **expire_time** (DateTime) - Required if `expire` is `y` - The time when the acknowledgement should expire. Format: `Y-m-d\TH:i:s`. ### Request Example ```shell curl -H "Accept: application/json" -u icingaadmin:icinga \"http://localhost/icingaweb2/icingadb/hosts/acknowledge?host.name=docker-master\" \ -F "comment=Acknowledging issue" -F "expire_time=2023-10-05T20:00:00" -F "expire=y" ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **data** (array) - An array of objects, each detailing the result of the acknowledgement. - **type** (string) - The type of the result (e.g., "success"). - **message** (string) - A message describing the result. #### Response Example ```json { "status": "success", "data": [ { "type": "success", "message": "Problem acknowledged successfully" } ] } ``` #### Error Response (422) - **status** (string) - Indicates failure. - **data** (object) - Contains details about validation errors. - **comment** (array) - Errors related to the comment field. - **expire_time** (array) - Errors related to the expire_time field. #### Error Response Example ```json { "status": "fail", "data": { "comment": [], "expire_time": ["The expire time must not be in the past"] } } ``` ``` -------------------------------- ### Send Custom Notification Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Sends a custom notification for a host or service. ```APIDOC ## POST icingadb/hosts/send-custom-notification ### Description Sends a custom notification for a host. ### Method POST ### Endpoint /icingadb/hosts/send-custom-notification ### Parameters #### Request Body - **comment** (Text) - Required - A comment for the notification. - **forced** (BoolEnum) - Optional - Whether to force the notification. Defaults to 'n'. ``` ```APIDOC ## POST icingadb/services/send-custom-notification ### Description Sends a custom notification for a service. ### Method POST ### Endpoint /icingadb/services/send-custom-notification ### Parameters #### Request Body - **comment** (Text) - Required - A comment for the notification. - **forced** (BoolEnum) - Optional - Whether to force the notification. Defaults to 'n'. ``` -------------------------------- ### Schedule Check Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Schedules a new check for a host or service. ```APIDOC ## POST icingadb/hosts/schedule-check ### Description Schedules a check for a host. ### Method POST ### Endpoint /icingadb/hosts/schedule-check ### Parameters #### Request Body - **check_time** (DateTime) - Required - The time when the check should be performed. Defaults to now + 1 hour. - **force_check** (BoolEnum) - Optional - Whether to force the check. ``` ```APIDOC ## POST icingadb/services/schedule-check ### Description Schedules a check for a service. ### Method POST ### Endpoint /icingadb/services/schedule-check ### Parameters #### Request Body - **check_time** (DateTime) - Required - The time when the check should be performed. Defaults to now + 1 hour. - **force_check** (BoolEnum) - Optional - Whether to force the check. ``` -------------------------------- ### Add Comment Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Add a comment to hosts or services. This operation requires a comment text and can optionally include expiration settings. ```APIDOC ## Add Comment ### Description Add a comment to hosts or services. This operation requires a comment text and can optionally include expiration settings. ### Method POST ### Endpoint - icingadb/hosts/add-comment - icingadb/services/add-comment ### Parameters #### Request Body (multipart/form-data) - **comment** (Text) - Required - The comment text to add. - **expire** (BoolEnum) - Optional - Whether the comment should expire. Default: `n`. - **expire_time** (DateTime) - Required if `expire` is `y` - The time when the comment should expire. Format: `Y-m-d\TH:i:s`. ### Request Example ```shell curl -H "Accept: application/json" -u icingaadmin:icinga \"http://localhost/icingaweb2/icingadb/hosts/add-comment?host.name=docker-master\" \ -F "comment=Adding a note" -F "expire_time=2023-10-05T20:00:00" -F "expire=y" ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **data** (array) - An array of objects, each detailing the result of adding the comment. - **type** (string) - The type of the result (e.g., "success"). - **message** (string) - A message describing the result. #### Response Example ```json { "status": "success", "data": [ { "type": "success", "message": "Added comment successfully" } ] } ``` #### Error Response (422) - **status** (string) - Indicates failure. - **data** (object) - Contains details about validation errors. - **comment** (array) - Errors related to the comment field. - **expire_time** (array) - Errors related to the expire_time field. #### Error Response Example ```json { "status": "fail", "data": { "comment": [], "expire_time": ["The expire time must not be in the past"] } } ``` ``` -------------------------------- ### Resolve Rebase Conflicts Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md When a conflict occurs during rebase, identify the conflicting files and resolve them manually. Use `git status` to see conflicts. ```git git status both modified: path/to/conflict.php ``` -------------------------------- ### Rebase Working Branch Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md Rebase your current working branch onto the updated default branch to integrate changes. ```git git checkout fix/style-detail-view-5678 git rebase main ``` -------------------------------- ### Schedule Service Downtime Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Schedules downtime for a specific service. ```APIDOC ## POST icingadb/services/schedule-downtime ### Description Schedules downtime for a service. ### Method POST ### Endpoint /icingadb/services/schedule-downtime ### Parameters #### Request Body - **comment** (Text) - Required - A comment describing the reason for the downtime. - **start** (DateTime) - Required - The start time of the downtime. Defaults to now. - **end** (DateTime) - Required - The end time of the downtime. Defaults to now + 1 hour (fixed) or now + 2 hours (flexible). - **flexible** (BoolEnum) - Optional - Whether the downtime is flexible. Defaults to 'n'. - **hours** (Number) - Required - The number of hours for flexible downtime. Defaults to 2. - **minutes** (Number) - Required - The number of minutes for flexible downtime. Defaults to 0. ``` -------------------------------- ### Configure Icinga 2 API User for Icingadb Web Source: https://github.com/icinga/icingadb-web/blob/main/doc/03-Configuration.md Define an ApiUser object in Icinga 2 configuration to grant Icinga DB Web necessary permissions for actions like acknowledging problems and forcing checks. Ensure the password is changed from the default. ```icinga2 object ApiUser "icingadb-web" { password = "CHANGEME" permissions = [ "actions/*", "objects/modify/*", "objects/query/*", "status/query" ] } ``` -------------------------------- ### API Failure Response Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md An unsuccessful API request, often due to invalid options, returns a 422 status code with a JSON object detailing the errors. ```json { "status": "fail", "data": { "comment": [], "expire": [], "expire_time": ["The expire time must not be in the past"] } } ``` -------------------------------- ### Process Check Result Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Allows processing check results for hosts and services. This is useful for integrating external monitoring tools or custom checks. ```APIDOC ## POST icingadb/hosts/process-checkresult ### Description Processes a check result for a specific host. ### Method POST ### Endpoint /icingadb/hosts/process-checkresult ### Parameters #### Request Body - **status** (State) - Required - The status of the check result. - **output** (Text) - Required - The output message from the check. - **perfdata** (PerfData) - Optional - Performance data from the check. ``` ```APIDOC ## POST icingadb/services/process-checkresult ### Description Processes a check result for a specific service. ### Method POST ### Endpoint /icingadb/services/process-checkresult ### Parameters #### Request Body - **status** (State) - Required - The status of the check result. - **output** (Text) - Required - The output message from the check. - **perfdata** (PerfData) - Optional - Performance data from the check. ``` -------------------------------- ### Force Push Rebased Branch Source: https://github.com/icinga/icingadb-web/blob/main/CONTRIBUTING.md After a successful rebase, force push the changes to the remote branch. Use with caution. ```git git push -f origin fix/style-detail-view-5678 ``` -------------------------------- ### API Success Response Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md A successful API request returns a 200 status code with a JSON object indicating success and a message. ```json { "status": "success", "data": [ { "type": "success", "message": "Added comment successfully" } ] } ``` -------------------------------- ### Disable Query Optimizer for History Queries Source: https://github.com/icinga/icingadb-web/blob/main/doc/03-Configuration.md Optionally disable the query optimizer for history queries in MySQL/MariaDB to potentially improve performance. This is configured within the icingadb module settings. ```ini [icingadb] ... disable_optimizer_for_history_queries = 1 ``` -------------------------------- ### Delete Comment via API Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md This curl command demonstrates how to delete a comment from a host using the Icinga Web API. It requires authentication and specifies the host to target via a filter. ```shell USER="icingaadmin" PASSWORD="icinga" BASEURL="http://localhost/icingaweb2" FILTER="host.name=docker-master" curl -H "Accept: application/json" -u $USER:$PASSWORD -X POST "$BASEURL/icingadb/hosts/delete-comment?$FILTER" ``` -------------------------------- ### Delete Downtimes Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Deletes scheduled downtimes. ```APIDOC ## POST icingadb/downtimes/delete ### Description Deletes scheduled downtimes. ### Method POST ### Endpoint /icingadb/downtimes/delete ``` -------------------------------- ### Remove Acknowledgement Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Removes an existing acknowledgement for a host or service. ```APIDOC ## POST icingadb/hosts/remove-acknowledgement ### Description Removes the acknowledgement for a host. ### Method POST ### Endpoint /icingadb/hosts/remove-acknowledgement ``` ```APIDOC ## POST icingadb/services/remove-acknowledgement ### Description Removes the acknowledgement for a service. ### Method POST ### Endpoint /icingadb/services/remove-acknowledgement ``` -------------------------------- ### Delete Comments Source: https://github.com/icinga/icingadb-web/blob/main/doc/09-Automation.md Delete comments from hosts or services. This operation does not require any specific options. ```APIDOC ## Delete Comments ### Description Delete comments from hosts or services. This operation does not require any specific options. ### Method POST ### Endpoint - icingadb/comments/delete ### Parameters #### Request Body None. ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **data** (array) - An array of objects, each detailing the result of deleting the comments. - **type** (string) - The type of the result (e.g., "success"). - **message** (string) - A message describing the result. #### Response Example ```json { "status": "success", "data": [ { "type": "success", "message": "Comments deleted successfully" } ] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.