Monitoring tool that collects data periodically and stores it in a database. Has several plugins, for system information, and even finance.
Go to file
2020-08-11 22:43:25 +03:00
plugins Added speedtest plugin, fixed database connection error. 2020-08-05 01:25:02 +03:00
.gitignore Implemented collector utility. 2020-04-15 01:49:22 +03:00
collector.py Added speedtest plugin, fixed database connection error. 2020-08-05 01:25:02 +03:00
config.py Added speedtest plugin, fixed database connection error. 2020-08-05 01:25:02 +03:00
database.py Added speedtest plugin, fixed database connection error. 2020-08-05 01:25:02 +03:00
install.sh Added speedtest plugin, fixed database connection error. 2020-08-05 01:25:02 +03:00
README.md Create README.md 2020-08-11 22:43:25 +03:00
requirements.txt Added speedtest plugin, fixed database connection error. 2020-08-05 01:25:02 +03:00

Tibi Collector

A really lightweight and easy to configure alternative to collectord.

Motivation

I wanted a simple solution of monitoring my Linux server, and the existing solutions were way too complex for my needs. So I decided to write my own tool, which simply polls the system resources at a fixed interval. It is flexible enough so it can be made to monitor pretty much anything, as the finance plugins demonstrate.

Setup

1. Clone this repository

git clone https://github.com/chibicitiberiu/collector.git

2. Install the dependencies

sudo apt install python3 python3-pip
sudo pip3 install -r requirements.txt

Some plugins have additional dependencies:

For the database, you will need to install and setup your preferred database and also install the proper python3 drivers:

  • Postgres: psycopg2
  • MySQL: MySQLdb
  • MySQL: pymysql
  • SQLite: sqlite3
  • CockroachDB: see psycopg2

Check the Peewee documentation for more details about supported databases and advanced connection URLs.

3. Configure

The configuration options can be found in the config.py file. Most options are self explanatory, and there are comments explaining how to setup the more complicated ones.

To completely disable a plugin, just comment it in the collector.py file. For example, to disable the ROBOR plugin, comment it like this:

def __init__(self):
    self.plugins = [
        .......
        # finance
        StocksPlugin(),
        #RoborPlugin()
    ]
    .....

4. Install

sudo ./install.sh

The install.sh script sets up a systemd service called tcollector. You will be able to control the service using the systemctl command.

If something isn't working properly, you can check the logs using the journalctl command:

journalctl -n 1000 _SYSTEMD_UNIT=tcollector.service

Development

All PRs are welcome.