abremora / monytor

A configurable monitoring tool.
MIT License
6 stars 4 forks source link
csharp dotnet-core monitoring ravendb

Build status

Monytor

Monytor is a configurable monitoring tool written in .NET Standard. Most services run with .NET Core. But to use Windows specific functions (e.g. Performance Counter) there is a version for .NET Framework available, too.

Overview

Monytor runs "Collectors" which are responsible for collecting data. The result will be saved in a database (RavenDB) as a time series. A bunch of collectors is already available but can easily extended. All collectors can be scheduled independently with many arguments and can be extended with "verifiers" and "notifications".

Presentation

A dashboard visualizes all collected data. Therefore, Monytor provides a Web API to access all time series.

Monytor Dashboard Monytor Collector Console

Requirements

Install

Build, run & publish

Run the code

To collect data run Monytor

cd monytor
dotnet run

Run the server

cd monytor.webapi
gulp
dotnet run

Publish

You can publish Monytor and Monytor.WebApi with the script:

publish.cmd

Run published Monytor & Monytor.WebApi

After publishing the services, you can run them all with:

run.cmd

Setup & run Monytor.WebApi only

Run Monytor.WebApi on localhost with port 55555

cd Monytor.WebApi
dotnet Monytor.WebApi.dll --server.Urls "http://localhost:55555"

Enable remote access for Monytor.WebApi

cd Monytor.WebApi
dotnet Monytor.WebApi.dll --server.Urls "http://*:55555"

Dashboard

By default the Web API is accessible under http://localhost:5000/api/serie. The dashboard can be display under http://localhost:5000

Configuration

Collectors

Before you can run Monytor you have to update the "collectorconfig.json" which should be already available. A default configuration can be generated by calling

cd monytor
dotnet run --CreateDefaultConfig

Typically a config looks like that:

{
  "Notifications": [
    {
      "$type": "Monytor.Implementation.Notifications.EmailNotification, Monytor.Implementation",
      "Id": "Monytor.EmailNotification",
      "Smtp": "smtp.example.com",
      "Port": "587",
      "UseDefaultCredentials": false,
      "User": "YOUR_USERNAME",
      "Password": "YOUR_PASSWORD",
      "EnableSsl": true,
      "To": [
        "admin@example.com"
      ],
      "From": "alert@example.com",
      "SubjectPrefix": "ALERT: "
    }
  ],
  "Collectors": [
    {
      "$type": "Monytor.Implementation.Collectors.RavenDb.AllCollectionCollector, Monytor.Implementation.Collectors.RavenDb",
      "Source": {
        "Url": "http://localhost:8080",
        "Database": "Monytor"
      },
      "GroupName": "Collection",
      "StartingTimeDelay": "00:00:00",
      "RandomTimeDelay": "00:00:00",
      "PollingInterval": "01:00:00",
      "OverlappingReccuring": false,
      "StartingTime": null,
      "EndAt": null,
      "Priority": 3,
      "Verifiers": [
        {
          "$type": "Monytor.Implementation.Verifiers.SerieChangeVerifier, Monytor.Implementation",
          "Group": "Collection",
          "Tag": "Serie",
          "TimeInterval": "01:00:00",
          "SerieRepository": null,
          "Notifications": [
            "Monytor.EmailNotification"
          ]
        }
      ]
    }
  ]
}

Available Collectors

Currently the following collectors are available:

FAQ