Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/max-rocket-internet/soti-mobicontrol-exporter

A Prometheus exporter for SOTI MobiControl
https://github.com/max-rocket-internet/soti-mobicontrol-exporter

Last synced: 10 days ago
JSON representation

A Prometheus exporter for SOTI MobiControl

Awesome Lists containing this project

README

        

# Soti MobiControl Prometheus exporter

A [Prometheus exporter](https://prometheus.io/docs/instrumenting/exporters/) for [SOTI MobiControl](https://soti.net/mobicontrol).

This exporter will expose the following metrics under the namespace `soti_mc` in Prometheus:

- Device agent online status by these labels:
- Server name
- Cellular carrier
- Network connection type
- Path in full
- Each device group
- Device cellular signal strength median by carrier
- Device events in the last 60 mins by same labels are above:
- Enrollment
- Last check in
- Last_agent connect
- Last agent disconnect
- REST API latency
- Servers version
- Servers status

Example:

```
# HELP soti_mc_api_latency Latency of SOTI MobiControl API endpoints
# TYPE soti_mc_api_latency gauge
soti_mc_api_latency{endpoint="/devices"} 0.296906808
soti_mc_api_latency{endpoint="/servers"} 0.266505251

# HELP soti_mc_devices_agent_online Agent online status of SOTI MobiControl devices
# TYPE soti_mc_devices_agent_online gauge
soti_mc_devices_agent_online{cellular_carrier="",network_connection_type="Wifi",online="0",path="\\\\My Company Global\\MyDevice - Model xxxx",path_split_1="",path_split_2="",path_split_3="My Company Global",path_split_4="MyDevice - Model xxxx",path_split_5="",path_split_6="",server_name="S99999"} 1
soti_mc_devices_agent_online{cellular_carrier="",network_connection_type="Wifi",online="0",path="\\\\My Company\\USA\\SomeCompany\\NYC",path_split_1="",path_split_2="",path_split_3="My Company",path_split_4="USA",path_split_5="SomeCompany",path_split_6="NYC",server_name="S99999"} 1
soti_mc_devices_agent_online{cellular_carrier="SimService",network_connection_type="Lte",online="0",path="\\\\My Company\\Colombia\\mydomain.com\\Sunmi",path_split_1="",path_split_2="",path_split_3="My Company",path_split_4="Colombia",path_split_5="mydomain.com",path_split_6="Sunmi",server_name="S99999"} 1
soti_mc_devices_agent_online{cellular_carrier="Telekom.de | IoT eSim",network_connection_type="Lte",online="0",path="\\\\My Company\\USA\\SomeCompany\\NYC",path_split_1="",path_split_2="",path_split_3="My Company",path_split_4="USA",path_split_5="SomeCompany",path_split_6="NYC",server_name="S99999"} 1

# HELP soti_mc_servers_status Status of SOTI MobiControl API servers by type
# TYPE soti_mc_servers_status gauge
soti_mc_servers_status{status="Offline",type="management"} 1
soti_mc_servers_status{status="Started",type="deployment"} 1
soti_mc_servers_status{status="Started",type="management"} 1

# HELP soti_mc_servers_version Version of SOTI MobiControl servers
# TYPE soti_mc_servers_version gauge
soti_mc_servers_version{version="14.4.0-4857"} 1
```

## Running

This exporter uses environment variables for configuration:

- `CLIENT_ID`: for authentication to the [SOTI REST API](https://www.soti.net/mc/help/v15.0/en/adminutility/tools/restapi.html).
- `CLIENT_SECRET`: for authentication to the [SOTI REST API](https://www.soti.net/mc/help/v15.0/en/adminutility/tools/restapi.html).
- `USERNAME`: for authentication to the [SOTI REST API](https://www.soti.net/mc/help/v15.0/en/adminutility/tools/restapi.html).
- `PASSWORD`: for authentication to the [SOTI REST API](https://www.soti.net/mc/help/v15.0/en/adminutility/tools/restapi.html).
- `MOBICONTROL_HOST`: The host for your MobiControl instance.
- `API_PREFIX`: prefix for accessing the SOTI MobiControl REST API, defaults to `/MobiControl/api`.
- `LOG_LEVEL`: log level, defaults to `INFO` but can be set to `DEBUG`.
- `API_CONCURRECNY`: how many requests to the API to make in parallel. Defaults to 50.
- `API_PAGE_SIZE`: how many items to request from the API at once. Defaults to 2000.

Example:

```shell
go build .

export CLIENT_ID="abcdefghijk123456789"
export CLIENT_SECRET="abcd/efghijk129sdfsdfsresd"
export USERNAME="user1"
export PASSWORD="password123456"
export MOBICONTROL_HOST="https://s012345.mobicontrolcloud.com"

./soti-mobicontrol-exporter
{"level":"info","msg":"soti-mobicontrol-exporter starting","time":"2020-03-26T16:42:09+01:00"}
```

## Docker image

Here: https://hub.docker.com/r/maxrocketinternet/soti-mobicontrol-exporter

```
docker pull maxrocketinternet/soti-mobicontrol-exporter
```

## Helm chart

Use the included [Helm](https://helm.sh/) chart to install easily on Kubernetes:

```shell
helm install ./chart soti-mobicontrol-exporter --values=my-values.yaml
```

Where `my-values.yaml` looks like:

```yaml
sotiApi:
username: user1
mobicontrol_host: https://s012345.mobicontrolcloud.com
client_id: abcdefghijk123456789
client_secret: abcd/efghijk129sdfsdfsresd
password: password123456
```