Monitoring UFT Mobile with Prometheus and Grafana
UFT Mobile have build-in integration with Prometheus for monitoring purposes.
The following guide will help you to configure Prometheus to scrape metrics that UFTM is exposing.
Mobile Connectors can report metrics to the UFTM Server and Prometheus can be configured to scrape those metrics.
- Enable Mobile Connectors to report metrics to Prometheus: edit configuration file metrics-config.properties (located at /connector/conf folder) and modify the following line:
Restart the connector service.
- Enable UFTM Server to expose metrics to Prometheus: edit setEnv.sh configuration file for linux user (located at /home/<user> directory)
For Windows system define system environment variable
- Restart the UFTM service.
- Install Prometheus - there are plenty of guidelines how to do it. See example Linux: https://www.enigma14.eu/martin/blog/2017/09/20/prometheus-installation-on-centos-7. Windows: https://mclarenappliedtechnologies.zendesk.com/hc/en-us/articles/360008182953-Setting-up-Infrastructure-Monitoring-with-Prometheus-and-Grafana
- Modify Prometheus configuration file (prometheus.yml) to scrape metrics from UFTM. Add the following section:
- job_name: 'mc_console' scrape_interval: 5s metrics_path: /rest/prometheus static_configs: - targets: ['<UFTM SERVER HOST>:<UFTM SERVER PORT>']
Optional: if embedded connector is used, please add the following to the prometheus.yaml
- job_name: 'mc_embedded_connector' scrape_interval: 5s scheme: <http/https> metrics_path: /hp4m-connector/rest/prometheus static_configs: - targets: ['<UFTM SERVER HOST>:<UFTM SERVER PORT>']
- Restart Prometheus
- Verify that scrape working: navigate to http://<PROMETHEUS HOST>:9090 and verify metric of "scrape_samples_scraped" - you should receive the data about job mc_console
- Install Grafana as visualization layer and configure it to work with Prometheus (see https://logz.io/blog/prometheus-monitoring/)
Few screenshots are attached for your convenience.
The following metrics are available (example):
- mc_connector: device connectivity gauge (1 - connected, 0 - disconnected)
- mc_connector: device wifi connectivity gauge
- mc_connector: vnc_enabled (actively open remote view on the device)
- mc_console: login_succeded (login to the tool)
- mc_console: reservation_succeded (create reservation for the device)
Please free to share your ideas about what metrics should be exposed there!
Also, there is additional metrics reporting using CSV files and statsD daemon (but I'll keep it for a different post).