prometheus-community / ipmi_exporter

Remote IPMI exporter for Prometheus
MIT License
474 stars 134 forks source link

Example config file #25

Closed davidlesicnik closed 5 years ago

davidlesicnik commented 5 years ago

Hello! I'm trying to set up ipmi_exporter on a host to do remote monitoring on two HP servers. The problem I'm running into is that I don't quite know how to set up the config file. (Unless I'm missing something) In the readme it only says the syntax is similar to blackbox. However I don't quite know what modules exist nor do I know what the exact syntax is.

Having an example config.file would be very helpful. If not then just a list of modules and a general overview.

bitfehler commented 5 years ago

Hi there!

Please not that config.file only refers to the command line parameter used to specify the config file to be used, i.e. with the latest version you would run a command like this: ./ipmi_exporter --config.file=ipmi.yml

As stated in the README, there are two example configuration files available, ipmi_local.yml for scraping the IPMI interface on the local host, and ipmi_remote.yml for scraping remote hosts.

With the local version, you would run the exporter on each server you want to monitor. With the remote version, you could run the exporter on some host (e.g. the Prometheus server) and use the same exporter to monitor all hosts. The latter will make the Prometheus config a bit more complex, but it is also documented in the README.

The "modules" in the IPMI exporter are only sets of configuration items that you define yourself. There are no predefined modules. If your servers are configured the same way (including usernames and passwords), you can use a single module to scrape them both. If not, you'll need a separate module for each server.

I am pretty sure the example configs will answer most of your questions. Let me know if anything remains unclear. If you have any improvement suggestions for the README, I am happy to consider those as well, however the example configs are clearly already in there, so I will go ahead and close this issue :wink: (feel free to use it for follow-up questions anyways)

davidlesicnik commented 5 years ago

Thanks, I guess I missed the files, sorry!

I do have a bug report (of sorts), not used to GitHub, so not sure if should be written here or as a separate issue.

On the example prometheus config for setting up remote ipmi hosts there's an error at line 3

- job_name: ipmi
  params:
    module: default
  scrape_interval: 1m
[...]

Just leaving it default errored prometheus out, with the log saying

Apr 29configuration (--config.file=\"/etc/prometheus/prometheus.yml\"): parsing YAML file /etc/prometheus/prometheus.yml: yaml: unmarshal errors:\n line 51: cannot unmarshal !!str default into []

So I looked back at how I set up the blackbox exporter and put default into brackets Like so:

- job_name: ipmi
  params:
    module: [default]
  scrape_interval: 1m
[...]

Doing that fixed the issue.