Skip to content

Commit

Permalink
Merge pull request #171 from thias/master
Browse files Browse the repository at this point in the history
Fix README example 3 + cosmetic updates
  • Loading branch information
kenyon authored May 18, 2021
2 parents d9da773 + e31d53c commit 754cfcc
Showing 1 changed file with 42 additions and 38 deletions.
80 changes: 42 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,29 +128,33 @@ Example 1:
```puppet
telegraf::input { 'my_exec':
plugin_type => 'exec',
options => [{
'commands' => ['/usr/local/bin/my_input.py',],
'name_suffix' => '_my_input',
'data_format' => 'json',
}],
options => [
{
'commands' => ['/usr/local/bin/my_input.py',],
'name_suffix' => '_my_input',
'data_format' => 'json',
}
],
require => File['/usr/local/bin/my_input.py'],
}
```

Will create the file `/etc/telegraf/telegraf.d/my_exec.conf`:

[[inputs.exec]]
commands = ['/usr/local/bin/my_input.py']
name_suffix = '_my_input'
data_format = 'json'
commands = ["/usr/local/bin/my_input.py"]
data_format = "json"
name_suffix = "_my_input"

Example 2:

```puppet
telegraf::input { 'influxdb-dc':
plugin_type => 'influxdb',
options => [
{'urls' => ['http://remote-dc:8086',],},
{
'urls' => ['http://remote-dc:8086',],
}
],
}
```
Expand All @@ -159,44 +163,44 @@ Will create the file `/etc/telegraf/telegraf.d/influxdb-dc.conf`:

```
[[inputs.influxdb]]
urls = ["http://remote-dc:8086"]
urls = ["http://remote-dc:8086"]
```

Example 3:

```puppet
telegraf::input { 'my_snmp':
plugin_type => 'snmp',
options => {
'interval' => '60s',
'host' => [
{
'address' => 'snmp_host1:161',
'community' => 'read_only',
'version' => 2,
'get_oids' => ['1.3.6.1.2.1.1.5',],
}
],
'tags' => {
'environment' => 'development',
},
},
options => [
{
'interval' => '60s',
'host' => [
{
'address' => 'snmp_host1:161',
'community' => 'read_only',
'version' => 2,
'get_oids' => ['1.3.6.1.2.1.1.5',],
}
],
'tags' => {
'environment' => 'development',
},
}
],
}
```

Will create the file `/etc/telegraf/telegraf.d/snmp.conf`:

[[inputs.snmp]]
interval = "60s"

[[inputs.snmp.host]]
address = "snmp_host1:161"
community = "read_only"
version = 2
get_oids = ["1.3.6.1.2.1.1.5"]

interval = "60s"
[inputs.snmp.tags]
environment = "development"
environment = "development"
[[inputs.snmp.host]]
address = "snmp_host1:161"
community = "read_only"
get_oids = ["1.3.6.1.2.1.1.5"]
version = 2

Example 4:

Expand All @@ -212,7 +216,7 @@ telegraf::output { 'my_influxdb':
'username' => 'telegraf',
'password' => 'metricsmetricsmetrics',
}
]
],
}
telegraf::processor { 'my_regex':
Expand All @@ -225,9 +229,9 @@ telegraf::processor { 'my_regex':
pattern => String(/^a*b+\d$/),
replacement => 'c${1}d',
}
]
],
}
]
],
}
telegraf::aggregator { 'my_basicstats':
Expand All @@ -236,7 +240,7 @@ telegraf::aggregator { 'my_basicstats':
{
period => '30s',
drop_original => false,
},
}
],
}
Expand All @@ -248,7 +252,7 @@ Example 5:
class { 'telegraf':
ensure => '1.0.1',
hostname => $facts['hostname'],
windows_package_url => http://internal_repo:8080/chocolatey,
windows_package_url => 'http://internal_repo:8080/chocolatey',
}
```

Expand Down

0 comments on commit 754cfcc

Please sign in to comment.