Accepting request 781648 from home:ojkastl_buildservice:Branch_telegraf

update to 1.13.4; create directory /etc/telegraf/telegraf.d/

OBS-URL: https://build.opensuse.org/request/show/781648
OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/telegraf?expand=0&rev=22
This commit is contained in:
Jeff Kowalczyk 2020-04-03 06:14:06 +00:00 committed by Git OBS Bridge
parent 66ddc3ed59
commit 9a9161a9b6
10 changed files with 383 additions and 146 deletions

View File

@ -0,0 +1,24 @@
From 509aa47a92a996bb374a5dea04d310ddfd59a042 Mon Sep 17 00:00:00 2001
From: Johannes Kastl <kastl@b1-systems.de>
Date: Wed, 26 Feb 2020 16:37:21 +0100
Subject: [PATCH] plugins/outputs/all/all.go: Generic SQL output plugin for
Telegraf (patch taken from openSUSE RPM package of telegraf 1.12.6)
Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
---
plugins/outputs/all/all.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/outputs/all/all.go b/plugins/outputs/all/all.go
index e40230993b51acf3b0ff9cfd06a8d36d7f4938d4..7f5139cdd3f99c1a0892f113d663b59faba562dc 100644
--- a/plugins/outputs/all/all.go
+++ b/plugins/outputs/all/all.go
@@ -34,4 +34,5 @@ import (
_ "github.com/influxdata/telegraf/plugins/outputs/stackdriver"
_ "github.com/influxdata/telegraf/plugins/outputs/syslog"
_ "github.com/influxdata/telegraf/plugins/outputs/wavefront"
+ _ "github.com/influxdata/telegraf/plugins/outputs/sql"
)
--
2.25.1

View File

@ -0,0 +1,94 @@
From 0b3ff433caa76cd644819cab50301f9a2a5b01a1 Mon Sep 17 00:00:00 2001
From: Johannes Kastl <kastl@b1-systems.de>
Date: Wed, 26 Feb 2020 16:38:01 +0100
Subject: [PATCH] plugins/outputs/sql/README.md: Generic SQL output plugin for
Telegraf (patch taken from openSUSE RPM package of telegraf 1.12.6)
Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
---
plugins/outputs/sql/README.md | 73 +++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
create mode 100644 plugins/outputs/sql/README.md
diff --git a/plugins/outputs/sql/README.md b/plugins/outputs/sql/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..2d29af83fdcc5afc69d2d38002e02ae852223f8f
--- /dev/null
+++ b/plugins/outputs/sql/README.md
@@ -0,0 +1,73 @@
+# SQL plugin
+
+The plugin inserts values to SQL various database.
+Supported/integrated drivers are mssql (SQLServer), mysql (MySQL), postgres (Postgres)
+Activable drivers (read below) are all golang SQL compliant drivers (see https://github.com/golang/go/wiki/SQLDrivers): for instance oci8 for Oracle or sqlite3 (SQLite)
+
+## Getting started :
+First you need to grant insert (if auto create table create) privileges to the database user you use for the connection
+
+## Configuration:
+
+```
+# Send metrics to SQL-Database (Example configuration for MySQL/MariaDB)
+[[outputs.sql]]
+ ## Database Driver, required.
+ ## Valid options: mssql (SQLServer), mysql (MySQL), postgres (Postgres), sqlite3 (SQLite), [oci8 ora.v4 (Oracle)]
+ driver = "mysql"
+
+ ## specify address via a url matching:
+ ## postgres://[pqgotest[:password]]@localhost[/dbname]\
+ ## ?sslmode=[disable|verify-ca|verify-full]
+ ## or a simple string:
+ ## host=localhost user=pqotest password=... sslmode=... dbname=app_production
+ ##
+ ## All connection parameters are optional.
+ ##
+ ## Without the dbname parameter, the driver will default to a database
+ ## with the same name as the user. This dbname is just for instantiating a
+ ## connection with the server and doesn't restrict the databases we are trying
+ ## to grab metrics for.
+ ##
+ address = "username:password@tcp(server:port)/table"
+
+ ## Available Variables:
+ ## {TABLE} - tablename as identifier
+ ## {TABLELITERAL} - tablename as string literal
+ ## {COLUMNS} - column definitions
+ ## {KEY_COLUMNS} - comma-separated list of key columns (time + tags)
+ ##
+
+ ## Check with this is table exists
+ ##
+ ## Template for MySQL is "SELECT 1 FROM {TABLE} LIMIT 1"
+ ##
+ table_exists_template = "SELECT 1 FROM {TABLE} LIMIT 1"
+
+ ## Template to use for generating tables
+
+ ## Default template
+ ##
+ # table_template = "CREATE TABLE {TABLE}({COLUMNS})"
+
+ ## Convert Telegraf datatypes to these types
+ [[outputs.sql.convert]]
+ integer = "INT"
+ real = "DOUBLE"
+ text = "TEXT"
+ timestamp = "TIMESTAMP"
+ defaultvalue = "TEXT"
+ unsigned = "UNSIGNED"
+```
+sql_script is read only once, if you change the script you need to reload telegraf
+
+## Field names
+If database table is not pre-created tries driver to create database. There can be errors as
+SQL has strict scheming.
+
+## Tested Databases
+Actually I run the plugin using MySQL
+
+## TODO
+1) Test with other databases
+2) More sane testing
--
2.25.1

View File

@ -1,95 +1,20 @@
Index: telegraf-1.12.0/plugins/outputs/all/all.go From bca63ce35687103b0f52898936d07a1c294673ad Mon Sep 17 00:00:00 2001
=================================================================== From: Johannes Kastl <kastl@b1-systems.de>
--- telegraf-1.12.0.orig/plugins/outputs/all/all.go Date: Wed, 26 Feb 2020 16:38:59 +0100
+++ telegraf-1.12.0/plugins/outputs/all/all.go Subject: [PATCH] plugins/outputs/sql/sql.go: Generic SQL output plugin for
@@ -34,4 +34,5 @@ import ( Telegraf (patch taken from openSUSE RPM package of telegraf 1.12.6)
_ "github.com/influxdata/telegraf/plugins/outputs/stackdriver"
_ "github.com/influxdata/telegraf/plugins/outputs/syslog" Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
_ "github.com/influxdata/telegraf/plugins/outputs/wavefront" ---
+ _ "github.com/influxdata/telegraf/plugins/outputs/sql" plugins/outputs/sql/sql.go | 256 +++++++++++++++++++++++++++++++++++++
) 1 file changed, 256 insertions(+)
Index: telegraf-1.12.0/plugins/outputs/sql/README.md create mode 100644 plugins/outputs/sql/sql.go
===================================================================
diff --git a/plugins/outputs/sql/sql.go b/plugins/outputs/sql/sql.go
new file mode 100644
index 0000000000000000000000000000000000000000..7823f680008f42f1346d2fea4215ffc664fcfa8c
--- /dev/null --- /dev/null
+++ telegraf-1.12.0/plugins/outputs/sql/README.md +++ b/plugins/outputs/sql/sql.go
@@ -0,0 +1,73 @@
+# SQL plugin
+
+The plugin inserts values to SQL various database.
+Supported/integrated drivers are mssql (SQLServer), mysql (MySQL), postgres (Postgres)
+Activable drivers (read below) are all golang SQL compliant drivers (see https://github.com/golang/go/wiki/SQLDrivers): for instance oci8 for Oracle or sqlite3 (SQLite)
+
+## Getting started :
+First you need to grant insert (if auto create table create) privileges to the database user you use for the connection
+
+## Configuration:
+
+```
+# Send metrics to SQL-Database (Example configuration for MySQL/MariaDB)
+[[outputs.sql]]
+ ## Database Driver, required.
+ ## Valid options: mssql (SQLServer), mysql (MySQL), postgres (Postgres), sqlite3 (SQLite), [oci8 ora.v4 (Oracle)]
+ driver = "mysql"
+
+ ## specify address via a url matching:
+ ## postgres://[pqgotest[:password]]@localhost[/dbname]\
+ ## ?sslmode=[disable|verify-ca|verify-full]
+ ## or a simple string:
+ ## host=localhost user=pqotest password=... sslmode=... dbname=app_production
+ ##
+ ## All connection parameters are optional.
+ ##
+ ## Without the dbname parameter, the driver will default to a database
+ ## with the same name as the user. This dbname is just for instantiating a
+ ## connection with the server and doesn't restrict the databases we are trying
+ ## to grab metrics for.
+ ##
+ address = "username:password@tcp(server:port)/table"
+
+ ## Available Variables:
+ ## {TABLE} - tablename as identifier
+ ## {TABLELITERAL} - tablename as string literal
+ ## {COLUMNS} - column definitions
+ ## {KEY_COLUMNS} - comma-separated list of key columns (time + tags)
+ ##
+
+ ## Check with this is table exists
+ ##
+ ## Template for MySQL is "SELECT 1 FROM {TABLE} LIMIT 1"
+ ##
+ table_exists_template = "SELECT 1 FROM {TABLE} LIMIT 1"
+
+ ## Template to use for generating tables
+
+ ## Default template
+ ##
+ # table_template = "CREATE TABLE {TABLE}({COLUMNS})"
+
+ ## Convert Telegraf datatypes to these types
+ [[outputs.sql.convert]]
+ integer = "INT"
+ real = "DOUBLE"
+ text = "TEXT"
+ timestamp = "TIMESTAMP"
+ defaultvalue = "TEXT"
+ unsigned = "UNSIGNED"
+```
+sql_script is read only once, if you change the script you need to reload telegraf
+
+## Field names
+If database table is not pre-created tries driver to create database. There can be errors as
+SQL has strict scheming.
+
+## Tested Databases
+Actually I run the plugin using MySQL
+
+## TODO
+1) Test with other databases
+2) More sane testing
Index: telegraf-1.12.0/plugins/outputs/sql/sql.go
===================================================================
--- /dev/null
+++ telegraf-1.12.0/plugins/outputs/sql/sql.go
@@ -0,0 +1,256 @@ @@ -0,0 +1,256 @@
+package sql +package sql
+ +
@ -347,49 +272,6 @@ Index: telegraf-1.12.0/plugins/outputs/sql/sql.go
+ TagTableSuffix: "_tag", + TagTableSuffix: "_tag",
+ } + }
+} +}
Index: telegraf-1.12.0/plugins/outputs/sql/sql_test.go --
=================================================================== 2.25.1
--- /dev/null
+++ telegraf-1.12.0/plugins/outputs/sql/sql_test.go
@@ -0,0 +1,29 @@
+package sql
+
+import (
+ "testing"
+ // "time"
+ // "github.com/influxdata/telegraf"
+ // "github.com/influxdata/telegraf/metric"
+ // "github.com/stretchr/testify/assert"
+)
+
+func TestSqlQuote(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping integration test in short mode")
+ }
+
+}
+
+func TestSqlCreateStatement(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping integration test in short mode")
+ }
+
+}
+
+func TestSqlInsertStatement(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping integration test in short mode")
+ }
+}
Index: telegraf-1.12.0/README.md
===================================================================
--- telegraf-1.12.0.orig/README.md
+++ telegraf-1.12.0/README.md
@@ -272,6 +272,7 @@ For documentation on the latest developm
* [snmp](./plugins/inputs/snmp)
* [socket_listener](./plugins/inputs/socket_listener)
* [solr](./plugins/inputs/solr)
+* [sql](./plugins/outputs/sql) (sql generic output)
* [sql server](./plugins/inputs/sqlserver) (microsoft)
* [stackdriver](./plugins/inputs/stackdriver)
* [statsd](./plugins/inputs/statsd)

View File

@ -0,0 +1,50 @@
From a79b89f1037f705d606374b63f69e82406d42a4c Mon Sep 17 00:00:00 2001
From: Johannes Kastl <kastl@b1-systems.de>
Date: Wed, 26 Feb 2020 16:40:19 +0100
Subject: [PATCH] plugins/outputs/sql/sql_test.go: Generic SQL output plugin
for Telegraf (patch taken from openSUSE RPM package of telegraf 1.12.6)
Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
---
plugins/outputs/sql/sql_test.go | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 plugins/outputs/sql/sql_test.go
diff --git a/plugins/outputs/sql/sql_test.go b/plugins/outputs/sql/sql_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..80d3b7104f9c42f46d75f2335a73f237282275e8
--- /dev/null
+++ b/plugins/outputs/sql/sql_test.go
@@ -0,0 +1,29 @@
+package sql
+
+import (
+ "testing"
+ // "time"
+ // "github.com/influxdata/telegraf"
+ // "github.com/influxdata/telegraf/metric"
+ // "github.com/stretchr/testify/assert"
+)
+
+func TestSqlQuote(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping integration test in short mode")
+ }
+
+}
+
+func TestSqlCreateStatement(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping integration test in short mode")
+ }
+
+}
+
+func TestSqlInsertStatement(t *testing.T) {
+ if testing.Short() {
+ t.Skip("Skipping integration test in short mode")
+ }
+}
--
2.25.1

View File

@ -0,0 +1,26 @@
From bc09eb99d169e1122bc7fe0eb6f85140c736a243 Mon Sep 17 00:00:00 2001
From: Johannes Kastl <kastl@b1-systems.de>
Date: Wed, 26 Feb 2020 16:57:32 +0100
Subject: [PATCH] README.md: Generic SQL output plugin for Telegraf (patch
taken from openSUSE RPM package of telegraf 1.12.6)
Signed-off-by: Johannes Kastl <kastl@b1-systems.de>
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index b34451df2a568c2f2eeede165b2a48d19b8fe7d9..54aa6988ebc987a6566a24200f8830ec48748b2a 100644
--- a/README.md
+++ b/README.md
@@ -285,6 +285,7 @@ For documentation on the latest development code see the [documentation index][d
* [snmp_trap](./plugins/inputs/snmp_trap)
* [socket_listener](./plugins/inputs/socket_listener)
* [solr](./plugins/inputs/solr)
+* [sql](./plugins/outputs/sql) (sql generic output)
* [sql server](./plugins/inputs/sqlserver) (microsoft)
* [stackdriver](./plugins/inputs/stackdriver)
* [statsd](./plugins/inputs/statsd)
--
2.25.1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b585c985f06ff9cfd7fdbf19df34e409385729e8ea29c84a76f1a0762a46014e
size 1566347

3
telegraf-1.13.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a3015fb339e050d048c6d3df97827b257700211ce33e9403a5663d27c1f9b0fb
size 1641836

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:cb83a2af73301ec953ba5df3bebc1dc54cd6b1e2e531fe14bd39cdcd553b675c oid sha256:15ac842c8e835630c50e7ff4679b25d72cc3f88b6a48921fd81ddf87042807b0
size 97581456 size 109518012

View File

@ -1,3 +1,151 @@
-------------------------------------------------------------------
Wed Mar 4 19:13:12 UTC 2020 - Johannes Kastl <kastl@b1-systems.de>
- create directory /etc/telegraf/telegraf.d/
-------------------------------------------------------------------
Sat Feb 29 12:58:49 UTC 2020 - Johannes Kastl <kastl@b1-systems.de>
- update to 1.13.4
Bugfixes
- #6988: Parse NaN values from summary types in prometheus input.
- #6820: Fix pgbouncer input when used with newer pgbouncer versions.
- #6913: Support up to 8192 stats in the ethtool input.
- #7060: Fix perf counters collection on named instances in sqlserver input.
- #6926: Use add time for prometheus expiration calculation.
- #7057: Fix inconsistency with input error counting in internal input.
- #7063: Use the same timestamp per call if no time is provided in prometheus input.
-------------------------------------------------------------------
Sat Feb 29 12:32:54 UTC 2020 - Johannes Kastl <kastl@b1-systems.de>
- update to 1.13.3
Bugfixes
- #5744: Fix kibana input with Kibana versions greater than 6.4.
- #6960: Fix duplicate TrackingIDs can be returned in queue consumer plugins.
- #6913: Support up to 4096 stats in the ethtool input.
- #6973: Expire metrics on query in addition to on add.
-------------------------------------------------------------------
Sat Feb 29 12:25:46 UTC 2020 - Johannes Kastl <kastl@b1-systems.de>
- update to 1.13.2
Bugfixes
- #2652: Warn without error when processes input is started on Windows.
- #6890: Only parse certificate blocks in x509_cert input.
- #6883: Add custom attributes for all resource types in vsphere input.
- #6899: Fix URL agent address form with udp in snmp input.
- #6619: Change logic to allow recording of device fields when attributes is false.
- #6903: Do not add invalid timestamps to kafka messages.
- #6906: Fix json_strict option and set default of true.
-------------------------------------------------------------------
Sat Feb 29 12:24:02 UTC 2020 - Johannes Kastl <kastl@b1-systems.de>
- update to 1.13.1
Bugfixes
- #6788: Fix ServerProperty query stops working on Azure after failover.
- #6803: Add leading period to OID in SNMP v1 generic traps.
- #6823: Fix missing config fields in prometheus serializer.
- #6694: Fix panic on connection loss with undelivered messages in mqtt_consumer.
- #6679: Encode query hash fields as hex strings in sqlserver input.
- #6345: Invalidate diskio cache if the metadata mtime has changed.
- #6800: Show platform not supported warning only on plugin creation.
- #6814: Fix rabbitmq cannot complete gather after request error.
- #6846: Fix /sbin/init --version executed on Telegraf startup.
- #6847: Use last path element as field key if path fully specified.
-------------------------------------------------------------------
Sat Feb 29 07:50:36 UTC 2020 - Johannes Kastl <kastl@b1-systems.de>
- update to 1.13.0
- rebased patch 0005-README.md-Generic-SQL-output-plugin-for-Telegraf-pat.patch
- changelog:
Release Notes
- Official packages built with Go 1.13.5.
- The prometheus input and prometheus_client output have a new mapping to
- and from Telegraf metrics, which can be enabled by setting metric_version = 2.
- The original mapping is deprecated. When both plugins have the same setting,
- passthrough metrics will be unchanged. Refer to the prometheus input for
- details about the mapping.
New Inputs
- azure_storage_queue - Contributed by @mjiderhamn
- ethtool - Contributed by @philippreston
- snmp_trap - Contributed by @influxdata
- suricata - Contributed by @satta
- synproxy - Contributed by @rfrenayworldstream
- systemd_units - Contributed by @benschweizer
New Processors
- clone - Contributed by @adrianlzt
New Aggregators
- merge - Contributed by @influxdata
Features
- #6326: Add per node memory stats to rabbitmq input.
- #6361: Add ability to read query from file to postgresql_extensible input.
- #5921: Add replication metrics to the redis input.
- #6177: Support NX-OS telemetry extensions in cisco_telemetry_mdt.
- #6415: Allow graphite parser to create Inf and NaN values.
- #6434: Use prefix base detection for ints in grok parser.
- #6465: Add more performance counter metrics to sqlserver input.
- #6476: Add millisecond unix time support to grok parser.
- #6473: Add container id as optional source tag to docker and docker_log input.
- #6504: Add lang parameter to OpenWeathermap input plugin.
- #6540: Log file open errors at debug level in tail input.
- #6553: Add timeout option to cloudwatch input.
- #6549: Support custom success codes in http input.
- #6530: Improve ipvs input error strings and logging.
- #6532: Add strict mode to JSON parser that can be disable to ignore invalid items.
- #6543: Add support for Kubernetes 1.16 and remove deprecated API usage.
- #6283: Add gathering of RabbitMQ federation link metrics.
- #6356: Add bearer token defaults for Kubernetes plugins.
- #5870: Add support for SNMP over TCP.
- #6603: Add support for per output flush jitter.
- #6650: Add a nameable file tag to file input plugin.
- #6640: Add Splunk MultiMetric support.
- #6680: Add support for sending HTTP Basic Auth in influxdb input
- #5767: Add ability to configure the url tag in the prometheus input.
- #5767: Add prometheus metric_version=2 mapping to internal metrics/line protocol.
- #6703: Add prometheus metric_version=2 support to prometheus_client output.
- #6660: Add content_encoding compression support to socket_listener.
- #6689: Add high resolution metrics support to CloudWatch output.
- #6716: Add SReclaimable and SUnreclaim to mem input.
- #6695: Allow multiple certificates per file in x509_cert input.
- #6686: Add additional tags to the x509 input.
- #6703: Add batch data format support to file output.
- #6688: Support partition assignement strategy configuration in kafka_consumer.
- #6731: Add node type tag to mongodb input.
- #6669: Add uptime_ns field to mongodb input.
- #6735: Support resolution of symlinks in filecount input.
- #6746: Set message timestamp to the metric time in kafka output.
- #6740: Add base64decode operation to string processor.
- #6790: Add option to control collecting global variables to mysql input.
Bugfixes
- #6484: Show correct default settings in mysql sample config.
- #6583: Use 1h or 3h rain values as appropriate in openweathermap input.
- #6573: Fix not a valid field error in Windows with nvidia input.
- #6614: Fix influxdb output serialization on connection closed.
- #6690: Fix ping skips remaining hosts after dns lookup error.
- #6684: Log mongodb oplog auth errors at debug level.
- #6705: Remove trailing underscore trimming from json flattener.
- #6421: Revert change causing cpu usage to be capped at 100 percent.
- #6523: Accept any media type in the prometheus input.
- #6769: Fix unix socket dial arguments in uwsgi input.
- #6757: Replace colon chars in prometheus output labels with metric_version=1.
- #6773: Set TrimLeadingSpace when TrimSpace is on in csv parser.
-------------------------------------------------------------------
Sat Feb 29 07:01:24 UTC 2020 - Johannes Kastl <kastl@b1-systems.de>
- split up patch 0001-Generic-SQL-output-plugin-for-Telegraf.patch
(from https://github.com/influxdata/telegraf/pull/4205)
into multiple patches:
0001-plugins-outputs-all-all.go-Generic-SQL-output-plugin.patch
0002-plugins-outputs-sql-README.md-Generic-SQL-output-plu.patch
0003-plugins-outputs-sql-sql.go-Generic-SQL-output-plugin.patch
0004-plugins-outputs-sql-sql_test.go-Generic-SQL-output-p.patch
0005-README.md-Generic-SQL-output-plugin-for-Telegraf-pat.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Dec 18 21:56:52 UTC 2019 - Jeff Kowalczyk <jkowalczyk@suse.com> Wed Dec 18 21:56:52 UTC 2019 - Jeff Kowalczyk <jkowalczyk@suse.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package telegraf # spec file for package telegraf
# #
# Copyright (c) 2019 SUSE LLC # Copyright (c) 2020 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -17,7 +17,7 @@
Name: telegraf Name: telegraf
Version: 1.12.6 Version: 1.13.4
Release: 0 Release: 0
Summary: The plugin-driven server agent for collecting & reporting metrics Summary: The plugin-driven server agent for collecting & reporting metrics
License: MIT License: MIT
@ -35,7 +35,11 @@ BuildRequires: systemd-rpm-macros
## Features ## ## Features ##
Patch0: 0001-Generic-SQL-output-plugin-for-Telegraf.patch Patch1: 0001-plugins-outputs-all-all.go-Generic-SQL-output-plugin.patch
Patch2: 0002-plugins-outputs-sql-README.md-Generic-SQL-output-plu.patch
Patch3: 0003-plugins-outputs-sql-sql.go-Generic-SQL-output-plugin.patch
Patch4: 0004-plugins-outputs-sql-sql_test.go-Generic-SQL-output-p.patch
Patch5: 0005-README.md-Generic-SQL-output-plugin-for-Telegraf-pat.patch
## /Features ## ## /Features ##
@ -55,7 +59,11 @@ rm -rf %{name}
ln -sf %{name}-%{version} %{name} ln -sf %{name}-%{version} %{name}
cd %{name} cd %{name}
tar -xJf %{SOURCE1} tar -xJf %{SOURCE1}
%patch0 -p1 %patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build %build
%ifnarch ppc64 ppc64le %ifnarch ppc64 ppc64le
@ -70,6 +78,7 @@ mkdir -p %{buildroot}%{_bindir}
install -m755 %{_telegraf_dir}/%{name} %{buildroot}%{_bindir}/%{name} install -m755 %{_telegraf_dir}/%{name} %{buildroot}%{_bindir}/%{name}
mkdir -p %{buildroot}/%{_config_dir} mkdir -p %{buildroot}/%{_config_dir}
mkdir -p %{buildroot}/%{_config_dir}/%{name}.d
install -m644 %{_telegraf_dir}/etc/%{name}.conf %{buildroot}/%{_config_dir} install -m644 %{_telegraf_dir}/etc/%{name}.conf %{buildroot}/%{_config_dir}
install -D -m 644 %{_telegraf_dir}/scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service install -D -m 644 %{_telegraf_dir}/scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
@ -94,7 +103,11 @@ ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
%{_unitdir}/%{name}.service %{_unitdir}/%{name}.service
%doc src/github.com/influxdata/%{name}/CHANGELOG.md %doc src/github.com/influxdata/%{name}/CHANGELOG.md
%doc src/github.com/influxdata/%{name}/CONTRIBUTING.md %doc src/github.com/influxdata/%{name}/CONTRIBUTING.md
%if 0%{?sle_version} <= 120200 && !0%{?is_opensuse}
%doc src/github.com/influxdata/%{name}/LICENSE
%else
%license src/github.com/influxdata/%{name}/LICENSE %license src/github.com/influxdata/%{name}/LICENSE
%endif
%doc src/github.com/influxdata/%{name}/README.md %doc src/github.com/influxdata/%{name}/README.md
%dir %{_config_dir} %dir %{_config_dir}
%config(noreplace) %{_config_dir}/%{name}.conf %config(noreplace) %{_config_dir}/%{name}.conf