lol

longview nixos module: add config options for service monitoring

+46 -7
+46 -7
nixos/modules/services/monitoring/longview.nix
··· 7 7 8 8 pidFile = "/run/longview.pid"; 9 9 10 - apacheConf = '' 11 - #location http://127.0.0.1/server-status?auto 10 + apacheConf = optionalString (cfg.apacheStatusUrl != "") '' 11 + location ${cfg.apacheStatusUrl}?auto 12 12 ''; 13 - mysqlConf = '' 14 - #username root 15 - #password example_password 13 + mysqlConf = optionalString (cfg.mysqlUser != "") '' 14 + username ${cfg.mysqlUser} 15 + password ${cfg.mysqlPassword} 16 16 ''; 17 - nginxConf = '' 18 - #location http://127.0.0.1/nginx_status 17 + nginxConf = optionalString (cfg.nginxStatusUrl != "") '' 18 + location ${cfg.nginxStatusUrl} 19 19 ''; 20 20 21 21 in ··· 35 35 36 36 apiKey = mkOption { 37 37 type = types.str; 38 + example = "01234567-89AB-CDEF-0123456789ABCDEF"; 38 39 description = '' 39 40 Longview API key. To get this, look in Longview settings which 40 41 are found at https://manager.linode.com/longview/. 41 42 ''; 42 43 }; 43 44 45 + apacheStatusUrl = mkOption { 46 + type = types.str; 47 + default = ""; 48 + example = "http://127.0.0.1/server-status"; 49 + description = '' 50 + The Apache status page URL. If provided, Longview will 51 + gather statistics from this location. This requires Apache 52 + mod_status to be loaded and enabled. 53 + ''; 54 + }; 55 + 56 + nginxStatusUrl = mkOption { 57 + type = types.str; 58 + default = ""; 59 + example = "http://127.0.0.1/nginx_status"; 60 + description = '' 61 + The Nginx status page URL. Longview will gather statistics 62 + from this URL. This requires the Nginx stub_status module to 63 + be enabled and configured at the given location. 64 + ''; 65 + }; 66 + 67 + mysqlUser = mkOption { 68 + type = types.str; 69 + default = ""; 70 + description = '' 71 + The user for connecting to the MySQL database. If provided, 72 + Longview will connect to MySQL and collect statistics about 73 + queries, etc. 74 + ''; 75 + }; 76 + 77 + mysqlPassword = mkOption { 78 + type = types.str; 79 + description = '' 80 + The password corresponding to mysqlUser. 81 + ''; 82 + }; 44 83 }; 45 84 46 85 };