Giter Site home page Giter Site logo

forge-monitor's Introduction

Forge Monitor

Laravel Forge monitoring built with Laravel.

Running

You can run Forge Monitor with:

php artisan stat:mem

The available stat commands are:

  • stat:disk
  • stat:load
  • stat:mem

Stats

Forge Monitor provides alerting for several monitor types:

  • cpu_load - CPU Load (%)
  • disk - Free Disk Space (%)
  • free_memory - Free Memory (%)
  • used_memory - Used Memory (%)

Monitors work by checking for a threshold being met for a consecutive amount of time. Once the threshold has been met over a specified time period, Forge will be notified.

For the disk monitors, this threshold will only need to be met once at any given interval as the change rate is less frequent.

Data Storage

Forge Monitor writes to a local SQLite database at ./database/database.db, giving us a history of recent stat points.

After a sample of the stat has been taken, we will check whether each configured monitor of the stat type has been met. This can be done with SQL queries executed against the DB.

At the end of collecting each sample, we will clear out data older than a pre-determined period of time.

Config File Description

Forge Monitor uses a TOML based file for configuring monitors named .monitor. The monitor file needs to live either in the user's home directory or the root of the application.

Example configuration:

[monitor-1]
type = "disk"
operator = "gte"
threshold = 10 # %
token = "foobarbaz"

[monitor-2]
type = "free_memory"
operator = "lte"
threshold = 25
minutes = 5
token = "foobarbaz"

Forge will add a new [monitor-{id}] section for each configured monitor. Monitors are made up of:

  • Type
  • Operator
  • Threshold
  • Minutes (*)
  • Token

The minutes value is ignored for the disk monitor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.