diff --git a/docs/Integration---Alert-Topic-Handler.md b/docs/Integration---Alert-Topic-Handler.md deleted file mode 100644 index 01fb82ca24d96145187d2c55a3aeafda1517ca6a..0000000000000000000000000000000000000000 --- a/docs/Integration---Alert-Topic-Handler.md +++ /dev/null @@ -1,121 +0,0 @@ -<!-- -// © University of Southampton IT Innovation Centre, 2018 -// -// Copyright in this software belongs to University of Southampton -// IT Innovation Centre of Gamma House, Enterprise Road, -// Chilworth Science Park, Southampton, SO16 7NS, UK. -// -// This software may not be used, sold, licensed, transferred, copied -// or reproduced in whole or in part in any manner or form or in or -// on any media by any person other than in accordance with the terms -// of the Licence Agreement supplied with the software, or otherwise -// without the prior written consent of the copyright owners. -// -// This software is distributed WITHOUT ANY WARRANTY, without even the -// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -// PURPOSE, except where stated in the Licence Agreement supplied with -// the software. -// -// Created By : Nikolay Stanchev -// Created Date : 09-08-2018 -// Created for Project : FLAME ---> - -# **FLAME - Integration of alerts, topics and handlers** - -#### **Authors** - -|Authors|Organisation| -|---|---| -|[Nikolay Stanchev](mailto:ns17@it-innovation.soton.ac.uk)|[University of Southampton, IT Innovation Centre](http://www.it-innovation.soton.ac.uk)| - - -#### Description - -This document describes the step to follow in order to reproduce a full integration of a Kapacitor alert, -topic and handler. The alert handler is a HTTP POST handler, which posts data to a test HTTP server. The -server expects only POST messages and simply logs any request content that it receives into a file -(***/var/log/alert-test.log***). The scenario was used to manually test the integration of alerts, topics and handlers in Kapacitor. - - -#### Steps to reproduce the integration - -* Set up and ssh into the *default* virtual machine with the usual commands: -```bash -vagrant up -vagrant ssh -sudo su -``` - -* Create the *clmc-service* container: -```bash -/vagrant/scripts/test/fixture.sh create -f /vagrant/src/test/clmctest/rspec.json -c clmc-service -lxc-attach -n clmc-service -``` - -* Navigate to the alerts folder start the HTTP server - the server listens to localhost - connections on port 9999: -```bash -cd /vagrant/src/test/clmctest/alerts -python3 http_server.py > /dev/null 2>&1 & -``` - -* (Optional) Verify the server is running - should return ***SUCCESSFUL GET REQUEST*** -in the response body: -```bash -curl http://localhost:9999/ -``` - -* Add a new alert in Kapacitor that will trigger an alert every 10s and enable the task: - ```bash -kapacitor define alert_id -tick alert_example.tick -kapacitor enable alert_id -``` - -* Verify the task and the topics were created: -```bash -kapacitor list tasks -kapacitor list topics -``` - -**N.B.** The topic will be created once the first alert has been triggered, -hence you might have to wait a few seconds for the task to trigger an alert. - -* Subscribe to the created topic with id ***http_topic***: -```bash -kapacitor define-topic-handler handler_example.yaml -``` - -* (Optional) Verify the topic handler was created: -```bash -kapacitor show-topic-handler http_topic handler_id -``` - -* Verify the log file has been created and is populated with content: -```bash -cat /var/log/alert-test.log -``` - -* Tear down the test scenario by killing the http server, deleting the log file and removing the alert, topic and handler: - -*find the PID of the http server* -```bash -ps -ef | grep http_server -``` - -*kill the server* -```bash -kill <PID> -``` - -*remove the log file* -```bash -rm /var/log/alert-test.log -``` - -*remove the alert, handler and topic in kapacitor* -```bash -kapacitor delete tasks alert_id -kapacitor delete topic-handlers http_topic handler_id -kapacitor delete topics http_topic -```