Skip to content

Commit 95e684e

Browse files
committed
Add config samples
1 parent f380b61 commit 95e684e

File tree

4 files changed

+192
-53
lines changed

4 files changed

+192
-53
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/.idea
22
/build
3-
/etc/telegraf.conf
43
/telegraf
54
/telegraf.exe
65
/telegraf.gz

etc/telegraf_agent_sample.conf

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
[global_tags]
2+
# dc = "us-east-1" # will tag all metrics with dc=us-east-1
3+
# rack = "1a"
4+
## Environment variables can be used as tags, and throughout the config file
5+
# user = "$USER"
6+
7+
[agent]
8+
interval = "1m"
9+
round_interval = true
10+
metric_batch_size = 1000
11+
metric_buffer_limit = 100000
12+
collection_jitter = "0s"
13+
flush_interval = "10s"
14+
flush_jitter = "10s"
15+
precision = ""
16+
hostname = "<hostname>"
17+
omit_hostname = false
18+
19+
[[outputs.influxdb]]
20+
urls = [ "http://<influxdb_host>:<influxdb_port>" ]
21+
database = "<database>"
22+
retention_policy = "<retention_policy>"
23+
write_consistency = "any"
24+
username = "<username>"
25+
password = "<password>"
26+
27+
[[inputs.cpu]]
28+
percpu = false
29+
totalcpu = true
30+
collect_cpu_time = false
31+
report_active = false
32+
core_tags = false
33+
34+
[[inputs.disk]]
35+
ignore_fs = [
36+
"tmpfs",
37+
"devtmpfs",
38+
"devfs",
39+
"iso9660",
40+
"overlay",
41+
"aufs",
42+
"squashfs"
43+
]
44+
45+
[[inputs.diskio]]
46+
[inputs.diskio.tagdrop]
47+
name = [
48+
"loop*", # (Linux) Snap package virtual devices
49+
"ram*", # (Linux) RAM disk
50+
"sr*", # (Linux) CD-ROM / DVD
51+
"fd*", # (Linux) Floppy disk
52+
"dm-*", # (Linux) LVM (exclude if necessary)
53+
"HarddiskVolume*" # (Windows) Volumes without drive letters
54+
]
55+
56+
[[inputs.kernel]]
57+
[[inputs.mem]]
58+
[[inputs.processes]]
59+
[[inputs.swap]]
60+
[[inputs.net]]
61+
[[inputs.netstat]]
62+
63+
[[inputs.procstat]]
64+
systemd_unit = "snet-salt-minion"
65+
[[inputs.procstat]]
66+
systemd_unit = "telegraf"
67+
68+
[[inputs.system]]
69+
# [[inputs.docker]]
70+
# endpoint = "unix:///var/run/docker.sock"
71+
# #container_names = [ "ch-ai-ap-1" ]
72+
# timeout = "10s"
73+
# perdevice = true
74+
# total = false
Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,22 @@
115115
###############################################################################
116116
# INPUT PLUGINS #
117117
###############################################################################
118+
[[inputs.cpu]]
119+
percpu = false
120+
totalcpu = true
121+
collect_cpu_time = false
122+
report_active = false
123+
core_tags = false
124+
125+
[[inputs.disk]]
126+
[[inputs.mem]]
127+
[[inputs.swap]]
118128

119129
[[inputs.win_perf_counters]]
120130
[[inputs.win_perf_counters.object]]
121131
# Processor usage, alternative to native, reports on a per core.
122132
ObjectName = "Processor"
123-
Instances = ["*"]
133+
Instances = ["_Total"]
124134
Counters = [
125135
"% Idle Time",
126136
"% Interrupt Time",
@@ -225,54 +235,3 @@
225235
]
226236
Instances = ["_Total"]
227237
Measurement = "win_swap"
228-
229-
[[inputs.oracledb]]
230-
## Connection string, e.g. easy connect string like
231-
connection_string = "192.168.56.105:1521/xe"
232-
# or oracle net connect descriptor string like
233-
# (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbhost.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orclpdb1)))
234-
# connection_string = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.105)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XE)))"
235-
## Database credentials
236-
username = "system"
237-
password = "oracle"
238-
## Role, either SYSDBA, SYSASM, SYSOPER or empty
239-
role = ""
240-
## Path to the Oracle Client library directory, optional.
241-
# Should be used if there is no LD_LIBRARY_PATH variable
242-
# or not possible to confugire it properly.
243-
client_lib_dir = "C:/Oracle/instantclient_19_11"
244-
## Define the toml config where the sql queries are stored
245-
# Structure :
246-
# [[inputs.oracledb.query]]
247-
# sqlquery string
248-
# script string
249-
# schema string
250-
# tag_columns array of strings
251-
[[inputs.oracledb.query]]
252-
# Query name, optional. Used in logging.
253-
name = ""
254-
# OracleDB sql query
255-
sqlquery = "select n.wait_class as wait_class, round(m.time_waited/m.INTSIZE_CSEC,3) wait_value from v$waitclassmetric m, v$system_wait_class n where m.wait_class_id=n.wait_class_id and n.wait_class != 'Idle' union select 'CPU', round(value/100,3) wait_value from v$sysmetric where metric_name='CPU Usage Per Sec' and group_id=2 union select 'CPU_OS', round((prcnt.busy*parameter.cpu_count)/100,3) - aas.cpu from ( select value busy from v$sysmetric where metric_name='Host CPU Utilization (%)' and group_id=2 ) prcnt, ( select value cpu_count from v$parameter where name='cpu_count' ) parameter, ( select 'CPU', round(value/100,3) cpu from v$sysmetric where metric_name='CPU Usage Per Sec' and group_id=2) aas"
256-
# The script option can be used to specify the .sql file path.
257-
# If script and sqlquery options specified at same time, sqlquery will be used.
258-
script = ""
259-
# Schema name. If provided, then ALTER SESSION SET CURRENT_SCHEMA query will be executed
260-
schema = ""
261-
# Query execution timeout, in seconds.
262-
timeout = 10
263-
# Array of column names, which would be stored as tags
264-
tag_columns = ["WAIT_CLASS"]
265-
[[inputs.oracledb.query]]
266-
# Query name, optional. Used in logging.
267-
name = ""
268-
# OracleDB sql query
269-
sqlquery = "select n.wait_class wait_class, n.name wait_name, m.wait_count cnt, round(10*m.time_waited/nullif(m.wait_count,0),3) avgms from v$eventmetric m, v$event_name n where m.event_id=n.event_id and n.wait_class <> 'Idle' and m.wait_count > 0 order by 1"
270-
# The script option can be used to specify the .sql file path.
271-
# If script and sqlquery options specified at same time, sqlquery will be used.
272-
script = ""
273-
# Schema name. If provided, then ALTER SESSION SET CURRENT_SCHEMA query will be executed
274-
schema = ""
275-
# Query execution timeout, in seconds.
276-
timeout = 10
277-
# Array of column names, which would be stored as tags
278-
tag_columns = ["WAIT_CLASS"]

etc/telegraf_collector_sample.conf

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
[global_tags]
2+
svc_type = "ch-mgmt"
3+
# dc = "us-east-1" # will tag all metrics with dc=us-east-1
4+
# rack = "1a"
5+
## Environment variables can be used as tags, and throughout the config file
6+
# user = "$USER"
7+
8+
[agent]
9+
interval = "1m"
10+
round_interval = true
11+
metric_batch_size = 1000
12+
metric_buffer_limit = 100000
13+
collection_jitter = "0s"
14+
flush_interval = "10s"
15+
flush_jitter = "10s"
16+
precision = ""
17+
hostname = "ch-collector-<*>"
18+
omit_hostname = false
19+
20+
[[outputs.influxdb]]
21+
urls = [ "http://<influxdb_host>:<influxdb_port>" ]
22+
database = "<database>"
23+
retention_policy = "<retention_policy>"
24+
write_consistency = "any"
25+
username = "<username>"
26+
password = "<password>"
27+
28+
[[inputs.cpu]]
29+
percpu = false
30+
totalcpu = true
31+
collect_cpu_time = false
32+
report_active = false
33+
core_tags = false
34+
35+
[[inputs.disk]]
36+
ignore_fs = [
37+
"proc",
38+
"sysfs",
39+
"tmpfs",
40+
"devtmpfs",
41+
"devfs",
42+
"iso9660",
43+
"overlay",
44+
"aufs",
45+
"squashfs"
46+
]
47+
48+
[[inputs.diskio]]
49+
[inputs.diskio.tagdrop]
50+
name = [
51+
"loop*", # (Linux) Snap package virtual devices
52+
"ram*", # (Linux) RAM disk
53+
"sr*", # (Linux) CD-ROM / DVD
54+
"fd*", # (Linux) Floppy disk
55+
"dm-*", # (Linux) LVM (exclude if necessary)
56+
"HarddiskVolume*" # (Windows) Volumes without drive letters
57+
]
58+
59+
[[inputs.kernel]]
60+
[[inputs.mem]]
61+
[[inputs.processes]]
62+
[[inputs.swap]]
63+
[[inputs.net]]
64+
[[inputs.netstat]]
65+
66+
[[inputs.procstat]]
67+
systemd_unit = "snet-salt-master"
68+
[[inputs.procstat]]
69+
systemd_unit = "snet-salt-api"
70+
[[inputs.procstat]]
71+
systemd_unit = "snet-salt-minion"
72+
[[inputs.procstat]]
73+
systemd_unit = "telegraf"
74+
75+
[[inputs.system]]
76+
77+
[[inputs.influxdb]]
78+
urls = [
79+
"http://<influxdb_host>:<influxdb_port>/debug/vars"
80+
]
81+
82+
timeout = "5s"
83+
84+
[[inputs.kapacitor]]
85+
urls = [
86+
"http://<kapacitor_host>:<kapacitor_port>/kapacitor/v1/debug/vars"
87+
]
88+
89+
timeout = "5s"
90+
91+
[[inputs.nginx]]
92+
urls = [ "http://<nginx_host>/nginx_status" ]
93+
response_timeout = "5s"
94+
95+
[[inputs.docker]]
96+
endpoint = "unix:///var/run/docker.sock"
97+
#container_names = [ "ch-ai-ap-1" ]
98+
timeout = "10s"
99+
perdevice = true
100+
total = false
101+
102+
[[inputs.syslog]]
103+
server = "tcp://0.0.0.0:6514"
104+
105+
[[inputs.syslog]]
106+
server = "udp://:6514"
107+
syslog_standard = "RFC3164"

0 commit comments

Comments
 (0)