bundles/postgresql: add pg_query_mon

This commit is contained in:
Franzi 2021-02-20 10:56:20 +01:00
parent 56ff2a794f
commit 1ac6559b9f
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 8 additions and 0 deletions

View file

@ -7,6 +7,9 @@ defaults = {
'/var/tmp/postgresdumps', '/var/tmp/postgresdumps',
}, },
}, },
'bash_functions': {
'pg_query_mon': "watch -n 2 \"echo \\\"SELECT pid, age(clock_timestamp(), query_start), usename, query FROM pg_stat_activity WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' ORDER BY query_start desc;\\\" | psql postgres\""
},
'icinga2_api': { 'icinga2_api': {
'postgresql': { 'postgresql': {
'services': { 'services': {

View file

@ -33,3 +33,8 @@ alias s='sudo -i'
% for k, v in sorted(node.metadata.get('bash_aliases', {}).items()): % for k, v in sorted(node.metadata.get('bash_aliases', {}).items()):
alias ${k}='${v}' alias ${k}='${v}'
% endfor % endfor
% for k, v in sorted(node.metadata.get('bash_functions', {}).items()):
${k}() {
${v}
}
% endfor