Skip to content
Permalink
Browse files

nixos/sensu: sensu module

  • Loading branch information
peterhoeg committed Sep 25, 2019
1 parent 248a3d8 commit 5fe1abf05a37bfff5cfdce6524a3cbaa4451b670
@@ -486,6 +486,7 @@
./services/monitoring/riemann-dash.nix
./services/monitoring/riemann-tools.nix
./services/monitoring/scollector.nix
./services/monitoring/sensu/default.nix
./services/monitoring/smartd.nix
./services/monitoring/sysstat.nix
./services/monitoring/systemhealth.nix
@@ -0,0 +1,82 @@
{ lib }:

{
options = with lib; with types; {
type = mkOption {
type = enum [ "standard" "metric" ];
default = "standard";
description = "Type of check.";
};

standalone = mkOption {
type = bool;
default = false;
description = "Scheduled by the client instead of the server.";
};

command = mkOption {
type = str;
description = "Command to run.";
};

subscribers = mkOption {
type = listOf str;
default = [];
description = "Subscribers";
};

handlers = mkOption {
default = [];
description = "Handlers.";
type = listOf str;
};

dependencies = mkOption {
default = [];
description = "Dependencies.";
type = listOf str;
};

interval = mkOption {
type = int;
default = 60;
description = "Check interval.";
};

timeout = mkOption {
type = int;
default = 30;
description = "Check timeout.";
};

ttl = mkOption {
type = int;
default = 120;
description = "Check TTL.";
};

source = mkOption {
type = str;
default = "";
description = "Custom source for JIT checks.";
};

occurrences = mkOption {
type = int;
default = 1;
description = "The number of occurrences before triggering an alert.";
};

subdue = mkOption {
type = attrs;
default = {};
description = "Subdue check during certain windows.";
};

vars = mkOption {
type = attrs;
default = {};
description = "Custom variables sent with the check.";
};
};
}
@@ -0,0 +1,60 @@
{ lib }:

{
options = with lib; with types; {
name = mkOption {
type = str;
default = "";
description = "Name of the client.";
};

address = mkOption {
type = str;
default = "";
description = "IP address";
};

subscriptions = mkOption {
type = listOf str;
default = [ ];
description = "Subscriptions";
};

socket = mkOption {
description = "The socket configuration.";
default = {};
type = submodule {
options = {
bind = mkOption {
type = str;
default = "127.0.0.1";
description = "The IP address on which the client listens.";
};

port = mkOption {
type = int;
default = 3030;
description = "The port on which the client listens.";
};
};
};
};

vars = mkOption {
type = attrs;
default = {};
description = "Custom attributes/variables.";
};

execEnv = mkOption {
type = package;
description = "The execution environment for all checks.";
};

wrapper = mkOption {
type = nullOr path;
description = "The wrapper script used for executing all the checks.";
default = null;
};
};
}
@@ -0,0 +1,112 @@
{ config, lib, cfg }:

{
options = with lib; with types; {
enable = mkOption {
type = bool;
default = (cfg.role == "server");
description = "Enable the dashboard";
};

host = mkOption {
type = str;
default = "127.0.0.1";
description = "The IP address on which Uchiwa will listen.";
};

port = mkOption {
type = int;
default = 3000;
description = "The port on which Uchiwa will listen.";
};

refresh = mkOption {
type = int;
default = 5;
description = "UI refresh interval.";
};

proxy = mkOption {
description = "Proxy traffic to/from the sensu dashboard.";
default = {};
type = submodule {
options = {
enable = mkOption {
type = bool;
default = false;
description = "Enable proxy.";
};

path = mkOption {
type = str;
default = "/";
description = "The path to the dashboard if behind a proxy.";
};

name = mkOption {
type = str;
default = config.networking.hostName;
description = "Hostname on which to repond.";
};

enableSSL = mkOption {
type = bool;
default = false;
description = "Force SSL.";
};
};
};
};

users = mkOption {
description = "Users";
default = {};
type = listOf(submodule {
options = {
username = mkOption {
description = "User name.";
type = str;
};

password = mkOption {
description = "Password.";
type = str;
};

accessToken = mkOption {
default = "";
description = "Access token.";
type = str;
};

readonly = mkOption {
default = false;
description = "Read only.";
type = bool;
};
};
});
};

usersOptions = mkOption {
description = "Options relevant to all users";
default = {};
type = submodule {
options = {

defaultTheme = mkOption {
type = enum [ "uchiwa-default" "uchiwa-dark" ];
default = "uchiwa-dark";
description = "The theme to use.";
};

logoUrl = mkOption {
type = str;
default = "";
description = "The logo to use.";
};
};
};
};
};
}

0 comments on commit 5fe1abf

Please sign in to comment.
You can’t perform that action at this time.