{ lib, pkgs, config, ... }: # Standard module arguments { services.vmalert.rules.groups = [ { name = "InodeUsageAlerts"; rules = [ { alert = "HighInodeUsage"; expr = '' ( node_filesystem_files{fstype!~"tmpfs|rootfs",mountpoint!=""} - node_filesystem_files_free{fstype!~"tmpfs|rootfs",mountpoint!=""} ) / node_filesystem_files{fstype!~"tmpfs|rootfs",mountpoint!=""} * 100 > 80 ''; for = "30m"; labels = { severity = "warning"; category = "capacity"; }; annotations = { summary = "High inode usage on {{ $labels.instance }} at {{ $labels.mountpoint }}"; description = "Inode usage on {{ $labels.instance }} for mount point {{ $labels.mountpoint }} (fstype: {{ $labels.fstype }}) has been above 80% for more than 30 minutes. Current value: {{ $value | printf \"%.2f\" }}%."; }; } ]; } ]; }