Skip to content

Zabbix

Send Zabbix problems, recoveries and acknowledgements to Argavon with the Argavon webhook media type.

Zabbix has no built-in Argavon format, so Argavon ships a media type: a small script that Zabbix runs for each notification. It works with Zabbix 6.0 and 7.0.

Before you start

  • A Argavon source of type zabbix and its token. Create it on Integrations → Zabbix → Connect Zabbix, or see Create a source.
  • Zabbix admin rights (media types, users, actions).
  • The Zabbix server must reach https://argavon.com.com.

1. Get the media type file

Download it from Integrations → Zabbix → Download Argavon media type (Zabbix 6.0 / 7.0), or from https://argavon.com.com/integrations/neuroops-zabbix.yaml.

The same file is in the repository at deploy/zabbix/neuroops-zabbix.yaml. Its script is deploy/zabbix/neuroops-webhook.js; build-media-type.py rebuilds the YAML from it.

2. Import it

In Zabbix: Alerts → Media types → Import, and choose the file. A media type named Argavon appears.

3. Set its parameters

Open the Argavon media type. You must change two parameters:

Parameter Set it to
url https://argavon.com.com/api/v1/ingest/zabbix
token Your source token (replace <your source token>)

Optional:

Parameter Meaning
http_proxy Proxy for the request to Argavon. Empty means no proxy.
zabbix_url Defaults to the global macro {$ZABBIX.URL}. Set that macro to your Zabbix frontend address to get Open in Zabbix links on Argavon alerts.

Leave every other parameter as it is. They pass Zabbix macros to the script:

Parameter Macro
event_id {EVENT.ID}
event_value {EVENT.VALUE}
event_status {EVENT.STATUS}
event_name {EVENT.NAME}
event_nseverity {EVENT.NSEVERITY}
event_opdata {EVENT.OPDATA}
event_date {EVENT.DATE}
event_time {EVENT.TIME}
event_tags_json {EVENT.TAGSJSON}
event_update_status {EVENT.UPDATE.STATUS}
event_update_action {EVENT.UPDATE.ACTION}
event_update_message {EVENT.UPDATE.MESSAGE}
event_update_date {EVENT.UPDATE.DATE}
event_update_time {EVENT.UPDATE.TIME}
user_fullname {USER.FULLNAME}
trigger_id {TRIGGER.ID}
trigger_name {TRIGGER.NAME}
trigger_hostgroup_name {TRIGGER.HOSTGROUP.NAME}
host_host {HOST.HOST}
host_name {HOST.NAME}
host_ip {HOST.IP}
item_lastvalue {ITEM.LASTVALUE1}

The media type timeout is 10 seconds. The script sends the token as Authorization: Bearer <token>.

4. Create a Argavon user in Zabbix

Create a dedicated user, for example neuroops:

  1. Put it in a user group with read access to the host groups you want sent.
  2. Under Media, add Argavon to it. The "send to" value is not used by the script. Zabbix requires a Send to value; Argavon does not use it, so enter anything (for example neuroops).

Use a dedicated user, not a person's account: Zabbix never sends update notifications to the user who made the update. If your own account received the notifications, your acknowledgements would never reach Argavon.

5. Create the action

Alerts → Actions → Trigger actions → Create action:

  1. Add a condition, for example Trigger severity is greater than or equals Warning.
  2. Under Operations, add: send to the neuroops user, via Argavon.
  3. Under Recovery operations, add the same.
  4. Under Update operations, add the same.

All three are needed: problems open incidents, recoveries close them, updates put acknowledgements on the timeline.

6. Test it

Either:

  • click Test next to the source on the Argavon Integrations page. It sends a sample problem ([Test] High CPU utilization (over 90% for 5m) on db01, service billing), or
  • click Test on the media type in Zabbix.

The Zabbix Test button sends the macros unexpanded (for example the literal text {EVENT.ID}). Argavon recognizes that and answers without creating an incident:

{"status":"test_received","message":"Argavon received the Zabbix test message. Real problems will create incidents."}

The script returns OK to Zabbix. A real problem gets:

{"status":"accepted","result":"problem"}

result is problem, recovery or update.

How Zabbix fields are mapped

Argavon field Taken from
Service A trigger or host tag named service. Else the host group ({TRIGGER.HOSTGROUP.NAME}). Else the host ({HOST.HOST}).
Resource {HOST.HOST}
Environment A tag named env or environment
Severity {EVENT.NSEVERITY} (table below)
Title {EVENT.NAME}, else {TRIGGER.NAME}
Message {EVENT.OPDATA}
Start time {EVENT.DATE} {EVENT.TIME} for a problem, read in the Zabbix server's time zone (the script sends its UTC offset). Times more than 7 days old or more than 5 minutes ahead are replaced with the receive time.
Identity {EVENT.ID}. A problem and its recovery share it, so they update one alert.
Zabbix severity Argavon severity
Disaster (5) critical
High (4) high
Average (3) medium
Warning (2) low
Information (1) info
Not classified (0) info

Labels on the alert: alertname (trigger name), trigger_id, host, host_name, host_ip, host_group, event_time, opdata, zabbix.item_value ({ITEM.LASTVALUE1}), zabbix.url (link back to the event), and one tag.<name> label per Zabbix tag.

Tip: add a service tag to triggers or hosts (for example service = billing) so incidents group by service. A host in several groups otherwise gets the group text Zabbix sends as its service. For a host in several groups, Zabbix expands {TRIGGER.HOSTGROUP.NAME} to all of them, comma-separated.

Problems, recoveries and acknowledgements

Problem ({EVENT.VALUE} = 1): stored as a firing alert and correlated into an incident.

Recovery ({EVENT.VALUE} = 0, or {EVENT.STATUS} = RESOLVED): marks the alert recovered. When every alert in the incident has recovered and stays quiet for the quiet period (5 minutes by default), Argavon resolves the incident. See auto-close.

Update ({EVENT.UPDATE.STATUS} = 1: acknowledge, comment, severity change and so on): creates no alert and changes nothing on the incident except its timeline, which gets a line like:

Zabbix: Jane Doe acknowledged the problem: "looking at it"

If Zabbix sends Inaccessible user (the Argavon user may not see the person who made the update), the line says a Zabbix user.

Zabbix retries failed sends. The script sends an X-Idempotency-Key per event and state (and per update time for updates), so a retry is processed once.

If it does not work

Check the media type log in Zabbix (Reports → Action log) and the source on the Argavon Integrations page. The action log is under Reports → Action log.

You see Fix
Argavon webhook failed: set the "url" parameter to your Argavon Zabbix endpoint url must start with http.
Argavon webhook failed: set the "token" parameter to your Argavon source token token is empty or still <your source token>.
Argavon returned HTTP 401: … The token is wrong, rotated, or the source was deleted.
Argavon returned HTTP 403: …source token not authorized for /ingest/zabbix The token belongs to a Prometheus, Grafana or OpenTelemetry source. Use a zabbix source.
Argavon returned HTTP 400: …trigger_id and host are required The action runs for something that is not a trigger event, or the macros did not expand. The payload is in the dead-letter queue.
Problems arrive but acknowledgements never do Add Update operations to the action, and send to a dedicated user, not your own account.
Incidents never close Add Recovery operations to the action.
No Open in Zabbix link Set the global macro {$ZABBIX.URL}.