CheckMK Integration: Allow Customizable Ticket Titles (e.g., Include Service Name)

Problem Description:

The current CheckMK integration in Zammad defaults to creating tickets with the title format "$host is $state". For alerts related to a specific service, this title is often not informative enough. When many tickets arrive simultaneously (e.g., during infrastructure issues), users have to open each individual ticket to see which service on which host is affected. This significantly slows down triage and reduces clarity in the ticket overview.

Current Workaround & Its Drawbacks:

We have addressed this problem for ourselves by manually modifying the /opt/zammad/app/controllers/integration/check_mk_controller.rb file. The code now checks if params[:service] is present and creates the title accordingly:

 title = if params[:service].present?
           # Format with service: "Service on Host is State"
           "#{params[:service]} on #{params[:host]} is #{params[:state]}"
         else
           # Format without service: "Host is State"
           "#{params[:host]} is #{params[:state]}"
         end

While this workaround functions, it has significant disadvantages:

  1. Update Problem: This manual change is overwritten with every Zammad update.
  2. Maintenance Effort: We have to manually re-apply the change after each update and pin the zammad package using dnf versionlock (or apt-mark hold) to prevent accidental overwrites, which complicates the update process in general.

Proposed Solution(s):

To address this issue sustainably and for all users, we propose making the CheckMK integration more flexible:

  1. Evaluate a title Parameter: The most straightforward solution would be for the integration to evaluate an explicitly transmitted title parameter from the CheckMK notification. Currently, the integration seems to use parameters like host, service, state, event_id, text, but a passed title appears to be ignored. If this parameter were evaluated, users could control the title format directly within CheckMK (e.g., via Custom Notifications). Question: Is there a specific reason why a title parameter is currently not evaluated?

  2. Configurable Title Template in Zammad: Alternatively, or additionally, a field for a title template could be introduced in the CheckMK integration settings within the Zammad UI. Administrators could define their desired title format using placeholders (e.g., %service%, %host%, %state%, %text%, etc.). Example: %service% on %host% is %state%.

  3. Improved Default Title: At the very least, it would be a significant improvement if the default title automatically included the service name when present (similar to our workaround).

Benefits of the Proposed Solution:

  • Faster Triage: Service-related issues are immediately identifiable from the ticket title.
  • Better Overview: The ticket list becomes more informative.
  • Reduced Maintenance Effort: No more manual modifications of the controller file are necessary.
  • Smoother Updates: No more conflicts with package management and manual changes.
  • Increased Flexibility: Administrators can adapt titles to their specific needs (especially with solution 1 or 2).

We believe that more flexible title formatting would significantly enhance the CheckMK integration in Zammad.

2 Likes