Skip to content

abremora/monytor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • .NET Core 2.0
  • RavenDB Server 3.5 (Link)
  • Node.js (Link)
  • gulp (Link)

Install

  • Install Node.js
  • Install gulp.js
npm install -g gulp

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:

  • AllCollectionCollector
    • Counts all documents in every collection for a RavenDB
  • CollectionCollector
    • Counts all documents in a collection for a RavenDB
  • StartingWithCollector
    • Counts all documents in a RavenDB starting with a document id
  • SystemInformationCollector
    • Counts several metrics of the current system
  • RestApiCollector
    • Calls REST Api. JsonPath parses results.
  • PerformanceCounterCollector
    • Calls Performance Counter (Windows OS only)

FAQ

  • Gulp for Monytor.WebApi in Visual Studio (Windows) fails:
    • Ensure that gulp is installed and the $(PATH) variable in Tools -> Options -> Projects and Solutions -> Web Package Management -> External Web Tools is on top. See also: Link, Link

Releases

No releases published

Packages

No packages published