Ad Widget

Collapse

Dynamically associate dependent item with host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vps-eric
    Junior Member
    • Jun 2020
    • 4

    #1

    Dynamically associate dependent item with host

    I am writing an application that runs on a single server, which regularly reaches out to many hosts (all tracked in Zabbix) and performs a task. The task has metrics for each host (e.g. run time for host A, run time for host B, run time for host C...) as well as potential error messages (e.g. error code E-14 with message string "task failed for reason xyz" on host A, success on hosts B and C). Ideally, I'd like the metrics and error messages for each host to be associated with each host. For example, if host A has a run time metric exceed a threshold, host A should have a trigger in alarm despite the fact that the data came from the Zabbix agent on my main "orchestration" server. Here's what I'm thinking:

    - Track the orchestration server as a host in Zabbix
    - Create an item under the orchestration host that grabs JSON through a UserParameter which is updated by the scheduled task every minute
    Example JSON:
    Code:
    {
      "host_A": {
        "run_time": 872,
        "success": false,
        "error_code": "E-14",
        "error_msg": "task failed for reason xyz"
      },
      "host_B": {
        "run_time": 23,
        "success": true
      },
      // ...
    }
    - Create dependent items for the run_time, success, error_code, error_msg... fields and create triggers for each dependent item. For example, the run_time field of host_A would be in alarm (above example threshold 100) as well as the success field.
    - Associate the dependent item for the respective host. In other words, the dependent item for run_time under host_A, would be an item applied to host A in Zabbix. If I browse to "Latest Data" on host A, I will see the run_time value. This is where my question is.

    Is this possible? Otherwise, is there a better way to do this, or a better tool to use? I haven't written anything yet, so the JSON schema, etc. can be changed.

    Thanks!
Working...