Skip to content
No description or website provided.
JavaScript
Find file
Latest commit 29a6406 @cressie176 cressie176 Update README.md

README.md

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.
{
    "plugins": {
        "installed": [
            "defcon-rest-gateway"
        ]
    }
}
  1. Restart defcon (you can do this via kill -s USRSIG2 <pid> 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\" }"
Something went wrong with that request. Please try again.