Giter VIP home page Giter VIP logo

api-monitor's Introduction

API Monitor logo

API Monitor

A CLI program that help you check your endpoints by requesting the given servers and send a report message in any supported channel ( Telegram )



This is a CLI project that build with Laravel Zero

Features

  • Check API endpoints status.
  • Save the endpoints in sqlite database.
  • Provide a bin command so you can execute via terminal or schedule the execution in crontab.
  • Send a report message to the supported channels ( Telegram ).

Usage

  • Clone this repo:
git clone https://github.com/husseinferas/api-monitor && cd  api-monitor
  • Install the dependencies:
composer install
  • Setup env and databases:
cp .env.example .env
  • Edit .env file:
CONSUMER_KEY=[your-app-key]
DB_DATABASE=[your-sqlite-database-file-path]
DATA_SEED=[your-data-seed-file]

TELEGRAM_TOKEN=[your-telegram-token]
TELEGRAM_CHAT=[your-chat-id-which-chat-you-want-to-send]
  • Setup data seed:
cp data.example.php .data.php
  • Edit data.php and add your endpoints
return [
    [
        'app' => 'app-name',
        'name' => 'endpoint-name',
        'url' => 'endpoint-url',
    ],
];
  • Seed the database:
php api-monitor migrate:fresh --seed 
  • Setup telegram channel:

    • Create a telegram bot and get your token using BotFather
    • Add your telegram bot to channel or group where you what it to send the reports (it can send it to you directly)
    • Get the chat id using this command curl https://api.telegram.org/bot$[TELEGRAM_BOT_TOKEN]/getUpdates
  • Now you can test the application using this command:

php api-monitor check

Note: you can add this command to crontab and setup a schedule for monitoring.

Contributing

Pull requests are welcome. For major changes.

License

API Monitor is an open-source software licensed under the MIT license.

api-monitor's People

Contributors

fareedalbandar avatar

Watchers

 avatar

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.