diff --git a/bundles/bind/files/named.conf b/bundles/bind/files/named.conf index d301bd7..568b28d 100644 --- a/bundles/bind/files/named.conf +++ b/bundles/bind/files/named.conf @@ -1,2 +1,6 @@ +statistics-channels { + inet 127.0.0.1 port 8053; +}; + include "/etc/bind/named.conf.options"; include "/etc/bind/named.conf.local"; diff --git a/bundles/bind/metadata.py b/bundles/bind/metadata.py index eb14e12..b772f8a 100644 --- a/bundles/bind/metadata.py +++ b/bundles/bind/metadata.py @@ -10,6 +10,17 @@ defaults = { 'bind': { 'zones': {}, }, + 'telegraf': { + 'config': { + 'inputs': { + 'bind': [{ + 'urls': ['http://localhost:8053/xml/v3'], + 'gather_memory_contexts': False, + 'gather_views': True, + }], + }, + }, + }, } diff --git a/bundles/postgresql/metadata.py b/bundles/postgresql/metadata.py index fcc5dd3..d5cbd0e 100644 --- a/bundles/postgresql/metadata.py +++ b/bundles/postgresql/metadata.py @@ -1,3 +1,5 @@ +root_password = repo.vault.password_for(f'{node.name} postgresql root') + defaults = { 'apt': { 'packages': { @@ -12,12 +14,13 @@ defaults = { 'postgresql': { 'roles': { 'root': { - 'password': repo.vault.password_for(f'{node.name} postgresql root'), + 'password': root_password, 'superuser': True, }, }, 'databases': {}, }, + 'grafana_rows': [], } if node.has_bundle('zfs'): @@ -28,3 +31,21 @@ if node.has_bundle('zfs'): }, }, } + + +@metadata_reactor.provides( + 'telegraf/config/inputs/postgresql', +) +def telegraf(metadata): + return { + 'telegraf': { + 'config': { + 'inputs': { + 'postgresql': [{ + 'address': f'postgres://root:{root_password}@localhost:5432/postgres', + 'databases': sorted(list(node.metadata.get('postgresql/databases').keys())), + }], + }, + }, + }, + }