diff options
Diffstat (limited to 'scripts/package-build/telegraf')
-rw-r--r-- | scripts/package-build/telegraf/.gitignore | 6 | ||||
-rw-r--r-- | scripts/package-build/telegraf/README.md | 4 | ||||
l--------- | scripts/package-build/telegraf/build.py | 1 | ||||
-rwxr-xr-x | scripts/package-build/telegraf/build.sh | 27 | ||||
-rw-r--r-- | scripts/package-build/telegraf/package.toml | 5 | ||||
-rw-r--r-- | scripts/package-build/telegraf/plugins/inputs/all/all.go | 72 | ||||
-rw-r--r-- | scripts/package-build/telegraf/plugins/outputs/all/all.go | 9 |
7 files changed, 124 insertions, 0 deletions
diff --git a/scripts/package-build/telegraf/.gitignore b/scripts/package-build/telegraf/.gitignore new file mode 100644 index 00000000..bf2fcf43 --- /dev/null +++ b/scripts/package-build/telegraf/.gitignore @@ -0,0 +1,6 @@ +telegraf/ +*.buildinfo +*.build +*.changes +*.deb +*.dsc diff --git a/scripts/package-build/telegraf/README.md b/scripts/package-build/telegraf/README.md new file mode 100644 index 00000000..63119c0c --- /dev/null +++ b/scripts/package-build/telegraf/README.md @@ -0,0 +1,4 @@ +# build +``` +python3 build.py +``` diff --git a/scripts/package-build/telegraf/build.py b/scripts/package-build/telegraf/build.py new file mode 120000 index 00000000..3c76af73 --- /dev/null +++ b/scripts/package-build/telegraf/build.py @@ -0,0 +1 @@ +../build.py
\ No newline at end of file diff --git a/scripts/package-build/telegraf/build.sh b/scripts/package-build/telegraf/build.sh new file mode 100755 index 00000000..2ba511d0 --- /dev/null +++ b/scripts/package-build/telegraf/build.sh @@ -0,0 +1,27 @@ +#!/bin/sh +CWD=$(pwd) +set -e + +BUILD_ARCH=$(dpkg-architecture -qDEB_TARGET_ARCH) + +SRC=telegraf +if [ ! -d ${SRC} ]; then + echo "Source directory does not exists, please 'git clone'" + exit 1 +fi + +PLUGIN_DIR=${CWD}/plugins + +echo "I: Selecting Input plugins" +cp ${PLUGIN_DIR}/inputs/all/all.go ${SRC}/plugins/inputs/all/all.go + +echo "I: Selecting Output plugins" +cp ${PLUGIN_DIR}/outputs/all/all.go ${SRC}/plugins/outputs/all/all.go + +echo "I: Build Debian ${BUILD_ARCH} package" +cd ${SRC} +export PATH=/opt/go/bin:$PATH + +# Generate default telegraf config +go run ./cmd/telegraf config > etc/telegraf.conf +LDFLAGS=-w make "${BUILD_ARCH}.deb" diff --git a/scripts/package-build/telegraf/package.toml b/scripts/package-build/telegraf/package.toml new file mode 100644 index 00000000..c255c43d --- /dev/null +++ b/scripts/package-build/telegraf/package.toml @@ -0,0 +1,5 @@ +[[packages]] +name = "telegraf" +commit_id = "v1.28.3" +scm_url = "https://github.com/influxdata/telegraf.git" +build_cmd = "cd ..; ./build.sh; cp telegraf/build/dist/*.deb ." diff --git a/scripts/package-build/telegraf/plugins/inputs/all/all.go b/scripts/package-build/telegraf/plugins/inputs/all/all.go new file mode 100644 index 00000000..8265681b --- /dev/null +++ b/scripts/package-build/telegraf/plugins/inputs/all/all.go @@ -0,0 +1,72 @@ +package all + +import ( + //Blank imports for plugins to register themselves + _ "github.com/influxdata/telegraf/plugins/inputs/azure_storage_queue" + _ "github.com/influxdata/telegraf/plugins/inputs/bond" + _ "github.com/influxdata/telegraf/plugins/inputs/cgroup" + _ "github.com/influxdata/telegraf/plugins/inputs/chrony" + _ "github.com/influxdata/telegraf/plugins/inputs/conntrack" + _ "github.com/influxdata/telegraf/plugins/inputs/cpu" + _ "github.com/influxdata/telegraf/plugins/inputs/disk" + _ "github.com/influxdata/telegraf/plugins/inputs/diskio" + _ "github.com/influxdata/telegraf/plugins/inputs/disque" + _ "github.com/influxdata/telegraf/plugins/inputs/dmcache" + _ "github.com/influxdata/telegraf/plugins/inputs/dns_query" + _ "github.com/influxdata/telegraf/plugins/inputs/docker" + _ "github.com/influxdata/telegraf/plugins/inputs/docker_log" + _ "github.com/influxdata/telegraf/plugins/inputs/ethtool" + _ "github.com/influxdata/telegraf/plugins/inputs/exec" + _ "github.com/influxdata/telegraf/plugins/inputs/execd" + _ "github.com/influxdata/telegraf/plugins/inputs/file" + _ "github.com/influxdata/telegraf/plugins/inputs/filecount" + _ "github.com/influxdata/telegraf/plugins/inputs/filestat" + _ "github.com/influxdata/telegraf/plugins/inputs/fireboard" + _ "github.com/influxdata/telegraf/plugins/inputs/hddtemp" + _ "github.com/influxdata/telegraf/plugins/inputs/hugepages" + _ "github.com/influxdata/telegraf/plugins/inputs/influxdb" + _ "github.com/influxdata/telegraf/plugins/inputs/influxdb_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/influxdb_v2_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/intel_pmu" + _ "github.com/influxdata/telegraf/plugins/inputs/intel_powerstat" + _ "github.com/influxdata/telegraf/plugins/inputs/intel_rdt" + _ "github.com/influxdata/telegraf/plugins/inputs/internal" + _ "github.com/influxdata/telegraf/plugins/inputs/internet_speed" + _ "github.com/influxdata/telegraf/plugins/inputs/interrupts" + _ "github.com/influxdata/telegraf/plugins/inputs/ipmi_sensor" + _ "github.com/influxdata/telegraf/plugins/inputs/ipset" + _ "github.com/influxdata/telegraf/plugins/inputs/iptables" + _ "github.com/influxdata/telegraf/plugins/inputs/ipvs" + _ "github.com/influxdata/telegraf/plugins/inputs/kernel" + _ "github.com/influxdata/telegraf/plugins/inputs/kernel_vmstat" + _ "github.com/influxdata/telegraf/plugins/inputs/mdstat" + _ "github.com/influxdata/telegraf/plugins/inputs/mem" + _ "github.com/influxdata/telegraf/plugins/inputs/net" + _ "github.com/influxdata/telegraf/plugins/inputs/netstat" + _ "github.com/influxdata/telegraf/plugins/inputs/nstat" + _ "github.com/influxdata/telegraf/plugins/inputs/ping" + _ "github.com/influxdata/telegraf/plugins/inputs/powerdns_recursor" + _ "github.com/influxdata/telegraf/plugins/inputs/processes" + _ "github.com/influxdata/telegraf/plugins/inputs/procstat" + _ "github.com/influxdata/telegraf/plugins/inputs/sensors" + _ "github.com/influxdata/telegraf/plugins/inputs/sflow" + _ "github.com/influxdata/telegraf/plugins/inputs/slab" + _ "github.com/influxdata/telegraf/plugins/inputs/smart" + _ "github.com/influxdata/telegraf/plugins/inputs/snmp" + _ "github.com/influxdata/telegraf/plugins/inputs/snmp_legacy" + _ "github.com/influxdata/telegraf/plugins/inputs/snmp_trap" + _ "github.com/influxdata/telegraf/plugins/inputs/socket_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/socketstat" + _ "github.com/influxdata/telegraf/plugins/inputs/syslog" + _ "github.com/influxdata/telegraf/plugins/inputs/sysstat" + _ "github.com/influxdata/telegraf/plugins/inputs/system" + _ "github.com/influxdata/telegraf/plugins/inputs/systemd_units" + _ "github.com/influxdata/telegraf/plugins/inputs/tail" + _ "github.com/influxdata/telegraf/plugins/inputs/tcp_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/temp" + _ "github.com/influxdata/telegraf/plugins/inputs/twemproxy" + _ "github.com/influxdata/telegraf/plugins/inputs/udp_listener" + _ "github.com/influxdata/telegraf/plugins/inputs/wireguard" + _ "github.com/influxdata/telegraf/plugins/inputs/wireless" + _ "github.com/influxdata/telegraf/plugins/inputs/x509_cert" +) diff --git a/scripts/package-build/telegraf/plugins/outputs/all/all.go b/scripts/package-build/telegraf/plugins/outputs/all/all.go new file mode 100644 index 00000000..49f7e63d --- /dev/null +++ b/scripts/package-build/telegraf/plugins/outputs/all/all.go @@ -0,0 +1,9 @@ +package all + +import ( + //Blank imports for plugins to register themselves + _ "github.com/influxdata/telegraf/plugins/outputs/azure_data_explorer" + _ "github.com/influxdata/telegraf/plugins/outputs/http" + _ "github.com/influxdata/telegraf/plugins/outputs/influxdb_v2" + _ "github.com/influxdata/telegraf/plugins/outputs/prometheus_client" +) |