Giter Site home page Giter Site logo

serverstatuscheck's Introduction

Server Status Check

code style: blackย 


My first application created to monitor status of external application via GET request. Example of server response

example


To simulate application working it is possible to start mock server ./mock_server/mock_server.py which will generate needed responses.

exampleRun

Main functions

Main function of application is to constantly check when last time data on external application were updated which is represented in change date/time filed in computed_time. After each change depending on confguration fille application will print sufficent mesage to termina,log file, save time diff to database or send notification via RocketChat.

Example configuration file:

servers:                                    # list of servers
  PROD:   
    name: PROD                              # name of server after which object will be named 
    adress: http://127.0.0.1:5000/version   # adress
    db_save: false                          # specify if time diff need to be saved to datbase
    notification: false                     # specify if notification via RocetChat need to send 
                                                after crossing treshold time without update
    notification_treshold: 15               # threshold time after which notification will be sent. 
    msg_interval: 5                         # time interval of repeating message (in minutes)
credentials:
  DB:
    engine: mysql+mysqlconnector            # engine used to create connetion using SqlAlchemy
    username: database_user                 # user
    password: database_password             # password
    adress: 127.0.0.1:3306                  # adress
    db: example_database                    # database name
    table: example_table                    # table name
  ROCKETCHAT:                               #RocketChat channel webhook
    webhook: https://rock.sever.example/hooks/random/random
    headers: { "content-type": "application/json" }
logs:                                       #logs settings
  filename: runs.log
  filemode: a
  level: logging.INFO
main:                                       #Time interval of server checkups (in seconds)
  checkup_interval: 60                         application will check status of servers every 60 seconds

I know that many things could be imporved however,as application is no longer needed I won't be developing it any further.

serverstatuscheck's People

Contributors

niviral 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.