/zabbix_sender

Zabbix trapper for sending data to Zabbix in pure Erlang

Primary LanguageErlangApache License 2.0Apache-2.0

zabbix_sender

Simple native Zabbix_sender for Erlang applications

Build Status

Getting Started

Building and compiling

rebar.config

{deps, [
    .....
    {zabbix_sender, ".*", {git, "https://github.com/stalkermn/zabbix_sender_.git", "master"}}
]}.

erlang.mk (Makefile)

This package is already in erlang.mk packages index. You can use it without specifying any references to original repositories

DEPS = zabbix_sender
Notice

Don't forget to include zabbix_sender name to your *.app.src OR reltool.config OR relx.config for properly including this lib to your release

Starting zabbix_sender

For starting using zabbix_sender

application:start(lager).
application:start(jiffy). % (Optional) if you want use jiffy instead of jsx (by default)
application:start(inets).
application:start(zabbix_sender)

OR

zabbix_sender:start()

OR if you have included properly to release, your zabbix_sender will be started automatically.

Usage

Your main module for any manipulation is a zabbix_sender_srv

Before starting we should specify properly configuration of the zabbix_server:

zabbix_sender_srv:start(Hostname :: string(), tcp_host(), tcp_port()) -> {ok, pid()}

OR if you want to use multiply hosts, try to start your sender:

zabbix_sender_srv:start(SenderName :: any(),  Hostname :: string(), tcp_host(), tcp_port()) -> {ok, pid()}.

Where SenderName is a name of this sender (will be used in future for sending data to zabbix)

Delivering metrics to zabbix: For zabbix_sender_srv:start/3

zabbix_sender_srv:send_packet(zabbix_sender_srv, [{key, value}]).
zabbix_sender_srv:async_send_packet(zabbix_sender_srv, [{key, value}]).
zabbix_sender_srv:send_msg(zabbix_sender_srv, key, value).
zabbix_sender_srv:async__send_msg(zabbix_sender_srv, key, value).

For zabbix_sender_srv:start/4

zabbix_sender_srv:send_packet(SenderName :: any(), [{key, value}]).
zabbix_sender_srv:async_send_packet(SenderName :: any(), [{key, value}]).
zabbix_sender_srv:send_msg(SenderName :: any(), key, value).
zabbix_sender_srv:async__send_msg(SenderName :: any(), key, value).

Contributing

All contributions are welcome: ideas, patches, documentation, bug reports, complaints, and even something you drew up on a napkin.

License

MIT