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

Exec plugin not working - what am i missing? #2525

Closed
asangal opened this issue Mar 10, 2017 · 2 comments
Closed

Exec plugin not working - what am i missing? #2525

asangal opened this issue Mar 10, 2017 · 2 comments

Comments

@asangal
Copy link

asangal commented Mar 10, 2017

http://stackoverflow.com/questions/42708348/telegraf-exec-plugin-aws-ec2-ebs-volumen-info-metric-parsing-error-reason

cat /tmp/aws-vol-info.csv
create_time=2017-01-09_2324294280000000,availability_zone=us-east-2b,volume_id=vol-058e1d47dgh721121,volume_type=gp2,state=in-use,size=8,iops=100,encrypted=False,snapshot_id=snap-06h1h1b91bh662avn,kms_key_id=None,InstanceId=i-0jjb1boop26f42f50,InstanceVolumeState=attached,DeleteOnTermination=True,Device=/dev/sda1,Name=[company-2b-app90]_secondary,hostname=company-2b-app90-i-0jjb1boop26f42f50,high_availability=1,mirror=secondary,cluster=company,autoscale=true,role=app
[vagrant@myvagrant ~] $


[vagrant@myvagrant ~] $ cat /tmp/aws-vol-info.sh 
#!/bin/bash

cat /tmp/aws-vol-info.csv
[vagrant@myvagrant ~] $ 


[vagrant@myvagrant ~] $ cat /etc/telegraf/telegraf.d/exec-plugin-aws-info.conf 
#--- https://github.com/influxdata/telegraf/tree/master/plugins/inputs/exec

[[inputs.exec]]
  commands = ["/tmp/aws-vol-info.sh"]

  ## Timeout for each command to complete.
  timeout = "5s"

  # Data format to consume.
  # NOTE json only reads numerical measurements, strings and booleans are ignored.
  data_format = "influx"
  
  name_suffix = "telegraf_execplugin"

Ran: telegraf --config-directory=/etc/telegraf --test --input-filter=exec

[vagrant@myvagrant ~] $ telegraf --config-directory=/etc/telegraf --test --input-filter=exec
2017/03/10 01:09:45 I! Using config file: /etc/telegraf/telegraf.conf
* Plugin: inputs.exec, Collection 1
2017-03-10T01:09:45Z E! Errors encountered: [ metric parsing error, reason: [missing fields], buffer: [create_time=2017-01-09_2324294280000000,availability_zone=us-east-2b,volume_id=vol-058e1d47dgh721121,volume_type=gp2,state=in-use,size=8,iops=100,encrypted=False,snapshot_id=snap-06h1h1b91bh662avn,kms_key_id=None,InstanceId=i-0jjb1boop26f42f50,InstanceVolumeState=attached,DeleteOnTermination=True,Device=/dev/sda1,Name=[company-2b-app90]_secondary,hostname=company-2b-app90-i-0jjb1boop26f42f50,high_availability=1,mirror=secondary,cluster=company,autoscale=true,role=app], index: [471]]
[vagrant@myvagrant ~] $ 

How can I get the .csv file format working with Telegraf's exec plugin?
Thanks.

@danielnelson
Copy link
Contributor

You need to format the line according to your data_format option, in this case it should be influx line protocol.

We try to reserve GitHub Issues for actionable bug reports or feature requests. Please ask general questions at the InfluxData Community site.

@Siddhu1096
Copy link

@asangal Did it worked?

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

3 participants