diff --git a/templates/911_service-grafana.yaml.tt2 b/templates/911_service-grafana.yaml.tt2 new file mode 100644 index 0000000..aa8cdfd --- /dev/null +++ b/templates/911_service-grafana.yaml.tt2 @@ -0,0 +1,24 @@ +[% + PROCESS '/usr/lib/ngcp-ngcpcfg/get_hostname'; + hostname = out; + + argv.role = 'mgmt'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_mgmt = out; + + argv.role = 'li'; + PROCESS '/usr/lib/ngcp-ngcpcfg/has_role'; + is_li = out; + is_li_enabled = is_li && cluster_sets.type == 'distributed' && intercept.enabled == 'yes'; +-%] + +command: + +[% IF grafana.enabled == 'yes' && (is_mgmt || is_li_enabled) -%] + sqlite3 /var/lib/grafana/grafana.db "select name from data_source": + exit-status: 0 + stdout: + - "/^ngcp$/" + - "/^telegraf$/" + stderr: [] +[% END -%] diff --git a/templates/goss.yaml.tt2 b/templates/goss.yaml.tt2 index 98c83d5..c82071a 100644 --- a/templates/goss.yaml.tt2 +++ b/templates/goss.yaml.tt2 @@ -37,6 +37,7 @@ gossfile: [% END -%] 900_service-ngcp-api.yaml: {} 910_service-influxdb.yaml: {} + 911_service-grafana.yaml: {} [% IF general.ngcp_type != 'spce' -%] 920_service-asterisk-odbc-pro.yaml: {} [% END -%]