This project should be an equivalent to telegraf but for the PostgreSQL based TimescaleDB
- Python >= 3.7
- python
psutilpackage - python
psycopg2package - python
tomlkitpackage
Optional:
- Ryzen power binary to read out per core energy consumption on Ryzen/Threadripper based chips (see Ryzen Power
ssfromiproute2for netstat (TCP Statistics)sensorsfromlm_sensorsfor pretty sensor readouts (with named fields), falls back topsutilmethod if not availablesmartctlfromsmartmontoolsfor HDD and SSD SMART monitoring
- Add SMART monitoring for HDDs, SSDs and NVME devices
- Initial release
- Install with
pip install pynsor - Create config file in
/etc/pynsor/pynsor.conf, for example config seearchlinux/pynsor.conf - Start with
pynsor --config /etc/pynsor/pynsor.conf
All tables needed by the plugins that have been activated are created on startup automatically (including their hypertables and some indices that make sense).
If you want to run this as a systemd service, see archlinux/pynsor.service
for example unit file.
Configuration is a single file that looks like this:
[global]
refresh = 10
batch_size = 1
[db]
host = "localhost"
port = 5432
username = "monitoring"
password = "monitoring"
db = "monitoring"
[sensor.DiskStats]
enabled = true
[sensor.LMSensors]
enabled = true
sensors_binary = "/usr/bin/sensors"
use_fallback = false
[sensor.Netstat]
enabled = true
ss_binary = "/usr/bin/ss"
[sensor.PSUtil]
enabled = true
[sensor.RyzenPower]
enabled = false
ryzenpower_binary = "/usr/bin/ryzen_power"
[sensor.ProcStat]
enabled = true
[sensor.SMARTCtl]
enabled = trueglobal.refreshdefines how often to fetch a sensor reading (seconds)global.batch_sizeif not set to1, collectnreadings before writing all of them to the DB... May conserve power by not stressing the DB too often.dbshould be self explanatory- The
sensornamespace is reserved for sensor configuration. The names of the sensors are the python class names of the implementation. All sensors have at least theenabledattribute which defaults totrueand can be set tofalseto disable running that particular sensor
- Source:
/proc/diskstats - Table:
diskstats - Purpose: Disk performance counters
- Source:
lm_sensorsorsysfshwmon nodes (when used viapsutilfallback) - Tables:
temps,voltage,fans,current,power - Purpose: Active readout of sensors built into the computer
This plugin has a configuration:
sensors_binary: path to thesensorsbinary to useuse_fallback: fall-back topsutileven iflm_sensorsis installed
- Source:
iproute2binaryss - Table:
netstat - Purpose: TCP networking statistics (established sockets, error states, etc.)
This plugin has a configuration:
ss_binary: path to thessbinary to use
- Source: Various readings from
/procand/sys - Tables:
cpu_usage,cpu_freq,load_avg,processes,virtual_memory,swap_memory,disk_usage,net_io_counters,disk_io_counters - Purpose: Kernel statistics of differing origins
- Source:
ryzen_powerbinary which reads CPU registers - Tables:
power - Purpose: Read per-core and -package power usage from AMD Ryzen based CPUs
This plugin has a configuration:
ryzenpower_binary: path to theryzen_powerbinary to use (attention: this one is a SUID-root binary!)
- Source:
/proc/stat - Tables:
cpu_usage_counters,kernel - Purpose: RAW CPU usage counters and some other kernel information from the kernel stats.
- Source:
smartctl(device needs to be accessible by script) - Tables:
sata_smart,nvme_smart - Purpose: SMART status of disks
This plugin has a configuration:
smartctl_binary: path to thesmartctlbinary to use (or a wrapper script that allows the user to access the disk device)disks: disks to scan, you can use glob patterns (see default), if not set defaults to[ "/dev/sd?", "/dev/sr?", "/dev/hd?", "/dev/nvme?n1" ]