From 821b30eb923b19b181c3120d80213b387b3b8c5a Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Fri, 3 Jun 2016 13:32:16 +0100 Subject: [PATCH] Add timeout param to exec readme (#1325) --- plugins/inputs/exec/README.md | 36 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/plugins/inputs/exec/README.md b/plugins/inputs/exec/README.md index 14acf0957..0e2563900 100644 --- a/plugins/inputs/exec/README.md +++ b/plugins/inputs/exec/README.md @@ -11,39 +11,22 @@ all scripts matching glob pattern ```/tmp/collect_*.sh``` are configured for ``` in JSON format. Glob patterns are matched on every run, so adding new scripts that match the pattern will cause them to be picked up immediately. -``` +```toml # 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_*.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" - - ## Below configuration will be used for data_format = "graphite", can be ignored for other data_format - ## If matching multiple measurement files, this string will be used to join the matched values. - #separator = "." - - ## Each template line requires a template pattern. It can have an optional - ## filter before the template and separated by spaces. It can also have optional extra - ## tags following the template. Multiple tags should be separated by commas and no spaces - ## similar to the line protocol format. The can be only one default template. - ## Templates support below format: - ## 1. filter + template - ## 2. filter + template + extra tag - ## 3. filter + template with field key - ## 4. default template - #templates = [ - # "*.app env.service.resource.measurement", - # "stats.* .host.measurement* region=us-west,agent=sensu", - # "stats2.* .host.measurement.field", - # "measurement*" - #] ``` Other options for modifying the measurement names are: @@ -82,7 +65,7 @@ in influx line-protocol format. #### Configuration -``` +```toml [[inputs.exec]] # Shell/commands array # compatible with old version @@ -90,6 +73,9 @@ in influx line-protocol format. # command = "/usr/bin/line_protocol_collector" commands = ["/usr/bin/line_protocol_collector","/tmp/test2.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" @@ -123,12 +109,16 @@ We can also change the data_format to "graphite" to use the metrics collecting s In this example a script called /tmp/test.sh and a script called /tmp/test2.sh are configured for [[inputs.exec]] in graphite format. #### Configuration -``` + +```toml # Read flattened metrics from one or more commands that output JSON to stdout [[inputs.exec]] # Shell/commands array commands = ["/tmp/test.sh","/tmp/test2.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 = "graphite"