User Tools

This is an old revision of the document!


Glances

Glances is a CLI and Web GUI monitor for your server. It's neat and nice, and it's not intrusive. It comes with a nice CLI interface, but also with an handy WEB GUI interface, which is what i want to leverage here.

Installation

Glances is available in Gentoo's Portage, but lacks the FastAPI and Uvcorn dependencies, so it's better to create a dedicated venv as root:

  python -m venv /opt/glances
    . /opt/glances/bin/activate
    pip install glances fastapi uvicorn jinja2

Reverse Proxy

Glances needs to be set up in the reverse proxy to be accessed protected behind your SSO:

glances.conf
location = /glances {
        return 301 https://$host/glances/;
}

location /glances/ {
        proxy_pass http://127.0.0.1:61208/;
}

Autostart

Create the following OpenRC start script into /etc/init.d/glancesweb and make it exetuable:

glancesweb
#!/sbin/openrc-run
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

description="Glances web server"
pidfile="/run/glancesweb.pid"
logfile="/var/log/glancesweb.log"

depend() {
        need net
}

start() {
        . /opt/glances/bin/activate
        /opt/glances/bin/glances -w > ${logfile} 2> ${logfile}&
        echo $! > ${pidfile}
}

Then of course, set it to boot:

rc-update add glancesweb default

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information