Ad Widget

Collapse

Honeycomb: visualize hosts with problems (Zabbix 7.0.8)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bertus_Brutalis
    Junior Member
    • Jul 2018
    • 9

    #1

    Honeycomb: visualize hosts with problems (Zabbix 7.0.8)

    Hello all,

    I'd like to add a honeycomb widget to a dashboard, showing all hosts in a host group and then color them by open problems (0 = green, 1 = yellow, >5 - red for instance). I can get the first part going, by just adding one item for an entire host group, but that is only part of the solution. I don't want to check on one item but on the total number of (open) problems for each host. I don't see an item to use for that, and I can't select a suitable widget as input for the honeycomb either.
    Seems like something more users would like to visualize in this way, so hopefully someone can point me in the right direction.
  • Bertus_Brutalis
    Junior Member
    • Jul 2018
    • 9

    #2
    Anybody? The goal would be to base a honeycomb widget on the number of active triggers for a host group.

    Comment

    • grego
      Junior Member
      • Mar 2025
      • 1

      #3
      I would also like this functionality.

      Comment

      • NiceRath
        Junior Member
        • Oct 2020
        • 1

        #4
        Yeah that would be great to get an overview over a large amount of servers.
        Maybe also a way to sort them by highest>lowest trigger prio (as the ones without any issues are not that important..)

        The only way I could think of achiving something like this currently is to add zabbix-items that query the zabbix-database: (one by host)
        * OCBC checks
        * Query starting-point (might be outdated)

        Comment

        • lmonasterio
          Member
          • May 2021
          • 34

          #5
          Hi! I also want the same, so i decide to do this:

          Create a template with metrics from API. In this case, for active problems
          {
          "jsonrpc": "2.0",
          "method": "trigger.get",
          "params": {
          "host": "{HOST.HOST}",
          "only_true": true,
          "countOutput": true
          },
          "id": 1
          }

          Then create a honeycomb widget, but it wil very usefull to have the chance to link to problems page...
          Hope it may works for you.
          My regards

          Comment

          • bigboypantshelpedthankyou
            Junior Member
            • Mar 2026
            • 1

            #6
            Hi all,

            I got this working using a Script Item in a template. Here's my solution:

            The Problem: The Honeycomb widget needs a numeric item per host to color the cells by severity. There's no built-in item for "highest active problem severity". Also, {HOST.ID} doesn't resolve reliably in HTTP Agent request bodies.

            The Solution: Create a template with a Script Item that queries the Zabbix API in two steps: first resolve the host name to a host ID, then fetch the highest problem severity.

            Step 1: Create a Template (e.g. "Template Problem Severity Check")

            Step 2: Add a Script Item with these settings:

            Tabelle kopieren
            Type Script
            Key problem.severity.check
            Type of information Numeric (unsigned)
            Update interval 1m
            Parameters:
            hostname {HOST.HOST}

            Script:

            Code:
            var req = new HttpRequest();
            req.addHeader('Content-Type: application/json-rpc');
            
            var url = '{$ZABBIX_API_URL}';
            var token = '{$ZABBIX_API_TOKEN}';
            var hostname = JSON.parse(value).hostname;
            
            // Step 1: Resolve hostname to hostid (HOST.ID doesn't work in script items) var body1 = JSON.stringify({
                          "jsonrpc": "2.0",
                           "method": "host.get",
                            "params":
                                           { "filter": {"host": [hostname]},
                                             "output": ["hostid"] },
                             "auth": token,
                              "id": 1
            });
            
            var resp1 = JSON.parse(req.post(url, body1));
            if (!resp1.result || resp1.result.length === 0) return 0;
            var hostid = resp1.result[0].hostid;
            
            // Step 2: Get highest severity of active problems
            var body2 = JSON.stringify({
                       "jsonrpc": "2.0",
                       "method": "problem.get",
                       "params":{
                                     "hostids": [hostid],
                                      "output": ["severity"],
                                      "recent": false,
                                       "sortfield": "severity",
                                       "sortorder": "DESC",
                                       "limit": 1
                   },
            "auth": token,
            "id": 2
            });
            
            var resp2 = JSON.parse(req.post(url, body2));
            if (!resp2.result || resp2.result.length === 0) return 0;
            return parseInt(resp2.result[0].severity);
            ​



            Step 3: Set Template Macros:
            Step 4: Link the template to all hosts you want to monitor.

            Step 5: Configure the Honeycomb Widget:
            • Item pattern: problem.severity.check
            • Host groups: select your groups
            • Thresholds:
              • 0 = Green (no problems)
              • 1 = Light blue (Information)
              • 2 = Yellow (Warning)
              • 3 = Orange (Average)
              • 4 = Red-Orange (High)
              • 5 = Red (Disaster)
            • Disable "Colour interpolation" for clean colors

            Important notes:
            • {HOST.ID} does not resolve in Script Item bodies in Zabbix 7.0, so we use {HOST.NAME} with host.get as a workaround
            • The item must be Numeric (unsigned), not Text — otherwise the Honeycomb thresholds won't work
            • Create an API token under Administration → General → API tokens with minimal permissions (read-only host + problem access is sufficient)

            Hope this helps everyone looking for this functionality!

            Comment

            Working...