forked from mirrors_public/oddlama_nix-config
feat(monitoring): remove location, add nginx upstream monitoring option
This commit is contained in:
parent
2024c3bfd5
commit
18b2002c27
26 changed files with 352 additions and 218 deletions
|
@ -8,6 +8,13 @@
|
|||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
defaultOptions = {
|
||||
network = mkOption {
|
||||
type = types.str;
|
||||
description = "The network to which this endpoint is associated.";
|
||||
};
|
||||
};
|
||||
in {
|
||||
options = {
|
||||
globals = mkOption {
|
||||
|
@ -97,120 +104,94 @@ in {
|
|||
monitoring = {
|
||||
ping = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
hostv4 = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The IP/hostname to ping via ipv4.";
|
||||
default = null;
|
||||
};
|
||||
options =
|
||||
defaultOptions
|
||||
// {
|
||||
hostv4 = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The IP/hostname to ping via ipv4.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
hostv6 = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The IP/hostname to ping via ipv6.";
|
||||
default = null;
|
||||
hostv6 = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The IP/hostname to ping via ipv6.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
location = mkOption {
|
||||
type = types.str;
|
||||
description = "A location tag added to this metric.";
|
||||
};
|
||||
|
||||
network = mkOption {
|
||||
type = types.str;
|
||||
description = "The network to which this endpoint is associated.";
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
http = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
url = mkOption {
|
||||
type = types.str;
|
||||
description = "The url to connect to.";
|
||||
};
|
||||
options =
|
||||
defaultOptions
|
||||
// {
|
||||
url = mkOption {
|
||||
type = types.either (types.listOf types.str) types.str;
|
||||
description = "The url to connect to.";
|
||||
};
|
||||
|
||||
location = mkOption {
|
||||
type = types.str;
|
||||
description = "A location tag added to this metric.";
|
||||
};
|
||||
expectedStatus = mkOption {
|
||||
type = types.int;
|
||||
default = 200;
|
||||
description = "The HTTP status code to expect.";
|
||||
};
|
||||
|
||||
network = mkOption {
|
||||
type = types.str;
|
||||
description = "The network to which this endpoint is associated.";
|
||||
};
|
||||
expectedBodyRegex = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "A regex pattern to expect in the body.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
expectedStatus = mkOption {
|
||||
type = types.int;
|
||||
default = 200;
|
||||
description = "The HTTP status code to expect.";
|
||||
skipTlsVerification = mkOption {
|
||||
type = types.bool;
|
||||
description = "Skip tls verification when using https.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
expectedBodyRegex = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "A regex pattern to expect in the body.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
dns = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
server = mkOption {
|
||||
type = types.str;
|
||||
description = "The DNS server to query.";
|
||||
};
|
||||
options =
|
||||
defaultOptions
|
||||
// {
|
||||
server = mkOption {
|
||||
type = types.str;
|
||||
description = "The DNS server to query.";
|
||||
};
|
||||
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
description = "The domain to query.";
|
||||
};
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
description = "The domain to query.";
|
||||
};
|
||||
|
||||
record-type = mkOption {
|
||||
type = types.str;
|
||||
description = "The record type to query.";
|
||||
default = "A";
|
||||
record-type = mkOption {
|
||||
type = types.str;
|
||||
description = "The record type to query.";
|
||||
default = "A";
|
||||
};
|
||||
};
|
||||
|
||||
location = mkOption {
|
||||
type = types.str;
|
||||
description = "A location tag added to this metric.";
|
||||
};
|
||||
|
||||
network = mkOption {
|
||||
type = types.str;
|
||||
description = "The network to which this endpoint is associated.";
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
tcp = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
description = "The IP/hostname to connect to.";
|
||||
};
|
||||
options =
|
||||
defaultOptions
|
||||
// {
|
||||
host = mkOption {
|
||||
type = types.str;
|
||||
description = "The IP/hostname to connect to.";
|
||||
};
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
description = "The port to connect to.";
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
description = "The port to connect to.";
|
||||
};
|
||||
};
|
||||
|
||||
location = mkOption {
|
||||
type = types.str;
|
||||
description = "A location tag added to this metric.";
|
||||
};
|
||||
|
||||
network = mkOption {
|
||||
type = types.str;
|
||||
description = "The network to which this endpoint is associated.";
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue