Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-5323

Teams Adaptive Card transport (teamsadaptiveflow): header coloured by alert state, restructured layout

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • Alerting
    • None

    Description

      Summary

      A redesigned Adaptive Card for the teamsadaptiveflow transport (Teams via Power Automate workflow). The card header is coloured by alert state: red for alerts and reminders, green for recovery/OK, blue for anything else (for example syslog/info). The content is restructured so the important part is readable at a glance.

      Patch: 06-teams-adaptive-card.patch (attached). Apply from the Observium root with patch -p1 < 06-teams-adaptive-card.patch. It was built against trunk SVN BASE and applies cleanly. Only includes/transports/teamsadaptiveflow.inc.php changes; the legacy teams MessageCard transport is untouched.

      What changes

      • State-driven colour, with no code. The transport's preprocessing.field_transforms maps ALERT_STATE to two new tags:
        • CARD_STYLE: container style attention, good or accent.
        • CARD_COLOR: TextBlock colour Attention, Good or Accent.
        • ALERT and ALERT REMINDER map to red; RECOVER and OK map to green; the default is blue.
      • Layout:
        • Full-width card (msteams.width = Full).
        • Coloured header: emoji + state name on the left, severity on the right.
        • Alert message in large bold text, with "hostname · entity" underneath.
        • Fact sets: Entity / Metrics / Duration, then Device / Hardware / Uptime.
        • Subtle footer: "Observium · alert name · timestamp".
        • Action buttons: device, Open Entity, Alert Details.

      Notes for maintainers

      • %MESSAGE% is always empty in the preprocessing path, so the card deliberately doesn't use it.
      • This is a design proposal. Happy to adjust colours or layout, or to make it an alternative template instead of replacing the current one.
      • Testing tip: there is no "test contact" command. Calling notify_send('teamsadaptiveflow', [...]) from a small PHP script that includes includes/observium.inc.php and html/includes/functions.inc.php (the latter is needed for generate_device_url()) renders a real card.

      Testing

      • Verified in Microsoft Teams through a Power Automate workflow that posts the card to a channel.
      • php -l clean.

      Attachments

        Activity

          People

            adama Adam Armstrong
            rebeluca Luca Rebellato
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: