Skip to content

Commit

Permalink
fix: Netdata agents not sending any data to cloud (who thought disabl…
Browse files Browse the repository at this point in the history
…ing this silently was a good idea?)
  • Loading branch information
dr460nf1r3 committed Oct 29, 2023
1 parent 09f2b16 commit a1fdfe2
Showing 1 changed file with 50 additions and 41 deletions.
91 changes: 50 additions & 41 deletions nixos/services/monitoring/monitoring.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,59 @@ in {
};

config = mkIf cfg.enable {
services.netdata.enable = true;
services.netdata.claimTokenFile = "/var/garuda/secrets/netdata_claim_token";
services.netdata.config = {
db = {
"dbengine disk space MB" = "10240";
"dbengine multihost disk space MB" = "10240";
"mode" = "dbengine";
"update every" = "2";
services = {
netdata = {
claimTokenFile = "/var/garuda/secrets/netdata_claim_token";
config = {
db = {
"dbengine disk space MB" = "10240";
"dbengine multihost disk space MB" = "10240";
"mode" = "dbengine";
"update every" = "2";
};
ml = { "enabled" = "yes"; };
web = { "mode" = "none"; };
};
configDir = {
"go.d.conf" = pkgs.writeText "go.d.conf" ''
enabled: yes
modules:
nginx: yes
postgres: yes
squidlog: yes
web_log: yes
'';
"python.d.conf" = pkgs.writeText "python.d.conf" ''
postgres: no
web_log: no
'';
"go.d/nginx.conf" = mkIf config.services.nginx.enable
(pkgs.writeText "nginx.conf" ''
jobs:
- name: local
url: http://localhost/nginx_status
'');
"go.d/postgres.conf" = mkIf config.services.postgresql.enable
(pkgs.writeText "postgres.conf" ''
jobs:
- name: web-two
dsn: 'postgres://netdata:netdata@localhost:5432/'
'');
};
enable = true;

# https://github.com/nix-community/nixpkgs.lib/commit/1111263e3da005fe29fd72b87283fc17bfba2d81
package = (pkgs.netdata.override { withCloud = true; });

# Extra Python packages required for Netdata to function
python.extraPackages = ps: [ ps.psycopg2 ];
};
ml = { "enabled" = "yes"; };
web = { "mode" = "none"; };
};
services.netdata.configDir = {
"go.d.conf" = pkgs.writeText "go.d.conf" ''
enabled: yes
modules:
nginx: yes
postgres: yes
squidlog: yes
web_log: yes
'';
"python.d.conf" = pkgs.writeText "python.d.conf" ''
postgres: no
web_log: no
'';
"go.d/nginx.conf" = mkIf config.services.nginx.enable
(pkgs.writeText "nginx.conf" ''
jobs:
- name: local
url: http://localhost/nginx_status
'');
"go.d/postgres.conf" = mkIf config.services.postgresql.enable
(pkgs.writeText "postgres.conf" ''
jobs:
- name: web-two
dsn: 'postgres://netdata:netdata@localhost:5432/'
'');

# Let Netdata poll Nginx' status page
nginx.statusPage = true;
};

# Extra Python & system packages required for Netdata to function
services.netdata.python.extraPackages = ps: [ ps.psycopg2 ];
# System packages required for Netdata to function
systemd.services.netdata.path = with pkgs; [ jq ];

# Let Netdata poll Nginx' status page
services.nginx.statusPage = true;
};
}

0 comments on commit a1fdfe2

Please sign in to comment.