frdbonif / sys2mqtt Goto Github PK
View Code? Open in Web Editor NEWPublish system statistics to an MQTT broker.
License: GNU General Public License v3.0
Publish system statistics to an MQTT broker.
License: GNU General Public License v3.0
Requires testing on Debian 10, Ubuntu 18.04, Ubuntu 20.04, CentOS 8, Sangoma Linux 7 and OpenSUSE using the install.sh script with systemd unit file.
Requires testing on Windows 10 and FreeBSD - separate install instructions need producing for these platforms.
Create new installer script which creates a virtual environment for sys2mqtt to run in.
Use atexit
module to publish 'Not Connected' and set utilisations to '0' when sys2mqtt exits.
Add logging, this will be easy enough using systemd service but not on other platforms, try to create universal logging option.
Using a Python script to manage configuration is not optimal, the formatting is not easy to manage.
Using a config.yaml file and parsing this with pyyaml would make it easy to read and manage for users.
Already included in psutil module, just need to expand code to push this to MQTT.
To clarify what the file does to anyone who sees it outside of its directory such as in search results, system resource monitors etc.
systemd files are included for Ubuntu, Debian, CentOS and Sangoma Enterprise Linux.
A method of running as a service in FreeBSD should be included.
Systemd unit file to be tested on Debian before version testing commences for other platforms.
Static metrics only reach the MQTT server sometimes. QOS is set to 1 as per the rest. No other publish lines seem to have this issue.
Extend options in conf.py
to allow users to choose which metrics that they would like to find and publish.
Implement MQTT discovery for easy integration with Homeassistant.
Installation instructions to be included with v0.4.0 at the latest.
Using distro
module.
With the systemd unit file being put to use, detailed installation instructions will be needed for Windows and FreeBSD users.
The getting of statistics and the publishing of statistics should be moved together into the already existing functions.
For example
def function
get cpu-util
publish cpu-util
def function2
get mem-util
publish mem-util
This will require checking MQTT connection status at the start of each loop as part of an if statement eg.
if mqtt is disconnected
then
connect to mqtt
elif mqtt is connected
then
pass
main.py has no exception handling past defining the system hostname.
Before v0.3 release, exception handling should be added.
As title.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.