Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian daemon template: Split and escape args to avoid quotes passed as args #299

Merged
merged 1 commit into from
May 20, 2019

Conversation

ntesteca
Copy link

Pull Request (PR) description

Split and escape args in the daemon template to avoid quotes passed as args to the exporter.
Tested with Debian 7 and apache, node, mysqld exporters.

This Pull Request (PR) fixes the following issue

Fixes #296

@bastelfreak
Copy link
Member

@ntesteca thanks for providing this fix. Are you able to provide a test for this?

@bastelfreak bastelfreak added bug Something isn't working needs-tests labels Feb 19, 2019
@ntesteca
Copy link
Author

It looks like the test was already there but not used since Debian 7 is not supported anymore.

Before the fix:

PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian7-64 BEAKER_HYPERVISOR=docker bundle exec rake beaker
...
Failures:

  1) prometheus apache exporter default install Process "apache_exporter" args should match /\ -scrape_uri http:\/\/localhost\/server-status\?auto/
     Failure/Error: its(:args) { is_expected.to match %r{\ -scrape_uri http://localhost/server-status\?auto} }
       expected "/usr/local/bin/apache_exporter -scrape_uri \"http://localhost/server-status?auto\"" to match /\ -scrape_uri http:\/\/localhost\/server-status\?auto/
       Diff:
       @@ -1,2 +1,2 @@
       -/\ -scrape_uri http:\/\/localhost\/server-status\?auto/
       +"/usr/local/bin/apache_exporter -scrape_uri \"http://localhost/server-status?auto\""
       
       
     # ./spec/acceptance/apache_exporter_spec.rb:25:in `block (4 levels) in <top (required)>'

  2) prometheus apache exporter apache_exporter update from 0.4.0 to 0.5.0 Process "apache_exporter" args should match /\ -scrape_uri http:\/\/localhost\/server-status\?auto/
     Failure/Error: its(:args) { is_expected.to match %r{\ -scrape_uri http://localhost/server-status\?auto} }
       expected "/usr/local/bin/apache_exporter -scrape_uri \"http://localhost/server-status?auto\"" to match /\ -scrape_uri http:\/\/localhost\/server-status\?auto/
       Diff:
       @@ -1,2 +1,2 @@
       -/\ -scrape_uri http:\/\/localhost\/server-status\?auto/
       +"/usr/local/bin/apache_exporter -scrape_uri \"http://localhost/server-status?auto\""
       
       
     # ./spec/acceptance/apache_exporter_spec.rb:43:in `block (4 levels) in <top (required)>'

  3) prometheus apache exporter apache_exporter update from 0.4.0 to 0.5.0 Process "apache_exporter" args should match /\ -scrape_uri http:\/\/localhost\/server-status\?auto/
     Failure/Error: its(:args) { is_expected.to match %r{\ -scrape_uri http://localhost/server-status\?auto} }
       expected "/usr/local/bin/apache_exporter -scrape_uri \"http://localhost/server-status?auto\"" to match /\ -scrape_uri http:\/\/localhost\/server-status\?auto/
       Diff:
       @@ -1,2 +1,2 @@
       -/\ -scrape_uri http:\/\/localhost\/server-status\?auto/
       +"/usr/local/bin/apache_exporter -scrape_uri \"http://localhost/server-status?auto\""
       
       
     # ./spec/acceptance/apache_exporter_spec.rb:62:in `block (4 levels) in <top (required)>'

...

@bastelfreak
Copy link
Member

Hi.
I just noticed that the tests for Debian 8 and 9 passed. We don't support Debian 7 anymore. I rebased this PR and will merge it when travis turns green again.

@bastelfreak bastelfreak merged commit f54347d into voxpupuli:master May 20, 2019
Rovanion pushed a commit to Rovanion/puppet-prometheus that referenced this pull request May 5, 2021
Debian daemon template: Split and escape args to avoid quotes passed as args
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apache_exporter unable to contact apache on Debian 7
2 participants