Code Monkey home page Code Monkey logo

platypus's Introduction

Platypus

Simple realtime server monitoring

CircleCI https://img.shields.io/badge/demo-status.gmem.ca-black.svg https://img.shields.io/badge/frontend-gmemstr%2Fplatypus--react-blue.svg

Dependencies

go get github.com/gorilla/mux
go get github.com/gorilla/websocket
go get github.com/go-yaml/yaml
go get github.com/shirou/gopsutil

Usage

Master server:

go build -o platypus main.go
chmod +x platypus
./platypus

Client servers:

go build -o platypus_client client/client.go
chmod +x platypus_client
nano config.yml
# Input your secret key and master server IP here, secret key found on master server in .secret
# master: example.com
# secret: s3cr3tk3y
# End config
./platypus_client

Navigate to your master server and check out the stats.

Rewrite

Rewriting this from the ground up. Why did I do this in Python.

The goal of the rewrite is to move away from using Python for the entire stack and instead break things up into smaller chunks, maybe moving this to it's own GitHub / Gitlab org, which will allow it to be much more modular and open ended when it comes to what kind of information you want to monitor and how.

Steps

  1. Rewriting the core functionality, which is a basic stats dashboard and server management through an admin interface. We also want to rethink how to handle Active Online Reporting - websockets still seems like the best option for this but there's got to be a better way. Might opt for Go master server side as it's something I have experience in and should offer good performance etc.

  2. Rebuild the client based on the specifications of #1, and deciding the best way to build and distribute the package w/ configuration - I personally want to go with something we can compile into a very small package and ship with a master server-generated configuration file of some sort. Was thinking C++ might be a good option over Go size wise but there could be additional time overhead.

  3. Write a straightforward API both client (or "node") side, which would allow applications to construct and send custom messages to the master server, and master server side, which will handle said customer messages. This should be fairly straightforward once we have #1 and #2 complete.

  4. A plugin system - I don't really know what form this would take since it's pretty far down the line, but it's something to consider. Some sort of simple scripting language that we can easily write an interpreter for in Go for the master server and would expose various variables / functions.

platypus's People

Contributors

gmemstr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platypus's Issues

ModuleNotFoundError: No module named 'src.Config'

Above, the error when i trying install

C:>python setup.py
Traceback (most recent call last):
File "setup.py", line 2, in
from src.Config import Config
ModuleNotFoundError: No module named 'src.Config'

Plugin System

High level

Implement a plugin system within Platypus to allow modification of behavior and data handling through the use of an internal plugin API, which also disallows exposure of secrets. This would primarily be on the master node side, as custom clients would be preferred rather than implementing the same plugin system into the client.

Possibilities

  • Configuration-based plugins
    • Easier to implement code-wise
    • Lower barrier of entry
    • Could get complex fast
    • Rigid, not as dynamic
  • Scripting-based plugins
    • Harder to implement code-wise
      • Depends on final scripting language
    • Much more flexible, deeper customization
    • Higher barrier to entry as a trade off

Configuration-based

Configuration would come in the form of .yaml files which would be located within a plugins/plugin_name directory. Platypus would seek through these directories and load the plugin.yaml file, which can in turn reference other yaml files. These can define rules for how Platypus should behave or handle incoming data from clients. This would take some time to completely flesh out and sort of the syntax of.

No the ideal solution, but is an option if it can be fleshed out completely.

Scripting-based

This is the ideal solution, which would implement a language interpreter into Platypus for X scripting language, with some slight modifications to expose hooks/events allowing modification of data handling as it comes in from either the web clients or server clients.

The language would have to be interpreted, as I'm not entirely sure how implementation of a compiled language would work. Right now, the choice is between Lua and Python, however other options, or even a custom language, can be considered. These would likely have to couple with a .yaml file to expose some metadata for the plugin.

Relay mode

Something I thought up, ability to have multiple "masters" that several servers push to, that in turn sends it to the true "master".

Status Message

Allow ability to set a status message somewhere on the page to notify others of expected downtime/updates/etc.

Frontend and Slackbot not updating values

Frontened webserver and Slackbot don't return the values existing in the database - only the data existing on first run is used, it never seems to get new data. See SQL.py, might have something to do with it. Not sure.

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.