diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2016-01-19 09:55:31 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2016-01-19 09:55:31 +0100 |
commit | 716aac2519a7571e7f5fd984a886d579a4a051c5 (patch) | |
tree | 53cf89cf764d787f4dc8f08474479892b9733177 /nixos/modules/services/monitoring | |
parent | f8472457a440de3c44f6f604142d678b6ae2a762 (diff) | |
parent | 53b389327e34de319dc0dbda2b6bcab1a69db69d (diff) | |
download | nixlib-716aac2519a7571e7f5fd984a886d579a4a051c5.tar nixlib-716aac2519a7571e7f5fd984a886d579a4a051c5.tar.gz nixlib-716aac2519a7571e7f5fd984a886d579a4a051c5.tar.bz2 nixlib-716aac2519a7571e7f5fd984a886d579a4a051c5.tar.lz nixlib-716aac2519a7571e7f5fd984a886d579a4a051c5.tar.xz nixlib-716aac2519a7571e7f5fd984a886d579a4a051c5.tar.zst nixlib-716aac2519a7571e7f5fd984a886d579a4a051c5.zip |
Merge branch 'staging' into closure-size
Diffstat (limited to 'nixos/modules/services/monitoring')
-rw-r--r-- | nixos/modules/services/monitoring/bosun.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/cadvisor.nix | 6 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/grafana.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/graphite.nix | 23 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/heapster.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/monit.nix | 16 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/munin.nix | 18 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/nagios.nix | 6 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/scollector.nix | 3 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/statsd.nix | 4 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/ups.nix | 29 |
11 files changed, 53 insertions, 55 deletions
diff --git a/nixos/modules/services/monitoring/bosun.nix b/nixos/modules/services/monitoring/bosun.nix index 214a19d9483f..46273fc12187 100644 --- a/nixos/modules/services/monitoring/bosun.nix +++ b/nixos/modules/services/monitoring/bosun.nix @@ -33,6 +33,7 @@ in { package = mkOption { type = types.package; default = pkgs.bosun; + defaultText = "pkgs.bosun"; example = literalExample "pkgs.bosun"; description = '' bosun binary to use. diff --git a/nixos/modules/services/monitoring/cadvisor.nix b/nixos/modules/services/monitoring/cadvisor.nix index 031558a373c9..a67df158be47 100644 --- a/nixos/modules/services/monitoring/cadvisor.nix +++ b/nixos/modules/services/monitoring/cadvisor.nix @@ -14,7 +14,7 @@ in { description = "Whether to enable cadvisor service."; }; - host = mkOption { + listenAddress = mkOption { default = "127.0.0.1"; type = types.str; description = "Cadvisor listening host"; @@ -71,7 +71,7 @@ in { after = [ "network.target" "docker.service" "influxdb.service" ]; postStart = mkBefore '' - until ${pkgs.curl.bin}/bin/curl -s -o /dev/null 'http://${cfg.host}:${toString cfg.port}/containers/'; do + until ${pkgs.curl.bin}/bin/curl -s -o /dev/null 'http://${cfg.listenAddress}:${toString cfg.port}/containers/'; do sleep 1; done ''; @@ -79,7 +79,7 @@ in { serviceConfig = { ExecStart = ''${pkgs.cadvisor}/bin/cadvisor \ -logtostderr=true \ - -listen_ip=${cfg.host} \ + -listen_ip=${cfg.listenAddress} \ -port=${toString cfg.port} \ ${optionalString (cfg.storageDriver != null) '' -storage_driver ${cfg.storageDriver} \ diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix index 6053990e8d3b..0b49038dd273 100644 --- a/nixos/modules/services/monitoring/grafana.nix +++ b/nixos/modules/services/monitoring/grafana.nix @@ -93,6 +93,7 @@ in { package = mkOption { description = "Package to use."; default = pkgs.grafana; + defaultText = "pkgs.grafana"; type = types.package; }; diff --git a/nixos/modules/services/monitoring/graphite.nix b/nixos/modules/services/monitoring/graphite.nix index 57abb959fdb7..976fd253a7cd 100644 --- a/nixos/modules/services/monitoring/graphite.nix +++ b/nixos/modules/services/monitoring/graphite.nix @@ -77,7 +77,7 @@ in { type = types.bool; }; - host = mkOption { + listenAddress = mkOption { description = "Graphite web frontend listen address."; default = "127.0.0.1"; type = types.str; @@ -108,7 +108,7 @@ in { finders = mkOption { description = "List of finder plugins to load."; default = []; - example = [ pkgs.python27Packages.graphite_influxdb ]; + example = literalExample "[ pkgs.python27Packages.graphite_influxdb ]"; type = types.listOf types.package; }; @@ -121,7 +121,7 @@ in { type = types.listOf types.str; }; - host = mkOption { + listenAddress = mkOption { description = "Graphite web service listen address."; default = "127.0.0.1"; type = types.str; @@ -136,6 +136,7 @@ in { package = mkOption { description = "Package to use for graphite api."; default = pkgs.python27Packages.graphite_api; + defaultText = "pkgs.python27Packages.graphite_api"; type = types.package; }; @@ -146,7 +147,7 @@ in { directories: - ${dataDir}/whisper ''; - example = literalExample '' + example = '' allowed_origins: - dashboard.example.com cheat_times: true @@ -256,13 +257,13 @@ in { }; enableAggregator = mkOption { - description = "Whether to enable carbon agregator, the carbon buffering service."; + description = "Whether to enable carbon aggregator, the carbon buffering service."; default = false; type = types.bool; }; aggregationRules = mkOption { - description = "Defines if and how received metrics will be agregated."; + description = "Defines if and how received metrics will be aggregated."; default = null; type = types.uniq (types.nullOr types.string); example = '' @@ -292,7 +293,7 @@ in { }; graphiteUrl = mkOption { - default = "http://${cfg.web.host}:${toString cfg.web.port}"; + default = "http://${cfg.web.listenAddress}:${toString cfg.web.port}"; description = "Host where graphite service runs."; type = types.str; }; @@ -337,7 +338,7 @@ in { graphiteUrl = mkOption { description = "URL to your graphite service."; - default = "http://${cfg.web.host}:${toString cfg.web.port}"; + default = "http://${cfg.web.listenAddress}:${toString cfg.web.port}"; type = types.str; }; @@ -350,7 +351,7 @@ in { critical: 200 name: Test ''; - example = literalExample '' + example = '' pushbullet_key: pushbullet_api_key alerts: - target: stats.seatgeek.app.deal_quality.venue_info_cache.hit @@ -452,7 +453,7 @@ in { serviceConfig = { ExecStart = '' ${pkgs.python27Packages.waitress}/bin/waitress-serve \ - --host=${cfg.web.host} --port=${toString cfg.web.port} \ + --host=${cfg.web.listenAddress} --port=${toString cfg.web.port} \ --call django.core.handlers.wsgi:WSGIHandler''; User = "graphite"; Group = "graphite"; @@ -494,7 +495,7 @@ in { serviceConfig = { ExecStart = '' ${pkgs.python27Packages.waitress}/bin/waitress-serve \ - --host=${cfg.api.host} --port=${toString cfg.api.port} \ + --host=${cfg.api.listenAddress} --port=${toString cfg.api.port} \ graphite_api.app:app ''; User = "graphite"; diff --git a/nixos/modules/services/monitoring/heapster.nix b/nixos/modules/services/monitoring/heapster.nix index 74b8c9ccd3ed..deee64aa41ea 100644 --- a/nixos/modules/services/monitoring/heapster.nix +++ b/nixos/modules/services/monitoring/heapster.nix @@ -33,6 +33,7 @@ in { package = mkOption { description = "Package to use by heapster"; default = pkgs.heapster; + defaultText = "pkgs.heapster"; type = types.package; }; }; diff --git a/nixos/modules/services/monitoring/monit.nix b/nixos/modules/services/monitoring/monit.nix index 642fac3b3a01..704693969a35 100644 --- a/nixos/modules/services/monitoring/monit.nix +++ b/nixos/modules/services/monitoring/monit.nix @@ -19,10 +19,6 @@ in default = ""; description = "monit.conf content"; }; - startOn = mkOption { - default = "started network-interfaces"; - description = "What Monit supposes to be already present"; - }; }; }; @@ -39,14 +35,12 @@ in } ]; - jobs.monit = { + systemd.services.monit = { description = "Monit system watcher"; - - startOn = config.services.monit.startOn; - - exec = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf"; - - respawn = true; + after = [ "network-interfaces.target" ]; + wantedBy = [ "multi-user.target" ]; + script = "${pkgs.monit}/bin/monit -I -c /etc/monit.conf"; + serviceConfig.Restart = "always"; }; }; } diff --git a/nixos/modules/services/monitoring/munin.nix b/nixos/modules/services/monitoring/munin.nix index 31afa859e256..aaa041ad4cd6 100644 --- a/nixos/modules/services/monitoring/munin.nix +++ b/nixos/modules/services/monitoring/munin.nix @@ -122,21 +122,6 @@ in HTML output is in <filename>/var/www/munin/</filename>, configure your favourite webserver to serve static files. ''; - example = literalExample '' - services = { - munin-node.enable = true; - munin-cron = { - enable = true; - hosts = ''' - [''${config.networking.hostName}] - address localhost - '''; - extraGlobalConfig = ''' - contact.email.command mail -s "Munin notification for ''${var:host}" someone@example.com - '''; - }; - }; - ''; }; extraGlobalConfig = mkOption { @@ -147,6 +132,9 @@ in Useful to setup notifications, see <link xlink:href='http://munin-monitoring.org/wiki/HowToContact' /> ''; + example = '' + contact.email.command mail -s "Munin notification for ''${var:host}" someone@example.com + ''; }; hosts = mkOption { diff --git a/nixos/modules/services/monitoring/nagios.nix b/nixos/modules/services/monitoring/nagios.nix index c1f7ba0eca74..f2f7710de9e7 100644 --- a/nixos/modules/services/monitoring/nagios.nix +++ b/nixos/modules/services/monitoring/nagios.nix @@ -94,7 +94,9 @@ in }; plugins = mkOption { + type = types.listOf types.package; default = [pkgs.nagiosPluginsOfficial pkgs.ssmtp]; + defaultText = "[pkgs.nagiosPluginsOfficial pkgs.ssmtp]"; description = " Packages to be added to the Nagios <envar>PATH</envar>. Typically used to add plugins, but can be anything. @@ -102,14 +104,18 @@ in }; mainConfigFile = mkOption { + type = types.package; default = nagiosCfgFile; + defaultText = "nagiosCfgFile"; description = " Derivation for the main configuration file of Nagios. "; }; cgiConfigFile = mkOption { + type = types.package; default = nagiosCGICfgFile; + defaultText = "nagiosCGICfgFile"; description = " Derivation for the configuration file of Nagios CGI scripts that can be used in web servers for running the Nagios web interface. diff --git a/nixos/modules/services/monitoring/scollector.nix b/nixos/modules/services/monitoring/scollector.nix index 8b97daf8881a..1e397435e600 100644 --- a/nixos/modules/services/monitoring/scollector.nix +++ b/nixos/modules/services/monitoring/scollector.nix @@ -43,6 +43,7 @@ in { package = mkOption { type = types.package; default = pkgs.scollector; + defaultText = "pkgs.scollector"; example = literalExample "pkgs.scollector"; description = '' scollector binary to use. @@ -77,7 +78,7 @@ in { collectors = mkOption { type = with types; attrsOf (listOf path); default = {}; - example = literalExample "{ 0 = [ \"\${postgresStats}/bin/collect-stats\" ]; }"; + example = literalExample "{ \"0\" = [ \"\${postgresStats}/bin/collect-stats\" ]; }"; description = '' An attribute set mapping the frequency of collection to a list of binaries that should be executed at that frequency. You can use "0" diff --git a/nixos/modules/services/monitoring/statsd.nix b/nixos/modules/services/monitoring/statsd.nix index 39fabc27d6c8..df2adb9f2766 100644 --- a/nixos/modules/services/monitoring/statsd.nix +++ b/nixos/modules/services/monitoring/statsd.nix @@ -11,7 +11,7 @@ let configFile = pkgs.writeText "statsd.conf" '' { - address: "${cfg.host}", + address: "${cfg.listenAddress}", port: "${toString cfg.port}", mgmt_address: "${cfg.mgmt_address}", mgmt_port: "${toString cfg.mgmt_port}", @@ -48,7 +48,7 @@ in type = types.bool; }; - host = mkOption { + listenAddress = mkOption { description = "Address that statsd listens on over UDP"; default = "127.0.0.1"; type = types.str; diff --git a/nixos/modules/services/monitoring/ups.nix b/nixos/modules/services/monitoring/ups.nix index eb478f7da65d..5f80d547dbcb 100644 --- a/nixos/modules/services/monitoring/ups.nix +++ b/nixos/modules/services/monitoring/ups.nix @@ -180,31 +180,36 @@ in environment.systemPackages = [ pkgs.nut ]; - jobs.upsmon = { + systemd.services.upsmon = { description = "Uninterruptible Power Supplies (Monitor)"; - startOn = "ip-up"; - daemonType = "fork"; - exec = ''${pkgs.nut}/sbin/upsmon''; + wantedBy = [ "ip-up.target" ]; + serviceConfig.Type = "forking"; + script = "${pkgs.nut}/sbin/upsmon"; environment.NUT_CONFPATH = "/etc/nut/"; environment.NUT_STATEPATH = "/var/lib/nut/"; }; - jobs.upsd = { + systemd.services.upsd = { description = "Uninterruptible Power Supplies (Daemon)"; - startOn = "started network-interfaces and started upsmon"; - daemonType = "fork"; + wantedBy = [ "multi-user.target" ]; + after = [ "network-interfaces.target" "upsmon.service" ]; + serviceConfig.Type = "forking"; # TODO: replace 'root' by another username. - exec = ''${pkgs.nut}/sbin/upsd -u root''; + script = "${pkgs.nut}/sbin/upsd -u root"; environment.NUT_CONFPATH = "/etc/nut/"; environment.NUT_STATEPATH = "/var/lib/nut/"; }; - jobs.upsdrv = { + systemd.services.upsdrv = { description = "Uninterruptible Power Supplies (Register all UPS)"; - startOn = "started upsd"; + wantedBy = [ "multi-user.target" ]; + after = [ "upsd.service" ]; # TODO: replace 'root' by another username. - exec = ''${pkgs.nut}/bin/upsdrvctl -u root start''; - task = true; + script = ''${pkgs.nut}/bin/upsdrvctl -u root start''; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; environment.NUT_CONFPATH = "/etc/nut/"; environment.NUT_STATEPATH = "/var/lib/nut/"; }; |