DEV Community

Cover image for Easily monitor your server's stats
Amjad Abujamous
Amjad Abujamous

Posted on • Edited on

2

Easily monitor your server's stats

TL;DR

One can use Glances along with a reverse proxy to easily monitor the health of their Server/PC from any location by simply accessing a link. This tutorial walks you through exactly that.

Introduction

Many of us want a straightforward solution to monitoring the health of their Home server, Web server, or essentially any PC. While Grafana and Metabase are good realtime dashboard solutions, their setup can be difficult, which is why we will explore and setup Glances.

Steps to set it up

  1. Install Glances (cross-platform) on your system.
  2. Enable its monitoring feature via a web browser.
  3. Run a reverse proxy on the server.
  4. Access the link from anywhere.

Prerequisites

As is from their github repository.

  • python>=3.8 (use Glances 3.4.x for lower Python version)
  • psutil (better with latest version)
  • defusedxml (in order to monkey patch xmlrpc)
  • packaging (for the version comparison)
  • ujson (an optimized alternative to the standard json module)
  • pytz (for the timezone support)
  • pydantic (for the data validation support)

Step 1: Install Glances

Can be done via the pip package manager for python.

pip install --user 'glances[all]'

Note that you may need to type pip3 instead of pip, depending on your Python installation.

Image description

Step 2: Run glances and monitor the system

To run it in the terminal, run the command:
glances

In our case, we want to run it in a browser, so we type:
glances -w

which gives us the following.

Image description

Image description

Step 3: Access from anywhere

Many good reverse proxy solutions currently exist on the market such as ngrok and Cloudflare tunnels. They give one the ability to reliably run a tunnel and ensure it does not go down. They also offer the ability to securely access their links using whitelisted IP addresses or by using HTTP Basic Authentication.

For this tutorial, however, we will go with the simpler solution serveo.net for demonstration purposes.

Image description

Image description

Voila! That link can now allow us to monitor the system from anywhere with very minimal setup and installation.

Final Thoughts

I hope you found this tutorial useful, and please feel free to comment below if you have questions, additions, modifications, or criticism of this method. All the best!

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (3)

Collapse
 
kalyani_brolly_cc1a6468e profile image
kalyani. brolly

This is a super helpful tutorial! Glances combined with a reverse proxy like serveo.net makes server monitoring simple and accessible from anywhere — perfect for those who want a quick setup without the complexity of Grafana. The step-by-step explanation is clear and easy to follow. Thanks for sharing — definitely adding this to my DevOps toolkit.Digital Marketing Course In Hyderabad

Collapse
 
suresh_brolly_c7d4cd18107 profile image
suresh brolly

The article is clear and to the point. It explains the important concepts in an easy-to-understand way. Anyone reading it will find it helpful and informative. Python Full Stack Training in Hyderabad

Collapse
 
anilvcube profile image
Anil

Great Blog!
All The Information Provided is very useful;
Thanks For The Information:)
Keep Posting More!

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more