-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the out-of-date readme file (#72)
* Remove `envdir` from `tox.ini`. The config option `envdir` is never intended to be used to share env directory [1]. [1] tox-dev/tox#2788 (comment). * Update author name. * Update the description for the cli: `prometheus-hardware-exporter` * Update existing readme and create readme for snap. * Update description of `snapcraft.yaml`. * Move the "grade" in `snapcraft.yaml` back to devel. * Fix broken snap build: move confinement back to `strict`.
- Loading branch information
1 parent
5f33417
commit 2b7c315
Showing
11 changed files
with
122 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Prometheus Hardware Exporter Snap | ||
|
||
**Work In Progress**: the snap is only ready for local testing. | ||
|
||
## Local Build and Testing | ||
|
||
You need `snapcraft` to build the snap: | ||
|
||
```shell | ||
sudo snap install snapcraft --classic | ||
``` | ||
|
||
Snapcraft also requires backend to create isolated build environment. You can | ||
choose either of the following two backends for snapcraft: | ||
|
||
- [LXD](https://linuxcontainers.org/lxd/introduction/), which creates container | ||
image build instances. It can be used inside virtual machines. | ||
- [Multipass](https://multipass.run/), which creates virtual machine build | ||
instances. It cannot be reliably used on platforms that do not support nested | ||
virtualization. For instance, Multipass will most likely not run inside a | ||
virtual machine itself. | ||
|
||
To build the snap: | ||
|
||
```shell | ||
make build | ||
``` | ||
|
||
To try the snap that was built, you can install it locally: | ||
|
||
```shell | ||
sudo snap install --devmode ./$(grep -E "^name:" snap/snapcraft.yaml | awk '{print $2}').snap | ||
``` | ||
|
||
Start the exporter: | ||
|
||
```shell | ||
sudo snap start prometheus-hardware-exporter # by default it listen on port 10000 | ||
``` | ||
|
||
When you're done testing, you can remove the snap: | ||
|
||
```shell | ||
sudo snap remove prometheus-hardware-exporter | ||
``` | ||
|
||
## Snap Configuration | ||
|
||
The install hook (`./snap/hooks/install`) will generate a default configuration | ||
for the exporter. By default, the exporter is started at port 10000 with a | ||
logging level of INFO. | ||
|
||
You can change the default configuration by editing | ||
|
||
```shell | ||
/var/snap/prometheus-hardware-exporter/current/config.yaml | ||
``` | ||
|
||
and then restart the snap by | ||
|
||
```shell | ||
sudo snap restart prometheus-hardware-exporter | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
# Prometheus Exporter Snap for Hardware Observer charm | ||
# Prometheus Hardware Exporter | ||
|
||
Prometheus Hardware Exporter exports Prometheus metrics from BMCs (Baseboard | ||
management controllers) using IPMI (Intelligent Platform Management Interface) | ||
and Redfish protocol. It also exports and various SAS (Serial Attached SCSI) and | ||
RAID (redundant array of inexpensive disks) controllers. | ||
|
||
You can learn more about Hardware Observer on [Charmhub](https://charmhub.io/hardware-observer). | ||
## Getting Started | ||
Prometheus Hardware Exporter is recommended for [Juju](https://juju.is/) users. | ||
You can deploy Prometheus Hardware Exporter using the Hardware Observer charm. | ||
For more information, you can read the documentation about Hardware Observer on | ||
[Charmhub](https://charmhub.io/hardware-observer). | ||
|
||
Install the snap from snap store: | ||
**Note**: this exporter does not bundle the required third party or proprietary | ||
software. If you would like to use this exporter, you will need to install them | ||
by yourself. | ||
|
||
```bash | ||
$ sudo snap install prometheus-hardware-exporter --classic | ||
``` | ||
|
||
Start the exporter: | ||
|
||
```bash | ||
$ sudo snap start prometheus-hardware-exporter | ||
``` | ||
|
||
## Snap Configuration | ||
## Installation | ||
|
||
The install hook (`./snap/hooks/install`) will generate a default configuration | ||
for the exporter. By default, the exporter is started at port 10000 with a | ||
logging level of INFO. | ||
This package is not published anywhere as of now. Currently, it can be installed | ||
locally or on a virtual environment. To install it on a virtual environment, | ||
run: | ||
|
||
You can change the default configuration by editing | ||
```shell | ||
# Install virtualvenv and source it | ||
pip3 install virtualenv | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
|
||
```bash | ||
$ /var/snap/prometheus-hardware-exporter/current/config.yaml | ||
# Install the prometheus-hardware-exporter package; the "(venv)" prefix on the | ||
# shell prompt indicates that the virtual environment is active. | ||
(venv) pip3 install . | ||
``` | ||
|
||
and then restart the snap by | ||
To verify that the package has been installed successfully, run: | ||
|
||
```bash | ||
$ sudo snap restart prometheus-hardware-exporter | ||
```shell | ||
(venv) prometheus-hardware-exporter -h | ||
``` | ||
|
||
## Local Build and Testing | ||
If you see the help message, then `prometheus-hardware-exporter` is installed on | ||
the virtual environment. | ||
|
||
You need `snapcraft` to build the snap: | ||
## Usages | ||
|
||
```bash | ||
$ sudo snap install snapcraft --classic | ||
``` | ||
To start the exporter at port `10000` and enable the ipmi sensor collector, run: | ||
|
||
Snapcraft also requires backend to create isolated build environment, you can | ||
choose the following two backends: | ||
```shell | ||
(venv) prometheus-hardware-exporter -p 10000 --collector.ipmi_sensor | ||
``` | ||
|
||
- [LXD](https://linuxcontainers.org/lxd/introduction/), which creates container | ||
image build instances. It can be used inside virtual machines. | ||
- [Multipass](https://multipass.run/), which creates virtual machine build | ||
instances. It cannot be reliably used on platforms that do not support nested | ||
virtualization. For instance, Multipass will most likely not run inside a | ||
virtual machine itself. | ||
Note that all the exporters are disabled by default as you will need to install | ||
the appropriate third party or proprietary software to run the collectors. You | ||
can check out [Resources](https://charmhub.io/hardware-observer/resources/) to | ||
find out more information about the third party software. | ||
|
||
To build the snap: | ||
## Supported Metrics | ||
|
||
```bash | ||
$ make build | ||
``` | ||
You can learn more about the metrics from [Hardware Observer | ||
documentation](https://charmhub.io/hardware-observer/docs/metrics-and-alerts-common). | ||
|
||
To try the snap that was built, you can install it locally: | ||
## Snap support | ||
|
||
```bash | ||
$ sudo snap install --devmode ./$(grep -E "^name:" snap/snapcraft.yaml | awk '{print $2}').snap | ||
``` | ||
This is still work in progress, and only support local testing. For more | ||
information on building and running the snap locally, please refer to | ||
[README-SNAP.md](README-SNAP.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters