Add how to execute as non root to README.md

https://github.com/soundcloud/ipmi_exporter/issues/32
This commit is contained in:
cawamata 2019-10-06 18:35:19 +09:00 committed by GitHub
parent 3ec5c4f7f5
commit d0b97919ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -43,6 +43,32 @@ Make sure you have the following tools from the
- `ipmi-dcmi`
- `bmc-info`
### How to run as non root
When running this exporter as non root, you should the followings.
1. add sudoers files to permit the above commands
```bash
ipmi-exporter ALL = NOPASSWD:/usr/sbin/ipmimonitoring, /usr/sbin/ipmi-sensors, /usr/sbin/ipmi-dcmi, /usr/sbin/bmc-info
```
2. create the script under user dir with execute permission
```bash
#!/bin/sh
sudo /usr/sbin/$(basename $0) "$@"
```
3. create symlinks under user dir
```bash
ln -s /home/ipmi-exporter/[script name] /home/ipmi-exporter/ipmimonitoring
ln -s /home/ipmi-exporter/[script name] /home/ipmi-exporter/ipmi-sensors
ln -s /home/ipmi-exporter/[script name] /home/ipmi-exporter/ipmi-dcmi
ln -s /home/ipmi-exporter/[script name] /home/ipmi-exporter/bmc-info
````
4. execute ipmi-exporter with the option
```
--freeipmi.path=/home/ipmi-exporter
```
## Configuration
Simply scraping the standard `/metrics` endpoint will make the exporter emit