1
0
Fork 0
mirror of https://github.com/mdlayher/homelab.git synced 2024-12-14 11:47:32 +00:00

nixos/servnerr-4: updates for new router

This commit is contained in:
Matt Layher 2023-07-19 09:02:57 -04:00
parent c182a871cf
commit 13b9d938ee
3 changed files with 9 additions and 16 deletions

View file

@ -40,15 +40,6 @@ in {
];
};
# Start getty over serial console.
systemd.services."serial-getty@ttyS1" = {
enable = true;
# Make sure agetty spawns at boot and always restarts whenever it
# exits due to user logout.
wantedBy = [ "multi-user.target" ];
serviceConfig = { Restart = "always"; };
};
# Scale down CPU frequency when load is low.
powerManagement.cpuFreqGovernor = "ondemand";

View file

@ -36,6 +36,8 @@
linkConfig.Name = "ten0p0lan0";
};
networks."11-ten0p0lan0" = {
# TODO(mdlayher): enable again.
enable = false;
matchConfig.Name = "ten0p0lan0";
networkConfig.DHCP = "ipv4";
dhcpV4Config.ClientIdentifier = "mac";

View file

@ -113,8 +113,8 @@ in {
# Simple, static scrape jobs.
(staticScrape "apcupsd" [ "nerr-4:9162" "servnerr-4:9162" ])
(staticScrape "consrv" [ "monitnerr-1:9288" ])
(staticScrape "coredns" [ "routnerr-2:9153" ])
(staticScrape "corerad" [ "routnerr-2:9430" "servnerr-4:9430" ])
(staticScrape "coredns" [ "routnerr-3:9153" ])
(staticScrape "corerad" [ "routnerr-3:9430" "servnerr-4:9430" ])
(lib.mkMerge [
(staticScrape "keylight" [ "keylight" ])
{ relabel_configs = relabelTarget "servnerr-4:9288"; }
@ -122,12 +122,12 @@ in {
(staticScrape "node" [
"monitnerr-1:9100"
"nerr-4:9100"
"routnerr-2:9100"
"routnerr-3:9100"
"servnerr-4:9100"
])
(staticScrape "obs" [ "nerr-4:9407" ])
(staticScrape "windows" [ "theatnerr-2:9182" ])
(staticScrape "wireguard" [ "routnerr-2:9586" ])
(staticScrape "wireguard" [ "routnerr-3:9586" ])
(staticScrape "zrepl" [ "servnerr-4:9811" ])
# Home Assistant requires a more custom configuration.
@ -153,14 +153,14 @@ in {
# it once a minute.
(blackboxScrape "ssh_banner" "1m" [
"nerr-4:22"
"routnerr-2:22"
"routnerr-3:22"
"servnerr-4:22"
])
# SNMP relabeling configuration required to properly replace the instance
# names and query the correct devices.
(lib.mkMerge [
(staticScrape "snmp-cyberpower" [ "pdu01" "ups01" ])
(staticScrape "snmp-cyberpower" [ "pdu01.ipv4" "ups01.ipv4" ])
{
metrics_path = "/snmp";
params = { module = [ "cyberpower" ]; };
@ -169,7 +169,7 @@ in {
])
# Lab-only jobs must be prefixed with lab- to avoid alerting.
(staticScrape "lab-corerad" [ "routnerr-2:9431" ])
(staticScrape "lab-corerad" [ "routnerr-3:9431" ])
];
rules = [ (builtins.toJSON (import ./prometheus-alerts.nix)) ];