Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xandkar/sensu-erlang
Erlang API to send external check result to Sensu client.
https://github.com/xandkar/sensu-erlang
erlang sensu sensu-client
Last synced: 28 days ago
JSON representation
Erlang API to send external check result to Sensu client.
- Host: GitHub
- URL: https://github.com/xandkar/sensu-erlang
- Owner: xandkar
- License: mit
- Created: 2015-03-10T19:27:59.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-04-09T11:55:38.000Z (over 9 years ago)
- Last Synced: 2024-08-15T00:32:36.583Z (3 months ago)
- Topics: erlang, sensu, sensu-client
- Language: Erlang
- Homepage:
- Size: 195 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/ibnfirnas/sensu-erlang.svg?branch=master)](https://travis-ci.org/ibnfirnas/sensu-erlang)
# sensu-erlang
Erlang API to send external check result to Sensu client### Defaults
- host: `"localhost"`
- port: `3030`
- protocol: `{udp, {udp_src_port, 3031}}`### Examples
Note that, in order to not pollute your namespace, public records are
fully-qualified and placed in dedicated include files.```erlang
-include_lib("sensu/include/sensu_check_result.hrl").
-include_lib("sensu/include/sensu_io_params.hrl").CheckResult =
#sensu_check_result
{ name = <<"lord.business.sanity_check">>
, output = <<"Everything is awesome!">>
, status = ok
},% Default IO parameters (see `include/sensu_io_params.hrl`):
{ok, {}} = sensu:send(CheckResult)% Custom host and UDP ports:
IOParams =
#sensu_io_params
{ dst_host = "example.local"
, dst_port = 4000
, protocol = {udp, {udp_src_port, 5000}}
},
{ok, {}} = sensu:send(CheckResult, IOParams)% TCP with default port and host:
{ok, {}} = sensu:send(CheckResult, #sensu_io_params{protocol = {tcp, {tcp_timeout, 5000}}})% TCP with existing socket:
{ok, {}} = sensu:send(CheckResult, #sensu_io_params{protocol = {tcp, {tcp_socket, Socket}}})
```