build03: add postgresql to telegraf
This commit is contained in:
parent
7d9e9ec0f0
commit
2979fc5268
1 changed files with 12 additions and 0 deletions
|
@ -1,6 +1,18 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
services.postgresql.ensureUsers = [{
|
||||||
|
name = "telegraf";
|
||||||
|
}];
|
||||||
|
|
||||||
|
systemd.services.postgresql.postStart = ''
|
||||||
|
$PSQL -tAc 'GRANT pg_read_all_stats TO telegraf' -d postgres
|
||||||
|
'';
|
||||||
|
|
||||||
|
services.telegraf.extraConfig.inputs.postgresql = {
|
||||||
|
address = "host=/run/postgresql user=telegraf database=postgres";
|
||||||
|
};
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# enableJIT seems to be broken, can't set a version without also needing to add withJIT
|
# enableJIT seems to be broken, can't set a version without also needing to add withJIT
|
||||||
|
|
Loading…
Add table
Reference in a new issue