Code Monkey home page Code Monkey logo

hothost's Introduction

HotHost

Lightweight and minimalistic free and opensource Servers and HTTP monitor.

  • ๐Ÿ’พ Shows used disk space percentage and ALERT badge if it exceeds configurable threshold (90% by default)
  • ๐Ÿง  Shows used RAM percentage and ALERT badge if it exceeds configurable threshold (90% by default)
  • โ˜Ž๏ธ Built-in plugins to setup free Email/Slack/Telegram notifications
  • ๐Ÿชง Agents installed using simple code snippets. Options: Docker/Compose/Bash+curl+crontab.
  • ๐Ÿ™ Allows to monitor as many hosts as needed
  • โฐ๏ธ Configurable monitoring interval
  • ๐Ÿ“ˆ View top 10 processes consuming RAM, historically over last 2 days.
  • ๐ŸŒ HTTP / HTTPS Monitor, status code check, webpage keywords existence, basic auth, notifications
  • ๐Ÿ”’ HTTPS SSL check with expiration reminder (default is 14 days prior to expire, configurable)

For each host it allows to see:

  • OS version
  • CPU model
  • RAM size and current RAM ussage
  • See whether SWAP is enabled and whether it is used

Preview

Hosts view:

image

Add new host box:

image

Available notification plugins:

image

Analyze top RAM-consuming processes at a time:

HTTP(s) Monitor setup:

Installation

First you need to run HotHost Web Server. Web-server itself, when will be started, will give you clear guide how to add agents via own Web UI.

You can use any host with public IP. You are responsible for setting up HTTPS.

For HTTPS you can use anything, most simple options:

  • Nginx or Traefik with connected external certificate or free Let's Encrypt certificate
  • Free Cloudflare CDN which terminates SSL and gives additional layer of security.

We recommend you to check guide how to setup HotHost with free Cloudflare plan and EC2 Nano

If you have existing Docker/Compose stacks, you can use snippets below:

Docker Compose

Add to your existing compose stack:

version: '3.5'

services:
  hothost-web:
    image: devforth/hothost-web
    restart: always
    environment:
      - HOTHOST_WEB_ADMIN_USERNAME=admin
      - HOTHOST_WEB_ADMIN_PASSWORD=!!!CHANGE_ME!!!
      - HOTHOST_WEB_PORT=8007
      - HOTHOST_WEB_PUBLIC_VIEW_ENABLED=false
    ports:
      - 8007:8007
    volumes:
      - v-hothost-data:/var/lib/hothost/data/
volumes:
  v-hothost-data:

Now you should proxy https://subdomain.yourdomain.com to serve requests from 127.0.0.1:8007.

Example Nginx Proxy:

server {
  listen 443;
  server_name subdomain.yourdomain.com;
  ssl_certificate     wildcard.crt;
  ssl_certificate_key   wildcard.key;

  charset utf-8;
  client_max_body_size 75M;

  gzip on;
  gzip_disable "msie6";
  gzip_vary on;
  gzip_proxied any;
  gzip_comp_level 8;
  gzip_buffers 16 8k;
  gzip_http_version 1.1;
  gzip_min_length 256;
  gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;

  location / {
      proxy_read_timeout 220s;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_redirect off;
      proxy_pass http://127.0.0.1:8007;
  }
}

Pure Docker

If you are not using Compose, rhen just install Docker to your host with public IP and run folowwing command:

mkdir -p /www/hothostdata
docker run -d --name=hothost-web \
  -v /www/hothostdata:/var/lib/hothost/data/  \
  --env HOTHOST_WEB_ADMIN_USERNAME=admin  \
  --env HOTHOST_WEB_ADMIN_PASSWORD=!!!CHANGE_ME!!!  \
  --env HOTHOST_WEB_PUBLIC_VIEW_ENABLED=false  \
  --restart=always  \
  --env HOTHOST_WEB_PORT=8007  \
  -p 8007:8007  \
  devforth/hothost-web

Updating Web

docker pull devforth/hothost-web:latest

then recreate a contaner

Plugin development

Every plugin is a standalone .js in ESM format (with exports/imports, CommonJS with require is not supported). File should have a defined structure. Use server/src/plugins/slack.js for a Hello-World example. It is well documented

Currently plugin file should be placed into server/src/plugins directory.

If you want to bundle some dedicated node modules then you need to bundle them using webpack or other bundler which supports ESM outputs. Please see server/src/plugins/gmail.src/gmail.src.js - it bundels node-mailer into plugin.

Development

Default local credentials:

  • admin:123456

First, start back:

cd server
npm ci
npm start

Then start front:

cd frontend 
npm ci
npm run dev

hothost's People

Contributors

allmors avatar deewoc avatar erwanvivien avatar fabian4 avatar ihorstorozhok avatar ivictbor avatar lbp22 avatar multifox200 avatar vverenko 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

hothost's Issues

Agent can't connect to server

I Use for several servers and one agent can't connect to server hothost.

