forked from mirrors_public/oddlama_nix-config
chore: prepare monitoring config via globals
This commit is contained in:
parent
c3ad25a79b
commit
a33c46e4f5
3 changed files with 19 additions and 4 deletions
|
@ -29,6 +29,17 @@ in {
|
||||||
|
|
||||||
meta.telegraf.secrets."@GITHUB_ACCESS_TOKEN@" = config.age.secrets.github-access-token.path;
|
meta.telegraf.secrets."@GITHUB_ACCESS_TOKEN@" = config.age.secrets.github-access-token.path;
|
||||||
services.telegraf.extraConfig.outputs.influxdb_v2.urls = lib.mkForce ["http://localhost:${toString influxdbPort}"];
|
services.telegraf.extraConfig.outputs.influxdb_v2.urls = lib.mkForce ["http://localhost:${toString influxdbPort}"];
|
||||||
|
|
||||||
|
globals.monitoring.ping.cloudflare-dns = {
|
||||||
|
host = "1.1.1.1";
|
||||||
|
location = "external";
|
||||||
|
};
|
||||||
|
|
||||||
|
globals.monitoring.ping.google-dns = {
|
||||||
|
host = "8.8.8.8";
|
||||||
|
location = "external";
|
||||||
|
};
|
||||||
|
|
||||||
services.telegraf.extraConfig.inputs = {
|
services.telegraf.extraConfig.inputs = {
|
||||||
ping = [
|
ping = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,10 +98,14 @@ in {
|
||||||
ping = mkOption {
|
ping = mkOption {
|
||||||
type = types.attrsOf (types.submodule {
|
type = types.attrsOf (types.submodule {
|
||||||
options = {
|
options = {
|
||||||
fromNetwork = mkOption {
|
host = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
description = "The network from which this service is reachable.";
|
description = "The IP/hostname to ping.";
|
||||||
default = "external";
|
};
|
||||||
|
|
||||||
|
location = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "A location tag added to this metric.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
in {
|
in {
|
||||||
# Make sure the keys of this attrset are trivially evaluatable to avoid infinite recursion,
|
# Make sure the keys of this attrset are trivially evaluatable to avoid infinite recursion,
|
||||||
# therefore we inherit relevant attributes from the config.
|
# therefore we inherit relevant attributes from the config.
|
||||||
inherit (globalsSystem.config.globals) net services;
|
inherit (globalsSystem.config.globals) net services monitoring;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue