An open API service indexing awesome lists of open source software.

https://github.com/tobychui/imusutm

Basic service up-time monitor written in Golang
https://github.com/tobychui/imusutm

downtime downtime-monitor golang monitor monitoring service service-disruption uptime uptime-monitor

Last synced: about 1 month ago
JSON representation

Basic service up-time monitor written in Golang

Awesome Lists containing this project

README

        

![圖片](https://github.com/tobychui/imusutm/assets/24617523/f8098c25-ea74-48bc-8837-a73bf831c26c)

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

```json
{
"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.

```json
{
"Entries": [
{
"Name": "Example",
"Secret": "JBSWY3DPEHPK3PXP",
"Link": "example.com"
},
//Add more line if needed
]
}
```
Restart the application to see the new code generator running.
![圖片](https://github.com/tobychui/imusutm/assets/24617523/f0567094-b660-44c8-9527-2e378b8f1a87)

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