Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhemmarchand committed Nov 15, 2018
1 parent a639bb8 commit 40ca06c
Showing 1 changed file with 142 additions and 3 deletions.
145 changes: 142 additions & 3 deletions docs/telegraf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,152 @@ It is not the purpose of this documentation to expose every piece of the install
Telegraf installation and configuration
=======================================

Telegraf installation, configuration and start
----------------------------------------------
Telegraf standard installation (standalone and independant process)
-------------------------------------------------------------------

The installation of Telegraf is really straightforward, consult:

- https://github.com/influxdata/telegraf

If you wish to deploy Telegraf as a Splunk TA application instead, consult the next step.

Telegraf deployment as Splunk application deployed by Splunk (TA)
-----------------------------------------------------------------

For Linux OS only (this does not work on Windows), you can publish Telegraf through a Splunk application that you push to your clients using a Splunk deployment server.

This means that you can create a custom Technology Addon (TA) that contains both the Telegraf binary and the telegraf.conf configuraton files.

**This method has several advantages:**

- If you are a Splunk customer already, you may have the Splunk Universal Forwarder deployed on your servers, you will NOT need to deploy an additional collector independently from Splunk

- You get benefit from the Splunk centralisation and deploy massively Telegraf from Splunk

- You can maintain and upgrade Telegraf just as you do usually in Splunk, all from your Splunk Deployment Server. (DS)

**If you wish to check for a read to use example, see:**

- https://github.com/guilhemmarchand/TA-telegraf-amd64

**To achieve this, you need to:**

- Create a package in your Splunk Deployment Server, let's call it "TA-telegraf-linux-amd64", if you have more than this architecture to maintain, just reproduce the same steps for other processor architectures. (arm, etc)

::

$SPLUNK_HOME/etc/deployment-server/TA-telegraf-linux-amd64
/bin
/local/telegraf.conf
/metadata/default.meta

- The "bin" directory hosts the Telegraf binary

- The "local" directory hosts the telegraf.conf configuration file

- The "metadata" directory is a standard directory that should contain a default.meta which in the context of the TA will contain:

*default.meta*

::

# Application-level permissions
[]
owner = admin
access = read : [ * ], write : [ admin ]
export = system

- Download the last Telegraf version for your processor architecture (here amd64), and extract its contain in the "bin" directory, you will get:

::

bin/telegraf/etc
bin/telegraf/usr
bin/telegraf/var

- Telegraf provides an "init.sh" script that we will use to manage the state of the Telegraf process:

::

bin/telegraf/usr/lib/telegraf/scripts/init.sh

- Copy this "init.sh" script to the root of the "bin" directory:

::

cp -p bin/telegraf/usr/lib/telegraf/scripts/init.sh bin/

- Achieve some minor modifications related to patch customizations, basically:

Change:

::

USER=telegraf
GROUP=telegraf

By:

::

USER=$(whoami)
GROUP=$(id -g -n)

*Notes: the configuration above will automatically use the owner of the Splunk processes*

Change:

::

daemon=/usr/bin/telegraf

By:

::

daemon=$SPLUNK_HOME/etc/apps/TA-telegraf-amd64/bin/telegraf/usr/bin/telegraf

Change:

::

config=/etc/telegraf/telegraf.conf
confdir=/etc/telegraf/telegraf.d

By:

::

config=$SPLUNK_HOME/etc/apps/TA-telegraf-amd64/local/telegraf.conf
confdir=$SPLUNK_HOME/etc/apps/TA-telegraf-amd64/bin/telegraf/etc/telegraf/telegraf.d


**Finally, create a very simple local/inputs.conf configuration file:**

*local/inputs.conf*

::

# start telegraf at Splunk start, and restart if Splunk is restarted. (which allows upgrading easily Telegraf binaries shipped with the TA package)
[script://./bin/init.sh restart]
disabled = false
interval = -1

Et voila ! Deploy this TA to your Linux host and start receiving metrics in Splunk.

If you wish to check for a read to use example, see:

- https://github.com/guilhemmarchand/TA-telegraf-amd64

**Upgrades:**

To upgrade Telegraf binary to a new version, simply extract the new tgz release in the "bin" directory, and reload your Splunk Deployment server.

Splunk will automatically restart the Telegraf process after Splunk startup.

Telegraf minimal configuration
------------------------------

A minimal configuration to monitor Operating System metrics:

- https://docs.influxdata.com/chronograf/latest/guides/using-precreated-dashboards/#system
Expand Down Expand Up @@ -182,7 +321,7 @@ Windows DFS server
- https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters#dfs-replication--domain-controllers

Microsoft IIS / ASP.NET
------------------
-----------------------

**For IIS and ASP.NET, follow instructions for: IIS / ASP.NET**

Expand Down

0 comments on commit 40ca06c

Please sign in to comment.