Crates.io | munin-cpu1sec |
lib.rs | munin-cpu1sec |
version | 0.2.2 |
source | src |
created_at | 2022-05-23 20:50:54.335109 |
updated_at | 2022-06-05 12:49:50.194668 |
description | munin graph plugin for cpu statistics, 1second resolution |
homepage | |
repository | https://github.com/Ganneff/munin-cpu1sec |
max_upload_size | |
id | 592150 |
size | 32,083 |
A munin plugin to collect CPU statistic data once every second.
The plugin uses data available in procfs to display CPU idle/iowait/user/system/... data. Statistics are read once per second and written to a cachefile, whenever munin asks for the data, the content of the cachefile is send.
Compile (or load a released binary, if one is there) and put the binary somewhere. Then link it into the munin plugins dir.
When first called without arguments, cpu1sec will spawn itself into the
background to gather data. This can also be triggered by calling it
with the acquire &
parameter.
Per default this plugin will only produce a "total" graph, similar to what the default cpu plugin from munin does (though in much higher resolution, obviously).
The plugin can produce the graphs per CPU/core on the system. Then the view "total" will be the front, when you click it, you get a detail graph of every CPU core on the system.
To activate this, set the environment variable cpudetail to 1, say in
/etc/munin/plugin-conf.d/cpu1sec.conf
put
[cpu1sec]
env.cpudetail=1
Note that every graph has 10 datasets, and each dataset uses ~11MB on disk. If you have many cores, enabling cpudetail may easily run you out of disk space!
cargo build --release --target x86_64-unknown-linux-musl
target/x86_64-unknown-linux-musl/release/munin-cpu1sec
to a useful
place on your system and link it to /etc/munin/plugins/cpu1sec
.systemctl munin-node restart
)Use cargo build as usual. Note that the release build contains much
less logging code than the debug build, so if you want to find out
why something does not work as planned, ensure to use a debug build
(cargo build
instead of cargo build --release
).
Note that I build using musl, as I want fully static binaries. "Normal" rust link against libc, and that may carry symbols that aren't available everywhere (older versions). If you do not have that requirement, not using musl will be fine.
Note that they do not live up to distribution quality, but they do work for an easy install.
A minimal Debian package can be build using cargo deb
, provided that
you installed this feature (cargo install cargo-deb
).
A minimal package for RPM based systems can be build using cargo generate-rpm
, provided that you installed this feature (cargo install cargo-generate-rpm
)