docker logs --tail 20 -f hothost-agent
curl: (28) Failed to connect to IP port 8007 after 131055 ms: Connection timed out
curl: (28) Failed to connect to IP port 8007 after 130282 ms: Connection timed out
curl: (28) Failed to connect to IP port 8007 after 131060 ms: Connection timed out
nc -vz IP 8007
Connection to IP 8007 port [tcp/*] succeeded!
--- IP ping statistics ---
106 packets transmitted, 106 received, 0% packet loss, time 105157ms

Hothost server located in Germany, agent located in Turkey. Maybe it's possible to increase timed out for connection between agent server ?

Visualize memory and disk usage with charts.

hi,

I appreciate the excellent UI and interface design you have provided, it perfectly aligns with my expectations. Nonetheless, I would like to suggest the addition of charts that display memory and disk usage rates, as it would enhance the user experience and provide a more intuitive representation of the data.

Docker and api on port 8007

Hi,

I have configured the application using Docker according to your installation guide.
When I start the container and browse the application, it seems to be frozen.
I see in development tools of the browser that it tries to request the following URL :
http://localhost:8007/api/v2/getMonitoringData
But initially, port 8007 was not declared in your guide.
I added the mapping from 8007 to 80 without success as I got a 401 error code or a connection refused for this request.
Do you have a solution to get it work ?

Public IP choice or show both.

Hi,

First of all thanks for the great tool.

On the dashboard it shows a hosts public IP and by default is showing my hosts ipv6, but I would prefer for it to show the ipv4 or show both as it's more readable and would be nice to quickly copy and paste into a terminal.

Thanks

Guest mode

I hope there is a guest mode where public IP or other privacy information is not displayed.

Stuck trying to use this on Windows 11

Hi there, I've never used Docker before, and have absolutely no idea what I'm doing

Somehow I stumbled my way into installing Docker for Windows and searched for hothost-web and installed it.

Set the 3 envinroment variables in the boxes according to the setup guide linked in your post

But then, when I hit run, it fails with:

2023-02-17 17:06:41 node:fs:600 2023-02-17 17:06:41 handleErrorFromBinding(ctx); 2023-02-17 17:06:41 ^ 2023-02-17 17:06:41 2023-02-17 17:06:41 Error: ENOENT: no such file or directory, open '/var/lib/hothost/jwt' 2023-02-17 17:06:41 at Object.openSync (node:fs:600:3) 2023-02-17 17:06:41 at Object.writeFileSync (node:fs:2221:35) 2023-02-17 17:06:41 at file:///code/src/env.js:30:16 2023-02-17 17:06:41 at ModuleJob.run (node:internal/modules/esm/module_job:193:25) 2023-02-17 17:06:41 at async Promise.all (index 0) 2023-02-17 17:06:41 at async ESMLoader.import (node:internal/modules/esm/loader:530:24) 2023-02-17 17:06:41 at async loadESM (node:internal/process/esm_loader:91:5) 2023-02-17 17:06:41 at async handleMainPromise (node:internal/modules/run_main:65:12) { 2023-02-17 17:06:41 errno: -2, 2023-02-17 17:06:41 syscall: 'open', 2023-02-17 17:06:41 code: 'ENOENT', 2023-02-17 17:06:41 path: '/var/lib/hothost/jwt' 2023-02-17 17:06:41 } 2023-02-17 17:06:41 2023-02-17 17:06:41 Node.js v18.12.1

Novice user here and I was pretty happy about even getting this far.. as for what I'm hoping to do - I just want to monitor remote URL's that are ERROR 404 for when they go online, using my own desktop PC at home which runs Windows 11.

Thank you!

Can't get telegram bot working

When I try to setup the telegram bot I can't send a test message, it always prints
undefinedChatId and invalidChatId in the docker log.

When I send a message to the bot it seems that it can't get the chat id.

When I set the chat id manually in the JSON file as "telegramLastChannelId": "12345" (with my correct Id) I don't get the error anymore but I also don't get a message

Is this something you can look into?

UI is working but can't monitore host or other servers

Hello folks,

I don't know if I missed an important point, but I don't get monitoring on the installed system, nor on any other server.

The service was installed via docker compose

Attached my docker-compose.yaml file, which is also running on a target server for example.

version: '3'
services:
  hothost-agent:
    image: devforth/hothost-agent
    environment:
    - HOTHOST_SERVER_BASE=https://example.com
    - HOTHOST_AGENT_SECRET=EXAMPLE_SECRET
    - HOTHOST_MONITOR_INTERVAL=60
    container_name: hothost-agent
    restart: unless-stopped
    cap_add:
      - SYS_PTRACE
    security_opt:
      - apparmor:unconfined
      - seccomp:unconfined
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /etc/os-release:/host/etc/os-release:ro
      - /etc/hostname:/host/etc/hostname:ro

What amazes me is that on the actual host, the docker ps output indicates to me that there is also an agent running

51f3bd4cb5b5 devforth/hothost-agent "bash getinfo.sh" 47 minutes ago Up 29 minutes hothost-agent

Hostname should be updated

If a hostname changes the changes are not reflected in the app. It looks like it is sent each time but maybe it is not being updated on the server app?

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.