Exclude sensors ids to be define at a target level
nwies opened this issue · 6 comments
Hello,
Could you please define the exclude ID at "target" level and a global one?
I'm trying to set a ipmi exporter on 4 different systems (idrac7/ilo4/idrac9); I'm only need power and temperature. But each system had his own sensor Id.
For example, 97 will be the power sensor Id on one system
Thanks a lot.
Hi there,
the "exclude IDs" are already specified at the module level (see example), which can be translated to per-target. This seems to be what you want?
Are you using one exporter to scrape the four systems remotely, or are you running one exporter on each system?
Hello,
Thanks for your reply.
Yes, I would like to have the "exclude IDS" at a per-target level.
You are right, I'm planning to use only one exporter to scrape the 4 systems remotely.
BR
Ok, cool. Then you'll need to prepare an exporter config file with four modules, similar to the example, one module per host. It is common practice, though not required, to name the modules after the addresses of your targets.
You will then need to configure your Prometheus server to scrape each instance using the correct module parameter. If you follow the above mentioned naming convention, you can do it with a label rewrite, as documented at the very bottom of this section, but it's best to read the entire section carefully.
This way, you'll have one module per target, allowing you specify different sensor excludes for each one.
hello,
Please find my ipmi.ymL
ipmi_NWIES.yml.txt
For now, I only prep the file and did not start the exporter itself
Hello,
Thanks for pointing the idea of drop metrics from prometheus side.
Please find the complete workaround:
I used the file ipmi_NWIES.yml_V2.txt : the main difference is the unset of default user and password.
I add on my prometheus.yml the file prometheus_NWIES.yml.txt :
For each target:
I add to define a "target" job params and a "module" job params.
I hardcode the instance full text replacement.
the "targets" line is the server running the ipmi_exporter
ipmi_NWIES.yml__V2.txt
prometheus_NWIES.yml.txt
I created the file /etc/sudoers.d/ipmi_exporter
exporters ALL = NOPASSWD: /usr/sbin/ipmimonitoring,
/usr/sbin/ipmi-sensors,
/usr/sbin/ipmi-dcmi,
/usr/sbin/ipmi-raw,
/usr/sbin/bmc-info,
/usr/sbin/ipmi-chassis,
/usr/sbin/ipmi-sel,
/usr/bin/ipmitool
So now, the only "ipmi*" metrics from my prometheus are this one:
You can close this issue if you want.
BR
Cheers, glad it worked.