Skip to content

Latest commit

 

History

History
55 lines (51 loc) · 1.58 KB

File metadata and controls

55 lines (51 loc) · 1.58 KB

ZabbixToClickhouseAlertIntegration


Clickhouse table

CREATE TABLE zabbix.events
(
    `Date` Date DEFAULT toDate(Clock), 
    `Clock` UInt32, 
    `RecoveryClock` UInt32, 
    `Eventid` UInt64, 
    `Name` String, 
    `Hosts` Array(String), 
    `Groups` Array(String), 
    `Tags` Array(String), 
    `Source` String,
    `Severity` String
)
ENGINE = ReplacingMergeTree(RecoveryClock)
PARTITION BY toISOWeek(Date)
ORDER BY Eventid


Installation:

  1. Go to alert script location
  2. Create venv for script python3 -m venv venv_click
  3. Activate venv and install clickhouse_client module
    pip install clickhouse-driver
    deactivate
    
  4. Download script and edit path to venv
  5. Add media type
  6. Add media to Super Admin user
  7. Add actions

Actions text:
Problem
Subject {EVENT.VALUE}
Message:

{"datetime":"{EVENT.DATE} {EVENT.TIME}","eventid":{EVENT.ID},"name":"{EVENT.NAME}","groups":"{TRIGGER.HOSTGROUP.NAME}","host":"{HOST.NAME}","tags":"{EVENT.TAGS}","source":"ZabbixSYSLOCAL","severity":"{EVENT.SEVERITY}"}


Recovery
Subject {EVENT.VALUE}
Message:

{"recoverydatetime":"{EVENT.RECOVERY.DATE} {EVENT.RECOVERY.TIME}","eventid":{EVENT.ID},"startdatetime":"{EVENT.DATE} {EVENT.TIME}","name":"{EVENT.NAME}","groups":"{TRIGGER.HOSTGROUP.NAME}","host":"{HOST.NAME}","tags":"{EVENT.TAGS}","source":"ZabbixSYSLOCAL","severity":"{EVENT.SEVERITY}"}


Screenshots