-
-
Save cleverca22/b2e79bcbc7e733e4f3b9cf471f230b84 to your computer and use it in GitHub Desktop.
snmp example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, ... }: | |
let | |
passwords = import ./passwords.nix; | |
in | |
{ | |
systemd.services.snmpd = let | |
snmpconfig = pkgs.writeTextFile { | |
name = "snmpd.conf"; | |
text = '' | |
rocommunity ${passwords.snmp} | |
disk / 10000 | |
extend cputemp ${pkgs.stdenv.shell} -c "${pkgs.acpi}/bin/acpi -t|egrep -o '[0-9\.]{3,}'" | |
''; | |
}; | |
in { | |
description = "net-snmp daemon"; | |
wantedBy = [ "multi-user.target" ]; | |
serviceConfig = { | |
ExecStart = "${pkgs.net_snmp}/bin/snmpd -f -c ${snmpconfig}"; | |
KillMode = "process"; | |
Restart = "always"; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment