UCS Dashboard/Prometheus

ucs-4-3

#1

It is possible using the prometheus inside univention to get values from other servers? For instance a suse linux server?

Can i send the information from that server to univention and the use that data grafana?

Thanks


#2

Anyone can point me where i can change the prometheus start up command? I need activate the admin api…

Thanks


#3

@botner can you help?

Thanks


#4

You can manually configure Prometheus targets. Prometheus collects the data form all known targets and so the data is available in Grafana, e.g.

UCS with the dashboard Apps and a Ubuntu client (192.138.0.28). On the Ubuntu client, install the prometheus-node-exporter package. On the UCS system add this to the Prometheus config file /var/lib/univention-appcenter/apps/prometheus/conf/prometheus.yml (indentation is important):

  - job_name: 'suse'
    scrape_interval: 1m
    scheme: http
    static_configs:
      - targets: ['192.138.0.28:9100']
    relabel_configs:
      - source_labels: [__address__]
        regex: '([^:]+):.*'
        target_label: instance
        replacement: "$1"

With this config Prometheus tries to find the metrics on http://192.168.0.28:9100/metrics, so as long as the UCS server can reach the ip of the target, we should be fine.

BUT, currently there is no custom Prometheus config so we have to modify /var/lib/univention-appcenter/apps/prometheus/conf/prometheus.yml and this file is auto generated and overwritten during the update of the Prometheus app. But i just added a custom-prometheus.yml for the next version of the app. This file is for “custom” Prometheus configurations, included in the main config file and persistent during updates.

So add the config snippet from above to /var/lib/univention-appcenter/apps/prometheus/conf/prometheus.yml AND create a new file /var/lib/univention-appcenter/apps/prometheus/conf/custom-prometheus.yml with this config.
Then, during the next app update prometheus.yml is (re)generated but thanks to custom-prometheus.yml your config changes will survive.


#5

@botner thanks for your time!

I will do that!
I already use the custom_target.yml files to my other targets.

Other issue that i have is that i cannot change the docker command… and why ? Because i need to activate the --web.enable-admin-api and i think that is only possible in the command it cannot be done via configuration… can we have an ucr variable to activate or deactivate that?

Thanks


#6

I will look into that, not today, but asap