host_session

One row per session of the host in the custom table host_session (schema 0.0.1). The hub adds the gateway as spoke_id.

The first run after a boot opens a row for the current session (start time equal to end time, everything else 0) and closes the previous one from the history of the host's uptime signal: CPU, RAM and disk at one minute, with coverage as the share of minutes with a CPU sample. Later runs in the same boot stop after one query.

One script for every gateway. signals.yml lists the cpu, ram, disk and uptime signals of every host; the script asks the history of each <host>-uptime until one answers 200 (a gateway answers 403 for signals it does not own) and uses that host's four signals. A new host needs its four signals added to signals.yml and a new tag. Runs every minute; needs only requests in the image.

S
Description
host session table relateed scripts
Readme
46 KiB
Languages
Python 100%