Hi Robert, The -debug option helped me out! Hi Sean, Its working after I disabled the following line from the Telegraf config file:
data_format = "influx" There was no need of any change to the json file though. Maybe this is not allowed in Telegraf as a default option? Cheers! On Saturday, June 18, 2016 at 10:14:07 AM UTC-7, Quick Query wrote: > > This json was taken from the example at this Telegraf > <https://github.com/influxdata/telegraf/tree/master/plugins/inputs/exec> > documentation. > It still doesnt work for me. > > Cheers! > > > On Saturday, June 18, 2016 at 12:32:31 AM UTC-7, Quick Query wrote: >> >> Hi Sean, >> >> I am getting the following error now on the terminal: >> >> 2016/06/18 00:28:30 ERROR in input [exec]: unable to parse '{"a":0.5, "b" >> :{"c":0.1, "d":5}}': missing tag key >> >> >> I have validated the JSON and its valid one. >> >> >> And, I have now changed the contents of the "/tmp/collectmetrics_docker.sh" >> to: >> >> #!/bin/bash >> >> echo -e "{\"a\":0.5, \"b\" :{\"c\":0.1, \"d\":5}}" >> >> >> Cheers! >> >> On Friday, June 17, 2016 at 4:29:48 PM UTC-7, Sean Beckett wrote: >>> >>> I believe the log output goes to STDOUT when the process is launched. >>> Are you able to capture that? >>> >>> On Fri, Jun 17, 2016 at 4:08 PM, <[email protected]> wrote: >>> >>>> Hi Sean, >>>> >>>> For some reason, I cannot see the log files at /var/log location :( >>>> Can we configure this in the telegraf config file? >>>> >>>> Cheers! >>>> >>>> >>>> On Friday, June 17, 2016 at 10:28:29 AM UTC-7, [email protected] wrote: >>>>> >>>>> Hi Sean, >>>>> >>>>> Sure, I will follow the instructions with the -debug >>>>> <https://github.com/influxdata/telegraf/blob/master/README.md#how-to-use-it> >>>>> option >>>>> as suggested by Robert and get back on this thread. >>>>> >>>>> FYI, the following is the section of the config file where the exec >>>>> plugin has been enabled: >>>>> >>>>> =============================================================================== >>>>> >>>>> # Read flattened metrics from one or more commands that output JSON to >>>>> stdout >>>>> >>>>> [[inputs.exec]] >>>>> >>>>> # Shell/commands array >>>>> >>>>> # Full command line to executable with parameters, or a glob pattern >>>>> to run all matching files. >>>>> >>>>> commands = ["/collectmetrics_docker.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 = "json" >>>>> >>>>> >>>>> # measurement name suffix (for separating different commands) >>>>> >>>>> name_suffix = "_mycollector" >>>>> >>>>> >>>>> =============================================================================== >>>>> >>>>> >>>>> Cheers! >>>>> >>>>> >>>>> >>>>> On Thursday, June 16, 2016 at 7:52:14 PM UTC-7, Sean Beckett wrote: >>>>>> >>>>>> As Robert suggested, use the debugging tools in Telegraf to see what >>>>>> it is outputting to InfluxDB. (See -debug >>>>>> <https://github.com/influxdata/telegraf/blob/master/README.md#how-to-use-it> >>>>>> ) >>>>>> >>>>>> Do the Telegraf logs indicate any issues with the writes? What about >>>>>> the InfluxDB logs? >>>>>> >>>>>> On Thu, Jun 16, 2016 at 8:45 PM, <[email protected]> wrote: >>>>>> >>>>>>> Hi Sean, >>>>>>> >>>>>>> Sorry for my late reply!! >>>>>>> >>>>>>> Yes, my bad, I had commented these lines related to exec plugin out >>>>>>> earlier! >>>>>>> >>>>>>> However, after ensuring that its enabled, I do not get any output >>>>>>> for the following command: >>>>>>> show tag keys from exec_mycollector >>>>>>> >>>>>>> Any suggestions? >>>>>>> >>>>>>> Cheers! >>>>>>> >>>>>>> >>>>>>> On Thursday, June 16, 2016 at 2:01:58 PM UTC-7, Sean Beckett wrote: >>>>>>>> >>>>>>>> Since the measurement doesn't exist, it seems there's a problem >>>>>>>> with Telegraf executing the script. Perhaps there's an environment >>>>>>>> issue? >>>>>>>> Are you using relative paths in the scripts, for instance? >>>>>>>> >>>>>>>> On Thu, Jun 16, 2016 at 11:03 AM, Quick Query <[email protected]> >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Also, please let me know if there is an alternative way to achieve >>>>>>>>> this - being able to send metrics via custom scripts? >>>>>>>>> >>>>>>>>> Cheers! >>>>>>>>> >>>>>>>>> On Thursday, June 16, 2016 at 8:00:59 AM UTC-7, Quick Query wrote: >>>>>>>>>> >>>>>>>>>> Just to add on, as per the InfluxDB documentation >>>>>>>>>> <https://github.com/influxdata/telegraf/tree/master/plugins/inputs/exec>, >>>>>>>>>> >>>>>>>>>> - "The collected metrics will be stored as fields under the >>>>>>>>>> measurement "exec_mycollector":" >>>>>>>>>> But, I am not able to view this when I do a "show measurements"! >>>>>>>>>> >>>>>>>>>> Cheers! >>>>>>>>>> >>>>>>>>>> On Thursday, June 16, 2016 at 6:24:53 AM UTC-7, Quick Query wrote: >>>>>>>>>>> >>>>>>>>>>> Hi Everyone. >>>>>>>>>>> >>>>>>>>>>> I am trying to use the exec plugin on Telegraf and the script >>>>>>>>>>> inside just does an "echo date". >>>>>>>>>>> >>>>>>>>>>> The Telegraf config is as follows: >>>>>>>>>>> >>>>>>>>>>> # Read flattened metrics from one or more commands that output >>>>>>>>>>> JSON to stdout >>>>>>>>>>> >>>>>>>>>>> [[inputs.exec]] >>>>>>>>>>> >>>>>>>>>>> # Shell/commands array >>>>>>>>>>> >>>>>>>>>>> # Full command line to executable with parameters, or a glob >>>>>>>>>>> pattern to run all matching files. >>>>>>>>>>> >>>>>>>>>>> commands = ["/tmp/test.sh", "/tmp/test2.sh", >>>>>>>>>>> "/tmp/collect_metrics*.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 = "json" >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> # measurement name suffix (for separating different commands) >>>>>>>>>>> >>>>>>>>>>> name_suffix = "_mycollector" >>>>>>>>>>> >>>>>>>>>>> The script works locally (from /tmp/collect_metrics.sh), but its >>>>>>>>>>> not working for me. >>>>>>>>>>> Any help is appreciated. >>>>>>>>>>> >>>>>>>>>>> Cheers! >>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>> Remember to include the InfluxDB version number with all issue >>>>>>>>> reports >>>>>>>>> --- >>>>>>>>> You received this message because you are subscribed to the Google >>>>>>>>> Groups "InfluxDB" group. >>>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>>> send an email to [email protected]. >>>>>>>>> To post to this group, send email to [email protected]. >>>>>>>>> Visit this group at https://groups.google.com/group/influxdb. >>>>>>>>> To view this discussion on the web visit >>>>>>>>> https://groups.google.com/d/msgid/influxdb/ce1e62de-3a9c-48a5-a74b-5d49789909a6%40googlegroups.com >>>>>>>>> >>>>>>>>> <https://groups.google.com/d/msgid/influxdb/ce1e62de-3a9c-48a5-a74b-5d49789909a6%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>>> . >>>>>>>>> >>>>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Sean Beckett >>>>>>>> Director of Support and Professional Services >>>>>>>> InfluxDB >>>>>>>> >>>>>>> -- >>>>>>> Remember to include the InfluxDB version number with all issue >>>>>>> reports >>>>>>> --- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "InfluxDB" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>> send an email to [email protected]. >>>>>>> To post to this group, send email to [email protected]. >>>>>>> Visit this group at https://groups.google.com/group/influxdb. >>>>>>> To view this discussion on the web visit >>>>>>> https://groups.google.com/d/msgid/influxdb/7b4da27d-ea14-48f8-8309-509781f1c346%40googlegroups.com >>>>>>> >>>>>>> <https://groups.google.com/d/msgid/influxdb/7b4da27d-ea14-48f8-8309-509781f1c346%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>> . >>>>>>> >>>>>>> For more options, visit https://groups.google.com/d/optout. >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Sean Beckett >>>>>> Director of Support and Professional Services >>>>>> InfluxDB >>>>>> >>>>> -- >>>> Remember to include the InfluxDB version number with all issue reports >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "InfluxDB" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at https://groups.google.com/group/influxdb. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/influxdb/cebc50ee-e149-4b22-9160-d8d06c1530d2%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/influxdb/cebc50ee-e149-4b22-9160-d8d06c1530d2%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> Sean Beckett >>> Director of Support and Professional Services >>> InfluxDB >>> >> -- Remember to include the InfluxDB version number with all issue reports --- You received this message because you are subscribed to the Google Groups "InfluxDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/d4dab689-5dd1-4f97-9a68-3b7d72d108db%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
