Grafana and Oracle database - Part 3 - Installation of Telegraf Agent

Download the telegraf agent here (current version: 1.24.1):

I prefer to directly download and use the executable rather than installing it (using rpm) because to install the rpm version, one would, of course, need root privileges (I don't want to go through that pain, if you know what I mean).

 

Download the executable (tar.gz) and unzip it.

$ pwd
<TELEGRAF_GUNZIP_UNTAR_PATH>/telegraf-1.15.3/usr/bin
$ ls -lrt
total 68112
-rwxr-xr-x 1 <user> <group> 69743232 Sep 11 12:48 telegraf



Ensure that the Telegraf executable is in the PATH variable:

$ pwd
<TELEGRAF_GUNZIP_UNTAR_PATH>/telegraf-1.15.3/usr/bin

$ export PATH=`pwd`:$PATH

$ whereis telegraf
telegraf: <TELEGRAF_GUNZIP_UNTAR_PATH>/telegraf-1.15.3/usr/bin/telegraf

$ telegraf --version
Telegraf 1.15.3 (git: HEAD fac81815)


 

Configure telegraf to monitor CPU, Memory, Network, Swap and Disk and write the output to influxdb.

$ <TELEGRAF_GUNZIP_UNTAR_PATH>/telegraf-1.15.3/usr/bin/telegraf --input-filter cpu:mem:net:swap:disk --output-filter influxdb config > <CONFIG_DIRECTORY>/telegraf.conf

 

Don't forget to put in the details of the influx DB created in the previous step (basically, Influx DB URL, Database, username and password) in the telegraf.conf file.

# Configuration for sending metrics to InfluxDB
[[outputs.influxdb]]
  ## The full HTTP or UDP URL for your InfluxDB instance.
  ##
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  # urls = ["unix:///var/run/influxdb.sock"]
  # urls = ["udp://127.0.0.1:8089"]
  # urls = ["http://127.0.0.1:8086"]

  ## The target database for metrics; will be created as needed.
  ## For UDP url endpoint database needs to be configured on server side.
  # database = "telegraf"

  ## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
  ## Only takes effect when using HTTP.
  # write_consistency = "any"

  ## Timeout for HTTP messages.
  # timeout = "5s"

  ## HTTP Basic Auth
  # username = "telegraf_user"
  # password = "metricsmetricsmetricsmetrics"

 

Now, start the telegraf agent using the conf file:

<TELEGRAF_GUNZIP_UNTAR_PATH>/telegraf-1.15.3/usr/bin/telegraf --config <CONFIG_DIRECTORY>/telegraf.conf


Voilà! The VM/server will now be monitored by the telegraf agent, with the output being sent to influx DB for storage.

 

< Prev (Part 2B: Influx CLI and DB creation)                           Next >

 

Comments

Popular posts from this blog

java.lang.ExceptionInInitializerError while trying to Access login page

Solution to "End Program - WMS Idle"

WGET shell Script for downloading patches