Coder Social home page Coder Social logo

n-erickson / knocknoc Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2.14 MB

Simple ping-based network monitoring and alerting solution.

Python 25.47% HTML 2.68% Dockerfile 3.18% Vue 64.82% JavaScript 3.84%
alert alert-messages alerting discord network network-monitoring noc noc-tool opsgenie pagerduty ping pingdom pinger python python3 slack slack-bot telegram-bot discord-bot slack-webhook

knocknoc's Introduction

knockNOC

knockNOC is a ping-based monitoring solution that does just what it says: pings endpoints and logs their response. It has a modifiable set of alerting metrics and is able to send alerts for non-response to a host of popular platforms.

Features

  • Monitor multiple endpoints (URLs or IP addresses)
  • Garbage "themes"
  • Pings
  • Configurable alerting system
  • RESTful API for ping data
  • Dockerized for easy deployment

Prerequisites

  • Docker
  • Docker Compose

Quick Start

  1. Clone the repository:
git clone https://github.com/N-Erickson/knockNOC.git
cd knockNOC

Modify the config.yaml file to add your endpoints and configure alerting (see Configuration section for details).

nano config.yaml

Build the Docker image:

docker-compose build

Start the application:

docker-compose up

Access the dashboard at http://localhost:5000

Configuration

Edit the config.yaml file to customize your endpoints and alerting settings. The file structure is as follows:

endpoints:
  - url: https://example.com
    display_name: Example Site
  - url: 192.168.1.1
    display_name: Local Router

ping_frequency: 60  # in seconds

alerting:
  enabled: true
  consecutive_failures_threshold: 3
  cooldown_duration: 300  # in seconds
  pagerduty:
    enabled: false
    api_key: YOUR_PAGERDUTY_API_KEY
    service_id: YOUR_SERVICE_ID
  opsgenie:
    enabled: false
    api_key: YOUR_OPSGENIE_API_KEY
  slack:
    enabled: false
    webhook_url: YOUR_SLACK_WEBHOOK_URL
  telegram:
    enabled: false
    bot_token: YOUR_TELEGRAM_BOT_TOKEN
    chat_id: YOUR_TELEGRAM_CHAT_ID
  discord:
    enabled: false
    webhook_url: YOUR_DISCORD_WEBHOOK_URL

Alerting Configuration

enabled: Set to true to enable alerting, false to disable.

consecutive_failures_threshold: Number of consecutive failures before an alert is triggered.

cooldown_duration: Time (in seconds) to wait before sending another alert for the same endpoint.

Each alerting service (PagerDuty, OpsGenie, Slack, Telegram, Discord) can be individually enabled or disabled.

Provide the necessary API keys or webhook URLs for the services you enable.

API

knockNOC provides a RESTful API for accessing ping data:

Endpoint: http://localhost:5000/api/pings Method: GET Response: JSON array of endpoint statuses and recent pings

Development

To run the application in development mode:

Install Python dependencies:

pip install -r requirements.txt

Install Node.js dependencies:

cd frontend
npm install

Run the Flask development server:

python3 run.py

In another terminal, run the Vue.js development server:

cd frontend
npm run serve

Access the application at http://localhost:5000

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

Docker Image

docker pull ghcr.io/n-erickson/knocknoc:main
docker run -p 5000:5000 ghcr.io/n-erickson/knocknoc:main

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.