Alerta Integration

Prev Next

Introduction

With just one system you can monitor alerts from many other monitoring tools on a single screen. Alerta combines a JSON API server for receiving, processing, and rendering alerts with a simple, yet effective Alerta Web UI and command-line tool. Find Alerta documentation and Github link.

Integration Use case:

The Alerta monitoring system is a tool used to consolidate and de-duplicate alerts from multiple sources for quick ‘at-a-glance’ visualization. This integration pushes alerts data to the specified Alerta server as soon as the alerts are triggered in Catchpoint.

Pre-requisites

  • Ubuntu machine with root access. This machine will host the Alerta server to receive alerts from Catchpoint. It will also house the Alerta console and web UI to consume alerts details.
  • Python 3 and pip3 should be installed on the machine.
  • Catchpoint tests with alerts set. Triggers an alert to Alerta sever when a defined condition is meet.

Installation and Configuration

Install MongoDB:

  1. For Debian/Ubuntu, run:
    $ sudo apt-get install -y mongodb-org
    $ sudo mongod -f /etc/mongod.conf &

If apt-get can’t locate the mongodb-org metapackage package then follow these steps to add MongoDB package repository to apt sources list.

For other operating systems, see the installation steps on the MongoDB web site.

  1. Confirm if MongoDB is installed:
    $ mongo --eval 'db.runCommand({ connectionStatus: 1 })'

Expected result:

MongoDB shell version v4.4.10
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("3401a7c1-c522-4c51-95a6-3463ec0c833c") }
MongoDB server version: 4.4.10
{
        "authInfo" : {
                "authenticatedUsers" : [ ],
                "authenticatedUserRoles" : [ ]
        },
        "ok" : 1
}
  1. Check if MogoDB is running as a service:
    $ sudo service mongodb status

Expected result:

mongodb.service - An object/document-oriented database  
 Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-12-06 10:01:38 UTC; 5min ago
     Docs: man:mongod(1)
 Main PID: 2769 (mongod)
    Tasks: 23 (limit: 1140)
   CGroup: /system.slice/mongodb.service
           └─2769 /usr/bin/mongod --unixSocketPrefix=/run/mongodb --config /etc/mongodb.conf

Dec 06 10:01:38 ip-171-41-46-47 systemd[1]: Started An object/document-oriented database.

Install the Alerta Server:

To install the Alerta server:
$ pip3 install alerta-server
$ alertad run --port 8080

You should see something like:

* Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)

Install the Alerta CLI:

To install the Alerta command-line tool:
$ pip3 install alerta

Install the Web Console:

To install the web console:
$ wget https://github.com/alerta/alerta-webui/releases/latest/download/alerta-webui.tar.gz
$ tar zxvf alerta-webui.tar.gz
$ cd dist
$ python3 -m http.server 8000

browse to http://localhost:8000

Send some alerts:

To send an alert to the server through command line.
$ alerta send -r web01 -e NodeDown -E Production -S Website -s major -t "Web server is down." -v ERROR

Results:

Alerta results can be consumed through the console or if you have the web UI hosted. Once the web UI is hosted you can view the alerts using the URL.

mceclip0.png