/workspaceone-exporter

WorkspaceOne UEM Prometheus exporter

Primary LanguageGo

WorkspaceOne Prometheus Exporter

WorkspaceOne UEM Prometheus exporter

Description

This exporter is used to export WorkspaceOne UEM value to OpenMetrics format.

TODO

  • Correct api_calls metrics as it doesn't count the total amount of API calls but only one made by one Prometheus scrape
  • Validate the TAG_FILTER parsing when an empty parse filter is given
  • Add more metrics (need suggestions)

Accessing the metrics

  • Default port: 9740
  • Endpoint: /metrics

example: http://localhost:9740/metrics

Metrics

Metric Description Labels Type Implemented
api_calls The number of API calls made to the WS1 tenant none Counter
devices_number The number of devices in the WS1 tenant none Gauge
devices_os The number of devices per OS in the WS1 tenant os Gauge
devices_offline The number of devices in the WS1 tenant that are offline none Gauge
devices_online The number of devices in the WS1 tenant that are online none Gauge
tags_sum The number of tags in the WS1 tenant none Gauge
devices_online_tag The number of devices online per tag in the WS1 tenant tag, model Gauge
devices_offline_tag The number of devices offline per tag in the WS1 tenant tag, model Gauge
devices_offline_1m_tag The number of devices offline per tag in the WS1 tenant for more than the last month tag, model Gauge

Environment variables

Variable Description Type Comment
WS1_AUTH_KEY WorkspaceOne UEM user Auth Key string
WS1_TENANT_KEY WorkspaceOne UEM tenant key string
WS1_URL WorkspaceOne UEM base API URL endpoint, must finished by /API string
WS1_LGID WorkspaceOne UEM highest Group ID string
WS1_INTERVAL Interval between each WS1 check to it's enrolled devices in minutes string
TAG_PARSING Enable or disable the tag parsing string must be true of false
TAG_FILTER String to filter Tag by it string Will apply a regex filter using this string over all tags
INSECURE Enable or disable the TLS verification string must be true of false

FlowChart

graph RL
    A[Prometheus ] --> B[WorkspaceOne Exporter]
    B --> C[WorkspaceOne UEM]
Loading

Usage

Filter by Tag

You can filter the devices by tag by using the TAG_FILTER environment variable. It will enable the system to only keep the tags that contain the string you set.

Running it locally

go run ./...

Run it as a Docker container

docker build -t w1-prometheus-exporter .
docker run -d -p 9740:9740 w1-prometheus-exporter

Useful links