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

multiple procstat sections failing #96

Closed
ZyanKLee opened this issue Feb 5, 2018 · 3 comments
Closed

multiple procstat sections failing #96

ZyanKLee opened this issue Feb 5, 2018 · 3 comments

Comments

@ZyanKLee
Copy link

ZyanKLee commented Feb 5, 2018

Hey,
I probably misunderstood something about the patches in #80, but I fail to implement multiple procstat sections.

What I did:

   procstat-nginx:
     - pattern: "nginx"
       pid_tag: true
       plugin_type: "procstat"
   procstat-php-fpm:
     - pattern: "php.*-fpm"
       pid_tag: true
       plugin_type: "procstat"

What I expected:

[[inputs.procstat]]
  pattern = "nginx"
  pid_tag = true
[[inputs.procstat]]
  pattern = "php.*-fpm"
  pid_tag = true

What I got instead:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template telegraf/telegraf.conf.erb:
  Filepath: /etc/puppetlabs/code/environments/production/modules/telegraf/templates/telegraf.conf.erb
  Line: 35
  Detail: undefined method `each' for nil:NilClass
 at /etc/puppetlabs/code/environments/production/modules/telegraf/manifests/config.pp:12:18 on node $SERVERNAME
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

System Specs

  • ubuntu 16.04 (all systems)
  • puppet agent 4.10.9
  • puppetserver version: 2.8.0
  • yankcrime/telegraf 2.0.0
@nrdmn
Copy link
Contributor

nrdmn commented Feb 5, 2018

Hi,
please try

   procstat:
     - pattern: "nginx"
       pid_tag: true
     - pattern: "php.*-fpm"
       pid_tag: true

@ZyanKLee
Copy link
Author

ZyanKLee commented Feb 5, 2018

I had a look at the mentioned template file. line 35 is related to outputs, not inputs.
so I further looked at our output declaration:

    outputs  => {
        'influxdb' => [
            {
                'urls'     => [ "http://influxdb.ourdomain.exmpl:8086" ],
                'database' => 'telegraf',
                'username' => 'telegraf',
                'password' => 'metricsmetricsmetrics',
                'retention_policy'  => '',
                'write_consistency' => 'any',
                'timeout'           => '20s',
            }
        ]
    },

this seems rather basic to me. (we only added the last three parameters and do only use one influxdb url)

@ZyanKLee
Copy link
Author

ZyanKLee commented Feb 5, 2018

update:

after I added those squared brackets the issue at line 35 of the template was fixed, next issue is at line 55:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template telegraf/telegraf.conf.erb:
  Filepath: /etc/puppetlabs/code/environments/production/modules/telegraf/templates/telegraf.conf.erb
  Line: 55
  Detail: undefined method `each' for nil:NilClass
 at /etc/puppetlabs/code/environments/production/modules/telegraf/manifests/config.pp:12:18 on node $SERVERNAME

after going through all the hieradata and profiles and adding that extra layer (as shown for the nginx input in the README.md) puppet ran without error. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants