File tree Expand file tree Collapse file tree 6 files changed +10
-14
lines changed
Expand file tree Collapse file tree 6 files changed +10
-14
lines changed Original file line number Diff line number Diff line change 11FROM ubuntu:24.04
22
3+ RUN apt-get update
4+ && apt-get install -y nvme-cli
5+ && rm -rf /var/lib/apt/lists/*
6+
37COPY nvme_exporter /usr/bin/nvme_exporter
48
59EXPOSE 9998
Original file line number Diff line number Diff line change @@ -25,13 +25,15 @@ Supported [NVMe CLI](https://github.com/linux-nvme/nvme-cli) versions:
2525* Grafana: In [ resources] ( resources/grafana/ ) for dashboards.
2626 * [ smart-log dashboard] ( https://grafana.com/grafana/dashboards/14706 )
2727* Prometheus: In [ resources] ( resources/prom/ ) for recording and alert rules.
28+ * Systemd: In [ resources] ( resources/systemd/ ) for executing the exporter as unit.
29+ * Scripts: In [ resources] ( resources/scripts/ ) for package installation hooks.
2830
2931## Running
3032
31- Running the exporter requires the nvme-cli package to be installed on the host.
33+ Running the exporter requires the nvme-cli package to be installed on the host and be ` root ` account .
3234
3335``` bash
34- ./ nvme_exporter -h
36+ nvme_exporter -h
3537```
3638
3739### Flags
@@ -41,9 +43,3 @@ Running the exporter requires the nvme-cli package to be installed on the host.
4143| port | Listen port number. Type: String. | ` 9998 ` |
4244| ocp | Enable OCP smart log metrics. Type: Bool. | ` false ` |
4345| endpoint | The endpoint to query for metrics. Type: String. | ` /metrics ` |
44-
45- ## Build
46-
47- ``` bash
48- go build .
49- ```
Original file line number Diff line number Diff line change 1010
1111echo " Detected systemd as init system, proceeding"
1212
13- useradd -r nvme_exporter -s /bin/false || true
14-
1513systemctl daemon-reload
1614
1715systemctl enable nvme_exporter.service
Original file line number Diff line number Diff line change 11#! /bin/sh
22set -e
33
4- userdel -f nvme_exporter || true
5-
64systemctl daemon-reload
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ After=network-online.target
55[Service]
66Type =simple
77
8- User =nvme_exporter
9- Group =nvme_exporter
8+ User =root
9+ Group =root
1010
1111ExecStart =/usr/bin/nvme_exporter
1212
You can’t perform that action at this time.
0 commit comments