Compare commits
2 commits
bdac59c471
...
34cc34a567
Author | SHA1 | Date | |
---|---|---|---|
34cc34a567 | |||
3a4628aef9 |
6 changed files with 31 additions and 4 deletions
|
@ -3,6 +3,8 @@
|
|||
./hardware-configuration.nix
|
||||
./services
|
||||
../../modules
|
||||
../../modules/prometheus/exporters/redis.nix
|
||||
../../modules/prometheus/exporters/postgres.nix
|
||||
];
|
||||
|
||||
boot.loader = {
|
||||
|
|
|
@ -4,6 +4,7 @@ this directory hosts some common modules / services / security tweaks used on (m
|
|||
|
||||
name | description
|
||||
--------------- | -----------
|
||||
`prometheus` | has default prometheus config for all hosts, along with exporters for select hosts
|
||||
`default` | used for commonly shared modules
|
||||
`fonts` | font handling
|
||||
`greetd` | login manager
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{inputs, ...}: {
|
||||
imports = [
|
||||
inputs.nh.nixosModules.default
|
||||
./prometheus
|
||||
./security.nix
|
||||
./networking.nix
|
||||
./users.nix
|
||||
|
@ -9,6 +10,5 @@
|
|||
./openssh.nix
|
||||
./virtualisation.nix
|
||||
./sops.nix
|
||||
./prometheus.nix
|
||||
];
|
||||
}
|
||||
|
|
|
@ -5,19 +5,29 @@ _: {
|
|||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "prometheus";
|
||||
scrape_interval = "30s";
|
||||
scrape_interval = "15s";
|
||||
static_configs = [{targets = ["localhost:9090"];}];
|
||||
}
|
||||
{
|
||||
job_name = "node";
|
||||
scrape_interval = "30s";
|
||||
scrape_interval = "15s";
|
||||
static_configs = [{targets = ["localhost:9100"];}];
|
||||
}
|
||||
{
|
||||
job_name = "traefik";
|
||||
scrape_interval = "30s";
|
||||
scrape_interval = "15s";
|
||||
static_configs = [{targets = ["100.87.54.48:8080"];}];
|
||||
}
|
||||
{
|
||||
job_name = "redis_exporter";
|
||||
scrape_interval = "15s";
|
||||
static_configs = [{targets = ["100.94.214.100:9002"];}];
|
||||
}
|
||||
{
|
||||
job_name = "postgres";
|
||||
scrape_interval = "15s";
|
||||
static_configs = [{targets = ["100.94.214.100:9003"];}];
|
||||
}
|
||||
];
|
||||
exporters = {
|
||||
node = {
|
7
modules/prometheus/exporters/postgres.nix
Normal file
7
modules/prometheus/exporters/postgres.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
_: {
|
||||
services.prometheus.exporters.postgres = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
port = 9003;
|
||||
};
|
||||
}
|
7
modules/prometheus/exporters/redis.nix
Normal file
7
modules/prometheus/exporters/redis.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
_: {
|
||||
services.prometheus.exporters.redis = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
port = 9002;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue