This flake provides a package for using the packaged checkmk agent via Nix. It supports most common checks and also has optional supports for advanced checks, like MegaRaid or OVS.
The provided outputs are:
packages.x86_64-linux.checkmk-agent: nix package for checkmk agent, at the time of writing for version2.3.0p26- (wip)
nixosModules.default: NixOS module for using checkmk-agent as service
The only supported platform is x86_64-linux.
It should also work on other platforms however we currently don't have any testing setup for this.
A prerequisite is a priviledged user account on
mon.zibint.hlrn.de.
- Include the module and enable in your system config:
{
inputs = {
[... your inputs]
cmk_agent = {
url = "git+ssh://git@git.zib.de/hpc-s/checkmk-agent.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { ..., cmk_agent, ... }: {
nixosConfigurations.your-system = nixpkgs.lib.nixosSystem {
modules = [
cmk_agent.nixosModules.default
({ ... }: {
services.cmk_agent.enable = true;
})
];
};
}
}If you also want to use cmk-agent-ctl, add:
{ config, ... }: {
environment.systemPackages = [ config.services.cmk_agent.package ];
}You should also open the TCP port 6556, if you want to operate the agent in pull mode (this is what you usually want):
{ config, ... }: {
networking.firewall.interfaces.<interface>.allowedTCPPorts = [ 6556 ];
}- Follow the steps in the wiki after create host.
For example (for
adm):cmk-agent-ctl register --server mon.adm.hlrn.de --site HPC --user agent_registration --hostname $(hostname -f)
The agent itself is a portable bash script.
It checks the $PATH at runtime for uncommon dependencies, like postfix, and, if found, evaluates them.
If a binary is not found it will skip the check.
This allows the nix derivation to offer opt-in checks for some services to reduce the derivation size for most installations. Most common checks, like the systemd-based checks, are always included to make integration easier.
The supported options are:
lnxSupport(default:true): state of network interfaces of Linux hostsmultipathSupport(default:false): state of multipathdencryptionSupport(default:true): encryption of agent messageszfsSupport(default:false): monitoring of zpools and ZFS datasets- (untested)
lvmSupport(default:false): monitoring of lvm - (untested)
ovsSupport(default:false): monitor openvswitch - (untested)
chronySupport(default:false): monitorchrony ipmiSupport(default:false): monitor IPMI withfreeipmiandipmitool- (untested)
dmraidSupport(default:false): monitor device-mapper RAID megaraidSupport(default:false): monitor MegaRaid withstorcliandmegaclipostfixSupport(default:true): monitor postfix mailqueues- (untested)
varnishSupport(default:false): monitor varnish - (untested)
ntpdSupport(default:false): monitor ntpd
(untested): checks that have yet to be tested on a machine.