Skip to content

cdotte/NicAlarming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#NicAlarming A monitoring solution for NicLabs projets with Prometheus, Grafana, cAdvisor, NodeExporter, PostgresExporter, NginxExporter, Blackbox and alerting with AlertManager, Bot Telegram.

Deploy Instructions

Cloning repositories:

  1. Create a folder "Prometheus"

  2. Prometheus

    $ cd Prometheus
    $ git clone https://github.com/prometheus/prometheus
  3. AlertManager

    $ cd Prometheus
    $ git clone https://github.com/prometheus/alertmanager
  4. Prometheus bot

    $ cd Prometheus
    $ git clone https://github.com/inCaller/prometheus_bot
  5. Grafana

    # Download and unpack Grafana from binary tar (adjust version as appropriate).
    $ cd Prometheus
    $ curl -L -O https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0.linux-x64.tar.gz
    $ tar zxf grafana-2.5.0.linux-x64.tar.gz
  6. NicAlarming

    $ git clone https://github.com/cdotte/NicAlarming.git
  7. Copy all files of NicAlarming folder and paste into Prometheus (Yes to replace all files that already exists)

Dependencies

  • GO

  • Docker

  • You have to install with sudo go get $dependencies where $dependencies:

      github.com/gin-gonic/gin
      github.com/gin-gonic/gin/binding
      github.com/go-telegram-bot-api/telegram-bot-api 
      gopkg.in/yaml.v2
    

To deploy NicAlarming:

  1. Edit run.sh, in the file:

    Edit variable "GO" with yout GO path directory

    Edit variable PostgresURL: edit the database name, the user, the password, hostname and the port with our values. For more info you can visit the link above (PostgresExporter).

    Edit NginxURI with your Nginx status page here more information

  2. To configure bot to alert with telegram:

    Edit prometheus_bot/config.yaml with the token of your telegram bot.

    Edit alertmanager/config.yaml chatID with the ChatID of your group in telegram.

    Add grafana dashboards link to your telegram group to quickly visit if something goes wrong.

  3. Edit prometheus/prometheus.yml scrape_configs with your ip adresses (I recommend check out the ip adress of the containers using docker inspect --format '{{ .NetworkSettings.IPAddress }}' container_name_or_id and local ip adress) or edit run.sh to link your containers.

  4. Edit blackbox_exporter/blackbox.yml with your end-points to monitoring and edit prometheus config file. here more information

  5. Start the monitoring solution with

$ sudo ./run.sh start

Content

run.sh

Bash script to start, restart, remove, upgrade and stop the application. The usage is:

# To start, restart, stop, delete, upgrade
$ ./run.sh start | restart | stop | delete | upgrade

Dashboards

You have to import in grafana all dashboards available in a folder "dashboards". Below there is more information.

Thanks to dackprom for the darshboards to Grafana's imports.

Others

  1. If you want to create others rules for alarming. You have to visit this

  2. If you want to change existing rules for alarming. You have to change the next files prometheus/host.rules, prometheus/targets.rules, prometheus/postgres.rules, prometheus/containers.rules, prometheus/host.rules.

  3. If you want to see Dashboards (Grafana) in a specific range of time. You have to visit this

Logic of NicAlarming

About

A monitoring solution for NicLabs projets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages