-
Notifications
You must be signed in to change notification settings - Fork 6
/
add-splunk-plugins.patch
245 lines (237 loc) · 9.55 KB
/
add-splunk-plugins.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
diff --git a/Makefile.am b/Makefile.am
index f00871b3..b278749c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -931,6 +931,16 @@ dns_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPCAP_LDFLAGS)
dns_la_LIBADD = $(BUILD_WITH_LIBPCAP_LIBS)
endif
+if BUILD_PLUGIN_DOCKER
+pkglib_LTLIBRARIES += docker.la
+docker_la_SOURCES = \
+ src/docker.c
+docker_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
+docker_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
+docker_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
+docker_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBYAJL_LIBS)
+endif
+
if BUILD_PLUGIN_DPDKEVENTS
pkglib_LTLIBRARIES += dpdkevents.la
dpdkevents_la_SOURCES = src/dpdkevents.c src/utils/dpdk/dpdk.c src/utils/dpdk/dpdk.h
@@ -1631,6 +1641,14 @@ processes_la_LIBADD += libtaskstats.la
endif
endif
+if BUILD_PLUGIN_PROCESSMON
+pkglib_LTLIBRARIES += processmon.la
+processmon_la_SOURCES = src/processmon.c
+processmon_la_CPPFLAGS = $(AM_CPPFLAGS)
+processmon_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+processmon_la_LIBADD =
+endif
+
if BUILD_PLUGIN_PROTOCOLS
pkglib_LTLIBRARIES += protocols.la
protocols_la_SOURCES = src/protocols.c
@@ -2085,6 +2103,22 @@ write_syslog_la_SOURCES = src/write_syslog.c
write_syslog_la_LDFLAGS = $(PLUGIN_LDFLAGS)
endif
+if BUILD_PLUGIN_WRITE_SPLUNK
+pkglib_LTLIBRARIES += write_splunk.la
+write_splunk_la_SOURCES = src/write_splunk.c
+write_splunk_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
+write_splunk_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+write_splunk_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS)
+
+test_plugin_write_splunk_SOURCES = src/write_splunk_test.c \
+ src/daemon/configfile.c \
+ src/daemon/types_list.c
+test_plugin_write_splunk_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
+test_plugin_write_splunk_LDFLAGS = $(PLUGIN_LDFLAGS)
+test_plugin_write_splunk_LDADD = liboconfig.la libplugin_mock.la $(BUILD_WITH_LIBCURL_LIBS)
+check_PROGRAMS += test_plugin_write_splunk
+endif
+
if BUILD_PLUGIN_WRITE_TSDB
pkglib_LTLIBRARIES += write_tsdb.la
write_tsdb_la_SOURCES = src/write_tsdb.c
diff --git a/configure.ac b/configure.ac
index 82016b3c..a817509f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6380,6 +6380,7 @@ plugin_curl_json="no"
plugin_curl_xml="no"
plugin_df="no"
plugin_disk="no"
+plugin_docker="no"
plugin_drbd="no"
plugin_dpdkevents="no"
plugin_dpdkstat="no"
@@ -6411,6 +6412,7 @@ plugin_pcie_errors="no"
plugin_perl="no"
plugin_pinba="no"
plugin_processes="no"
+plugin_processmon="no"
plugin_protocols="no"
plugin_python="no"
plugin_serial="no"
@@ -6459,6 +6461,7 @@ if test "x$ac_system" = "xLinux"; then
plugin_nfs="yes"
plugin_numa="yes"
plugin_processes="yes"
+ plugin_processmon="yes"
plugin_protocols="yes"
plugin_serial="yes"
plugin_swap="yes"
@@ -6593,6 +6596,10 @@ if test "x$with_libcurl" = "xyes" && test "x$with_libssl" = "xyes" && test "x$wi
plugin_write_stackdriver="yes"
fi
+if test "x$with_libcurl" = "xyes" && test "x$with_libyajl" = "xyes"; then
+ plugin_docker="yes"
+fi
+
if test "x$with_libcurl" = "xyes" && test "x$with_libxml2" = "xyes"; then
plugin_curl_xml="yes"
fi
@@ -6808,6 +6815,7 @@ AC_PLUGIN([dbi], [$with_libdbi], [General database
AC_PLUGIN([df], [$plugin_df], [Filesystem usage statistics])
AC_PLUGIN([disk], [$plugin_disk], [Disk usage statistics])
AC_PLUGIN([dns], [$with_libpcap], [DNS traffic analysis])
+AC_PLUGIN([docker], [$plugin_docker], [Docker container statistics])
AC_PLUGIN([dpdkevents], [$plugin_dpdkevents], [Events from DPDK])
AC_PLUGIN([dpdkstat], [$plugin_dpdkstat], [Stats from DPDK])
AC_PLUGIN([drbd], [$plugin_drbd], [DRBD statistics])
@@ -6883,6 +6891,7 @@ AC_PLUGIN([ping], [$with_liboping], [Network latency s
AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics])
AC_PLUGIN([powerdns], [yes], [PowerDNS statistics])
AC_PLUGIN([processes], [$plugin_processes], [Process statistics])
+AC_PLUGIN([processmon], [$plugin_processmon], [Process monitoring])
AC_PLUGIN([protocols], [$plugin_protocols], [Protocol (IP, TCP, ...) statistics])
AC_PLUGIN([python], [$plugin_python], [Embed a Python interpreter])
AC_PLUGIN([redis], [$with_libhiredis], [Redis plugin])
@@ -6933,6 +6942,7 @@ AC_PLUGIN([write_prometheus], [$plugin_write_prometheus], [Prometheus write
AC_PLUGIN([write_redis], [$with_libhiredis], [Redis output plugin])
AC_PLUGIN([write_riemann], [$with_libriemann_client], [Riemann output plugin])
AC_PLUGIN([write_sensu], [yes], [Sensu output plugin])
+AC_PLUGIN([write_splunk], [$with_libcurl], [Splunk output plugin])
AC_PLUGIN([write_stackdriver], [$plugin_write_stackdriver], [Google Stackdriver Monitoring output plugin])
AC_PLUGIN([write_syslog], [yes], [Syslog output plugin])
AC_PLUGIN([write_tsdb], [yes], [TSDB output plugin])
@@ -7237,6 +7247,7 @@ AC_MSG_RESULT([ dbi . . . . . . . . . $enable_dbi])
AC_MSG_RESULT([ df . . . . . . . . . $enable_df])
AC_MSG_RESULT([ disk . . . . . . . . $enable_disk])
AC_MSG_RESULT([ dns . . . . . . . . . $enable_dns])
+AC_MSG_RESULT([ docker . . . . . . . $enable_docker])
AC_MSG_RESULT([ dpdkevents. . . . . . $enable_dpdkevents])
AC_MSG_RESULT([ dpdkstat . . . . . . $enable_dpdkstat])
AC_MSG_RESULT([ drbd . . . . . . . . $enable_drbd])
@@ -7311,6 +7322,7 @@ AC_MSG_RESULT([ ping . . . . . . . . $enable_ping])
AC_MSG_RESULT([ postgresql . . . . . $enable_postgresql])
AC_MSG_RESULT([ powerdns . . . . . . $enable_powerdns])
AC_MSG_RESULT([ processes . . . . . . $enable_processes])
+AC_MSG_RESULT([ processmon . . . . . $enable_processmon])
AC_MSG_RESULT([ protocols . . . . . . $enable_protocols])
AC_MSG_RESULT([ python . . . . . . . $enable_python])
AC_MSG_RESULT([ redis . . . . . . . . $enable_redis])
@@ -7363,6 +7375,7 @@ AC_MSG_RESULT([ write_riemann . . . . $enable_write_riemann])
AC_MSG_RESULT([ write_sensu . . . . . $enable_write_sensu])
AC_MSG_RESULT([ write_stackdriver . . $enable_write_stackdriver])
AC_MSG_RESULT([ write_syslog . . . . $enable_write_syslog])
+AC_MSG_RESULT([ write_splunk . . . . $enable_write_splunk])
AC_MSG_RESULT([ write_tsdb . . . . . $enable_write_tsdb])
AC_MSG_RESULT([ xencpu . . . . . . . $enable_xencpu])
AC_MSG_RESULT([ xmms . . . . . . . . $enable_xmms])
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index f09f373d..222721f1 100644
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
@@ -115,6 +115,7 @@
#@BUILD_PLUGIN_DF_TRUE@LoadPlugin df
#@BUILD_PLUGIN_DISK_TRUE@LoadPlugin disk
#@BUILD_PLUGIN_DNS_TRUE@LoadPlugin dns
+#@BUILD_PLUGIN_DOCKER_TRUE@LoadPlugin docker
#@BUILD_PLUGIN_DPDKEVENTS_TRUE@LoadPlugin dpdkevents
#@BUILD_PLUGIN_DPDKSTAT_TRUE@LoadPlugin dpdkstat
#@BUILD_PLUGIN_DRBD_TRUE@LoadPlugin drbd
@@ -180,6 +181,7 @@
#@BUILD_PLUGIN_POSTGRESQL_TRUE@LoadPlugin postgresql
#@BUILD_PLUGIN_POWERDNS_TRUE@LoadPlugin powerdns
#@BUILD_PLUGIN_PROCESSES_TRUE@LoadPlugin processes
+#@BUILD_PLUGIN_PROCESSMON_TRUE@LoadPlugin processmon
#@BUILD_PLUGIN_PROTOCOLS_TRUE@LoadPlugin protocols
#@BUILD_PLUGIN_PYTHON_TRUE@LoadPlugin python
#@BUILD_PLUGIN_REDIS_TRUE@LoadPlugin redis
@@ -224,6 +226,7 @@
#@BUILD_PLUGIN_WRITE_SENSU_TRUE@LoadPlugin write_sensu
#@BUILD_PLUGIN_WRITE_STACKDRIVER_TRUE@LoadPlugin write_stackdriver
#@BUILD_PLUGIN_WRITE_SYSLOG_TRUE@LoadPlugin write_syslog
+#@BUILD_PLUGIN_WRITE_SPLUNK_TRUE@LoadPlugin write_splunk
#@BUILD_PLUGIN_WRITE_TSDB_TRUE@LoadPlugin write_tsdb
#@BUILD_PLUGIN_XENCPU_TRUE@LoadPlugin xencpu
#@BUILD_PLUGIN_XMMS_TRUE@LoadPlugin xmms
@@ -567,6 +570,12 @@
# SelectNumericQueryTypes true
#</Plugin>
+#<Plugin docker>
+# DockerSock "/var/run/docker.sock"
+# ApiVersion "v1.30"
+# ReadBufferSize 16384
+#</Plugin>
+
#<Plugin "dpdkevents">
# <EAL>
# Coremask "0x1"
@@ -1270,6 +1279,12 @@
# </Process>
#</Plugin>
+#<Plugin processmon>
+# ReadIO true
+# WhiteList "regex_whitelist"
+# BlackList "regex_blacklist"
+#</Plugin>
+
#<Plugin protocols>
# Value "/^Tcp:/"
# IgnoreSelected false
@@ -1828,6 +1843,28 @@
# </Node>
#</Plugin>
+#<Plugin write_splunk>
+# Dimension "key:value"
+# Port "8088"
+# Token "xyz" # hec token
+# Server "localhost"
+# CAInfo "/etc/certs/cabundle.pem" # specify CURL_CAINFO
+# CAPath "/etc/cert-dir" # specify CURL_CAPATH
+# Batchsize 1024
+# Buffersize 1048576
+# PostTimeout 30
+# Udpport 3333
+# Ssl true
+# Verifyssl false
+# SplunkMetricTransform true
+# DiskAsDimensions true
+# InterfaceAsDimensions true
+# CpuAsDimensions true
+# DfAsDimensions true
+# StoreRates true
+# UseUdp false
+#</Plugin>
+
#<Plugin write_tsdb>
# <Node>
# Host "localhost"
diff --git a/src/daemon/plugin_mock.c b/src/daemon/plugin_mock.c
index 1624f0ea..0199d2ae 100644
--- a/src/daemon/plugin_mock.c
+++ b/src/daemon/plugin_mock.c
@@ -79,6 +79,11 @@ int plugin_register_complex_read(const char *group, const char *name,
return ENOTSUP;
}
+int plugin_register_flush(const char *name, plugin_flush_cb callback,
+ user_data_t const *user_data) {
+ return ENOTSUP;
+}
+
int plugin_register_shutdown(const char *name, int (*callback)(void)) {
return ENOTSUP;
}