GithubHelp home page GithubHelp logo

zayuna / imusutm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tobychui/imusutm

0.0 0.0 0.0 69 KB

Basic service up-time monitor written in Golang

License: MIT License

Shell 1.83% Go 43.89% HTML 54.28%

imusutm's Introduction

圖片

imusutm

Baisc service up-time monitor and TOTP generator written in Golang

Usage

Double click the binary executable to run the up-time monitor.

Build from Source

git clone https://github.com/tobychui/imusutm
cd imusutm
go mod tidy
go build
./utm
(or .\utm.exe)

Setup Monitoring Server

Create a file named "config.json" and place it in the same folder to the binary executable.

{
 "Targets": [
    {
        "ID": "imus_homepage", //ID of the target
        "Name": "imuslab Homepage", //Name to show on the UI
        "URL": "https://imuslab.com", //URL to request
        "Protocol": "https" //Protocol to check online
    },
    //More endpoint here
 ],
 "Interval": 300, //Update interval in seconds
 "LogToFile": false, //Log results to file
 "RecordsInJson": 288 //How many records to keep, in this example, 300s (5 min) x 288 records per target = 1 day
}

To start the monitoring server, use the following command (Note the ":")

./utm -p :8089

You can also change the port if this port has already been occupied by another service.

Tips: You can add it to systemd as a service if you want it to startup with your other services on Linux

Setting up TOTP Code Generator

TOTP code generator was added after Github force me to enable 2FA to my account. You can setup a totp code generator with a config file name totp.json with the following contents.

{
 "Entries": [
  {
   "Name": "Example",
   "Secret": "JBSWY3DPEHPK3PXP",
   "Link": "example.com"
  },
	//Add more line if needed
 ]
}

Restart the application to see the new code generator running. 圖片

More Protocols Support

As I only need to ping my own web servers, I currently only implemented the following protocol. If you need more protocols, feel free to create a PR on this project.

  • http

  • https

Notes: You do not need to know php if you want to add more protocols. All changes are only nessary to be done in the Golang side

License

MIT License

Disclaimer

This is an internal tool design for my in-house use only. Use it with your own risk.

imusutm's People

Contributors

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