- Move every collector into its own file
- Move FreeIPMI code into own package
- Allow more customization of commands executed by collectors
- Split up documentation, so README is a little less overwhelming
A single commit message does not do justice to the amount of changes
here, but hey... :)
The events are currently not used for anyways, and this avoids the case
where `ipmimonitoring` outputs several events quoted in a way that is at
best borderline CSV-compatible.
Fixes#62
The `freeipmiOutput` function is used many in places. It already returns
an error if it encounters one, so it should leave the handling as well
as the severity of the logging of the error to the caller.
More specifically, the case has come up where `bmc-info` may fail, but
still provide partial results that the collector can use. This commit
allows to do so without littering the log with errors.
This is a workaround for an issue described in #57. The bmc-info command
might produce usable output minus the system firmware revision, but then
choke on that. Try to recover in that scenario by attempting to parse
the output even if the command failed. Since the system firmware
revision is already optional, this should at least produce all other
values.
It is not pretty, but it avoids both folks having to change their
configs as well a second round-trip, which can be quite expensive in
IPMI.
There are systems that do not make this available, so don't make the
entire collector fail if only this metric can not be read. Instead, set
it to "N/A" if it cannot be determined.
This fixes#57.
Add the "system firmware version" (i.e. the host's "BIOS version", as
opposed to the BMC firmware version) as a label to the `bmc_info`
metric.
This fixes#51.
It exposes two metrics about the IPMI system event log (SEL), the
current number of entries stored in it and the free space for new
records. The collector is not enabled by default, it has to be
explicitly enabled in the config.
Related to #41.
The hash is the comment character in the config file, even if it occurs
in the middle of the password. This can be worked around however by
escaping it.
This fixes#16.
Now that we have a good config framework in place, this is low-hanging
fruit. Will apply to all collectors used, so total scrape time for
Prometheus could be (timeout * #-of-collectors) milliseconds for a given
module.
Related to #20.
Specifically, allow definition of a set of settings as module in the
configuration file, and the ability to use these settings by setting the
`module` URL parameter to the respective module name when scraping.
THIS COMMIT CHANGES THE CONFIG FORMAT IN A NON-BACKWARDS-COMPATIBLE WAY!
Based on this, the following "side effects" are noteworthy:
- the exporter no longer requires a config file
- the IPMI "privilege level" can be set in the config file
- collectors can be enabled/disabled in the config file
- anonymous IPMI access is now theoretically possible
- there are now two example configurations (local & remote)
This fixes#10 by allowing to set the privilege level.
This enables the standard `/metrics` endpoint. A scrape will trigger the
collection of IPMI metrics from the local machine (that the exporter is
running on).
Instead of failing hard and not returning any metrics at all if just one
(or two) of the three calls to IPMI tools fail, return whatever data was
properly received and add a `collector` label to the `ipmi_up` metric
indicating which tools failed.
This is only a small step towards the concept of "collectors" like they
exist e.g. in the node exporter, but it should help solve #1. Additional
functionality, like disabling certain collectors, can be built on top of
this.
Currently, an error in the `ipmi` collector is always logged as an error,
In the `dcmi` and `bmc` collectors, an error retrieving the data is only
logged as debug output, but an error processing retrieved data is logged
as an error. This should cover most use cases and will be improved upon
once more work is done to make the collectors selectable per scrape.
Use a named pipe with 0600 permissions to pass the credentials to
FreeIPMI instead of using the command line, which certainly constitutes
bad security practice.
Template the `driver-type` while at it to potentially support local IPMI
at some point.