longview nixos module: add config options for service monitoring

This commit is contained in:
Rodney Lorrimar 2015-11-11 12:11:07 +00:00
parent bc3fb79619
commit 33c2b8a1f1

View File

@ -7,15 +7,15 @@ let
pidFile = "/run/longview.pid"; pidFile = "/run/longview.pid";
apacheConf = '' apacheConf = optionalString (cfg.apacheStatusUrl != "") ''
#location http://127.0.0.1/server-status?auto location ${cfg.apacheStatusUrl}?auto
''; '';
mysqlConf = '' mysqlConf = optionalString (cfg.mysqlUser != "") ''
#username root username ${cfg.mysqlUser}
#password example_password password ${cfg.mysqlPassword}
''; '';
nginxConf = '' nginxConf = optionalString (cfg.nginxStatusUrl != "") ''
#location http://127.0.0.1/nginx_status location ${cfg.nginxStatusUrl}
''; '';
in in
@ -35,12 +35,51 @@ in
apiKey = mkOption { apiKey = mkOption {
type = types.str; type = types.str;
example = "01234567-89AB-CDEF-0123456789ABCDEF";
description = '' description = ''
Longview API key. To get this, look in Longview settings which Longview API key. To get this, look in Longview settings which
are found at https://manager.linode.com/longview/. are found at https://manager.linode.com/longview/.
''; '';
}; };
apacheStatusUrl = mkOption {
type = types.str;
default = "";
example = "http://127.0.0.1/server-status";
description = ''
The Apache status page URL. If provided, Longview will
gather statistics from this location. This requires Apache
mod_status to be loaded and enabled.
'';
};
nginxStatusUrl = mkOption {
type = types.str;
default = "";
example = "http://127.0.0.1/nginx_status";
description = ''
The Nginx status page URL. Longview will gather statistics
from this URL. This requires the Nginx stub_status module to
be enabled and configured at the given location.
'';
};
mysqlUser = mkOption {
type = types.str;
default = "";
description = ''
The user for connecting to the MySQL database. If provided,
Longview will connect to MySQL and collect statistics about
queries, etc.
'';
};
mysqlPassword = mkOption {
type = types.str;
description = ''
The password corresponding to mysqlUser.
'';
};
}; };
}; };