Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

Add quotes to node_exporter parametrs in systemd service #144

Merged
merged 1 commit into from
Feb 26, 2020
Merged

Add quotes to node_exporter parametrs in systemd service #144

merged 1 commit into from
Feb 26, 2020

Conversation

ruzickap
Copy link
Contributor

Add quotes to node_exporter parametrs in systemd service.

When using the code like:

    - role: cloudalchemy.node-exporter
      node_exporter_enabled_collectors:
        - diskstats:
            ignored-devices: "^(ram|loop|fd)\\d+$"

Currently the systemd template for node_exporter looks:

# grep -A2 'ExecStart=' /etc/systemd/system/node_exporter.service
ExecStart=/usr/local/bin/node_exporter \
--collector.diskstats \
    --collector.diskstats.ignored-devices=^(ram|loop|fd)\d+$ \

Which is wrong. That's why created this PR which is adding quotes to do it properly:

ExecStart=/usr/local/bin/node_exporter \
--collector.diskstats \
    --collector.diskstats.ignored-devices="^(ram|loop|fd)\d+$" \

@github-actions github-actions bot added the area/jinja Templates label Feb 20, 2020
templates/node_exporter.service.j2 Outdated Show resolved Hide resolved
Add quotes to node_exporter parametrs in systemd service
@paulfantom paulfantom merged commit 05481aa into cloudalchemy:master Feb 26, 2020
@ruzickap ruzickap deleted the fix_parameters branch February 26, 2020 09:03
@cmoetzing
Copy link

cmoetzing commented Feb 17, 2021

I am not sure if this problem is really fixed.
The line --collector.{{ name }}.{{ k }}={{ v }} \ was change but the error is in line --collector.{{ name }} \
Since I am still facing the problem I changed {% set name, options = (collector.items()|list)[0] -%} to {% set name, options = (collector.items()|list)[0] %} and that seems to fix the problem (removed the - at the end).
I have no idea what my change means. 😄

@downspot
Copy link

downspot commented Mar 6, 2022

Any chance in getting this bug opened back up it's not working as described. I used the fix by @cmoetzing which is working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/jinja Templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants