An ebpf program that attaches a kprobe to oops_exit function and exports the number of kernel oopses happend after the attachment in prometheus format.
To simulate an oops, build and install the kernel module located in oops_mod
directory.
- Download and extract the binary from releases
- Run it on the prefered port:
sudo ./koops -p 3031
- Install rust stable toolchain:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Install rust nightly toolchain with the rust-src component:
rustup toolchain install nightly --component rust-src
- Add x86_64-unknown-linux-musl target:
rustup target add x86_64-unknown-linux-musl
- Install bpf-linker:
cargo install bpf-linker
- Build eBPF:
cargo xtask build-ebpf --release
- Build binary:
cargo build --release --target=x86_64-unknown-linux-musl
- Run with info log-level:
sudo ./target/x86_64-unknown-linux-musl/release/koops
Make sure secure boot is not enabled
cd oops_mod
make
sudo insmod oops_mod.ko