Zabbix

Table of Contents

Zabbix

py-zabbix

py-zabbixをインストール

$ pip install py-zabbix

サンプルコード

from pyzabbix import ZabbixMetric, ZabbixSender

ZABBIX_SERVER = 'zabbix.example.com'
ZABBIX_PORT = 10051

logs = []
logs_append = logs.append

host = 'example.com'
line = 'this is test log'
timestamp =  1542070841

logs.append(ZabbixMetric(
    host,
    'key',
    line,
    timestamp
))
sender = ZabbixSender(
zabbix_server=ZABBIX_SERVER, zabbix_port=ZABBIX_PORT)
sender.send(logs)

Validate