@@ -6,7 +6,66 @@ Tested with an Alcatel HH41 4G LTE hotspot WiFi router.
6
6
7
7
## Usage
8
8
9
- Detailed usage TBC.
9
+ Install Poetry for you system (need ` >=1.2.0b1 ` currently if using
10
+ the dynamic versioning, and have to add the relevant plugin with
11
+ ` poetry plugin add poetry-dynamic-versioning-plugin ` ). Then install the
12
+ package with:
13
+
14
+ ``` shell
15
+ poetry install
16
+ ```
17
+
18
+ You'll need a Request Key to run exporter, which is derived from the
19
+ login password of router box admin interface. See below how to
20
+ obtain it.
21
+
22
+ Once you have a key, you can set it in multiple ways:
23
+
24
+ * In ` .secrets.toml ` , see the template shipped at ` secrets.toml.template `
25
+ for the format (note the ` . ` for the non-template filename), OR
26
+ * Set an environment variable ` DYNACONF_REQUEST_KEY ` with the value, e.g.
27
+ ` export DYNACONF_REQUEST_KEY=... ` in your shell where ` ... ` is replaced with
28
+ the actual value.
29
+
30
+ Then start up the exporter:
31
+
32
+ ``` shell
33
+ poetry run exporter
34
+ ```
35
+
36
+ ### Running in Docker
37
+
38
+ Build the image with the included Dockerfile from the cloned repository,
39
+ let's say:
40
+
41
+ ``` shell
42
+ docker build -t linkhub_exporter
43
+ ```
44
+
45
+ and then run the resulting image as:
46
+
47
+ ``` shell
48
+ docker run -ti --rm -e " DYNACONF_REQUEST_KEY=...." -p 9877:9877 linkhub_exporter
49
+ ```
50
+
51
+ which exposes the Prometheus metrics on ` http://localhost:9877 ` . Don't forget
52
+ to set the ` DYNACONF_REQUEST_KEY ` value, or add it in an ` .env ` file and
53
+ run things as:
54
+
55
+ ``` shell
56
+ docker run -ti --rm --env-file .env -p 9877:9877 linkhub_exporter
57
+ ```
58
+
59
+ ### Getting the request key
60
+
61
+ Currently the easiest way to get it is to:
62
+
63
+ * Open a browser and navigate to your router admin interface
64
+ * Open the debug console, and ensure that network requests are logged there
65
+ * Log in to the admin interface
66
+ * Check requests going to ` webapi ` , look for the requests headers, and the
67
+ value of the ` _TclRequestVerificationKey ` is what you should use for the
68
+ request key setting of this exporter.
10
69
11
70
## License
12
71
0 commit comments