Giter Site home page Giter Site logo

nabeken / mikoi Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 4.0 28 KB

mikoi is a HAProxy's proxy protocol enabler for command line tools.

License: BSD 3-Clause "New" or "Revised" License

Go 92.80% Shell 1.86% Dockerfile 5.35%
go haproxy proxyprotocol proxies haproxy-proxy-protocol monitoring-plugins

mikoi's Introduction

mikoi

Go

mikoi is a HAProxy's proxy protocol enabler for command line tools.

It is designed to work to monitor ProxyProtocol enabled server with usual monitoring plugins such as nagios-plugins and sensu-plugins.

In normal situation, existing monitoring plugins can not monitor ProxyProtocol enabled server without modifications.

mikoi launches a proxy server lisening to an ephemeral port (dynamically allocated port) and forks a plugin with passing the port number to let the pluging connect to that port.

mikoi adds a ProxyProtocol header to traffic comes from a plugin and proxies to real server.

        +----------+
  +---> |  plugin  | forked by mikoi
  |     +----------+
  |       /|\   |
  |        |    |
  |        |   \|/
  |      +---------+            +----------+
  |      |         | <--------- |          |
  +----- |  mikoi  |            |  server  | (proxy protocol enabled)
         |         | ---------> |          |
         +---------+ w/ header  +----------+

Installation

Download from releases.

Or

go get -u github.com/nabeken/mikoi

Usage

$ mikoi -h
Usage:
  mikoi [OPTIONS]

Application Options:
  -H, --hostname=       host name
  -p, --port=           port number
  -t, --timeout=        connection times out (default: 10s)
  -V, --verbose         verbose
  -P, --proxyproto      use ProxyProto
      --proxyproto-src= Source address for ProxyProto

Help Options:
  -h, --help            Show this help message
$ mikoi \
  -P \
  -H smtp.example.com \
  -p 25 \
  -- /usr/lib/nagios/plugins/check_smtp -H 127.0.0.1 -p {} -w 0.5 -c 1.0

{} will be replaced with an ephemeral port that mikoi is listening to.

If you omit command line arguments for plugin, mikoi runs in proxy server mode:

$ mikoi -V -H smtp.example.com -p 25 -P
cmd args: []
mikoi is now running as proxy server mode
mikoi is now listening to 63568
mikoi is launching server

// You can connect to 63568 by any clients
$ telnet 127.0.0.1 63568

mikoi's People

Contributors

nabeken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mikoi's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.