|
před 6 roky | |
---|---|---|
LibreHardwareMonitor @ 4652be058c | před 6 roky | |
OhmGraphite | před 6 roky | |
OhmGraphite.Test | před 6 roky | |
assets | před 6 roky | |
ci | před 6 roky | |
.gitattributes | před 7 roky | |
.gitignore | před 7 roky | |
.gitmodules | před 7 roky | |
.travis.yml | před 6 roky | |
CHANGELOG.md | před 6 roky | |
Dockerfile | před 6 roky | |
LICENSE.txt | před 7 roky | |
OhmGraphite.sln | před 7 roky | |
README.md | před 6 roky | |
appveyor.yml | před 6 roky | |
docker-compose.yml | před 6 roky |
OhmGraphite takes the hard work of extracting hardware sensors from Open Hardware Monitor (technically LibreHardwareMonitor for most up to date hardware) and exports the data in a graphite (or InfluxdDB / Prometheus / TimescaleDB) compatible format. OhmGraphite is for those missing any of the following in Grafana or (other time series UI):
OhmGraphite functions as a console app (cross platform) or a Windows service that periodically polls the hardware. My recommendation is that even though OhmGraphite can be run via Mono / Docker, many hardware sensors aren't available in those modes.
I use this every day to create beautiful dashboards. Keep in mind, Open Hardware Monitor supported components will determine what metrics are available. Below are graphs / stats made with OhmGraphite (couple of the panels are complemented with telegraf as demonstrated in Monitoring Windows system metrics with grafana)
OhmGraphite.exe.config
) using either the Graphite config or InfluxDB config.\OhmGraphite.exe run
. Executing as administrator will most likely increase the number of sensors found (OhmGraphite will log how many sensors are found)..\OhmGraphite.exe install
. The command will install OhmGraphite as a Windows service (so you can manage it with your favorite powershell commands or services.msc
).\OhmGraphite.exe start
or your favorite Windows service management toolThe config below polls our hardware every 5
seconds and sends the results to a graphite server listening on localhost:2003
.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="host" value="localhost" />
<add key="port" value="2003" />
<add key="interval" value="5" />
<add key="tags" value="false" />
</appSettings>
</configuration>
Starting with 1.1.0, Graphite supports tags (similar to InfluxDB's tags). When enabled in OhmGraphite the data format switches from <name> <value> <timestamp>
to <name>;tag1=a;tag2=b <value> <timestamp>
. Since tags are such a new feature, OhmGraphite has it disabled by default to prevent cumbersome usage with Graphite 0.9 and 1.0 installations.
Examples of types of tags used (same for InfluxDB):
For any serious interest in tags, make sure to use external db like postgres, mysql, or redis, as sqlite won't cut it.
Graphite is the default export style, but if you're an InfluxDB user you can change the type
to influxdb
and fill out InfluxDB specific options:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="type" value="influxdb" />
<add key="interval" value="5" />
<add key="influx_address" value="http://localhost:8086" />
<add key="influx_db" value="mydb" />
<!--
<add key="influx_user" value="myuser" />
<add key="influx_password" value="mypassword" />
<add key="interval" value="5" />
-->
</appSettings>
</configuration>
The Prometheus will create a server that listens on prometheus_port
. The Prometheus configuration does not routinely poll the sensor instead it only polls them when a Prometheus server requests data.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="type" value="prometheus" />
<add key="prometheus_port" value="4445" />
<add key="prometheus_host" value="*" />
</appSettings>
</configuration>
One can configure OhmGraphite to send to Timescale with the following (configuration values will differ depending on your environment):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="type" value="timescale" />
<add key="timescale_connection" value="Host=vm-ubuntu;Username=ohm;Password=123456;Database=postgres" />
<add key="timescale_setup" value="false" />
</appSettings>
</configuration>
By leaving timescale_setup
to false
(the default) OhmGraphite will be expecting the following table structure to insert into:
CREATE TABLE IF NOT EXISTS ohm_stats (
time TIMESTAMPTZ NOT NULL,
host TEXT,
hardware TEXT,
hardware_type TEXT,
identifier TEXT,
sensor TEXT,
sensor_type TEXT,
sensor_index INT,
value REAL
);
Then give the ohm
user appropriate permissions:
CREATE USER ohm WITH PASSWORD 'xxx';
GRANT INSERT ON ohm_stats TO ohm;
In this mode, Postgres is supported.
If timescale_setup
is true
then OhmGraphite will create the following schema, so make sure the user connecting has appropriate permissions
CREATE TABLE IF NOT EXISTS ohm_stats (
time TIMESTAMPTZ NOT NULL,
host TEXT,
hardware TEXT,
hardware_type TEXT,
identifier TEXT,
sensor TEXT,
sensor_type TEXT,
sensor_index INT,
value REAL
);
SELECT create_hypertable('ohm_stats', 'time', if_not_exists => TRUE);
CREATE INDEX IF NOT EXISTS idx_ohm_host ON ohm_stats (host);
CREATE INDEX IF NOT EXISTS idx_ohm_identifier ON ohm_stats (identifier);
Currenlty the schema and the columns are not configurable.
.\OhmGraphite.exe stop
OhmGraphite.exe
to your installation directory..\OhmGraphite.exe start
.\OhmGraphite.exe stop
.\OhmGraphite.exe uninstall
Since the full gambit of metrics aren't available in a Docker container, I've refrained from putting the project on docker hub lest it misleads people to think otherwise.
docker build -t nickbabcock/ohm-graphite .
docker run -v $PWD/app.config:/opt/OhmGraphite/OhmGraphite.exe.config:ro nickbabcock/ohm-graphite
app.config
is in the same format as the above configuration.