0.2.1 • Published 10 years ago

defcon-rest-gateway v0.2.1

Weekly downloads
4
License
ISC
Repository
github
Last release
10 years ago

DEFCON REST Gateway Plugin

Prerequisits

  1. DEFCON

Installation

  1. '''cd $DEFCON_INSTALL_DIR'''
  2. '''npm install defcon-rest-gateway'''
  3. '''Enable and configure 'defcon-rest-gateway' in your DEFCON configuration file, e.g. '''json { "plugins": { "installed": "defcon-rest-gateway" } } '''
  4. Restart defcon (you can do this via '''kill -s USRSIG2 ''' if you want zero downtime)

Usage

Notifying DEFCON of events via the REST Gateway Plugin requires you to POST a json object to http://:/plugin/rest-gateway/api/v1/event. The json object should be as follows

{
    "system": "entertainment-portal",
    "group": "www",                                // optional
    "type": "error",
    "environment": "production",                   // optional
    "host": "192.168.1.100",                       // defaults to 'x-forwarded-for' header or remote address 
    "message": "Gateway timeout 504",              // optional
    "severity": "1",                               // 1-5, defaults to 1
    "link": "http://www.entertainment-portal.com"  // optional
}"

Testing from the command line

curl -i -X POST localhost:8080/plugin/defcon-rest-gateway/api/v1/event -H "Content-Type: application/json" -d "{\"system\": \"entertainment-portal\", \"group\": \"www\", \"type\": \"error\", \"environment\": \"production\", \"message\": \"Gateway timeout 504\", \"severity\": \"3\", \"link\": \"http://www.entertainment-portal.com\" }"
0.2.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago