TICK

TICK Stack – Beginner Notes

What is the TICK stack?  Its the combination of “open source” products that make up the InfluxData monitoring and analytics platform.

  • T = Telegraf
    • Responsible for collecting data (metrics) and shipping to InfluxDB
  • I = InfluxDB
    • Responsible for storing the data
  • C = Chronograf
    • Gui for visualization of data in InfluxDB
  • K = Kapacitor
    • Framework for providing action against the data.  (e.g alerts, anomaly action)

Below are some helpful notes for getting the TICK stack components setup and running.

Installing\configuring InfluxDB

  1. The following link is a great resource on getting the InfluxDB installed
  2. By default the following locations will be used for the DB data and can be adjusted in the influxdb.conf file. (Helpful Link)
    • /var/lib/influxdb/meta [Info]
    • /var/lib/influxdb/data [Info]
    • /var/lib/influxdb/wal [Write Ahead Log – Info]
  3. By default the following HTTP port will be used and can be adjusted in the influxdb.conf file.
    • bind-address = “:8086”
  4. After installing InfluxDB, you may need to start the service.  You can always verify the service is running as needed.
    • service influxdb status
  5. For additional verification after you install and start the InfluxDB, you can verify the ports are listening using “netstat“.  If netstat is missing install as needed “yum install net-tools” for RHEL.
    • netstat -vatnp | grep 8086
  6. You can also connect to the DB and execute a simple query.
    • influx -host <host_name> -port <port_number>
    • show databases
  7. To adjust what conf file is used by the InfluxDB at service startup, you will want to look at the influxdb.service file in the following locations.
    • /usr/lib/systemd/system/
    • /run/systemd/system/
    • /etc/systemd/system/

Installing\configuring Telegraf

  1. The following link is a great resource on getting the Telegraf installed on a Linux server.
  2. The default configuration file used by Telegraf will be the following.
    • /etc/telegraf/telegraf.conf
  3. In the default conf file you will notice the following lines that represents the InfluxDB that will be used.  You will need to adjust as needed.
  4. If the above database does not exist, you will need to create it using the “Influx” commandline.
    • CREATE DATABASE telegraf
  5. You will want to execute the following command to verify the Telegraf service status and if stopped start as needed.
    • service telegraf status
  6. You will probably want to enable some inputs such as memory and cpu initially and setup the output to influxdb.  You can do this by running the following command from the /etc/telegraft/ dir to create a new conf file.
    • telegraf -sample-config -input-filter cpu:mem -output-filter influxdb > telegraf.conf
  7. You will need to restart the Telegraf service to pickup the new conf file changes.
    • service telegraf restart
  8. Finally you should be able to query the InfluxDB for your data using the following influx commands.
    • use telegraf (Specify what database we are using)
    • show measurements (Should return mem and cpu)
    • SELECT time, usage_system FROM cpu WHERE time > now() – 1m (Show time and system usage entries for the last minute from cpu)
  9. To adjust what conf file is used by the Telegraf at service startup, you will want to look at the telegraf.service file in the following locations.
    • /usr/lib/systemd/system/
    • /run/systemd/system/
    • /etc/systemd/system/

Installing\configuring Chronograf

  1. The following link is a great resource on getting Chronograf installed
    • Installation document on github. [Link]
  2. To adjust what DB, IP and Port is used by the Chronograf at service startup, you will want to look at the chronograf.service file in the following locations.
    • /usr/lib/systemd/system/
    • /run/systemd/system/
    • /etc/systemd/system/
  3. By default, the local firewall may block the default Chronograf port 8888, so you may need to update your firewall rules as needed.
  4. When you initially log into Chronograf, you will enter the InfluxDB connection details.
  5. The example below shows our Telegraf cpu\mem input filter data in Chronograf.
    • Chronograf.png

Installing\configuring Kapacitor

  1. The following link is a great resource on getting the Kapacitor installed.
  2. The default configuration file used by Kapacitor will be the following.
    • /etc/kapacitor/kapacitor.conf
  3. In the default conf file you will notice the following lines that represents the InfluxDB that will be used, along with many other settings.  You will need to adjust as needed.
  4. To adjust what config file is used by the Kapacitor at service startup, you will want to look at the kapacitor.service file in the following locations.
    • /usr/lib/systemd/system/
    • /run/systemd/system/
    • /etc/systemd/system/
  5. After installation, you an start the Kapacitor service
    • service kapacitor start
    • service kapacitor status
  6. Now you should be able to log into the Chronograf UI and add the Kapacitor instance.
    • KapacitorRules2
  7. After the Kapacitor instance is added, you can configure Alerts directly through the gui, rather than through the CLI.  This will save you valuable time!
    • KapacitorRules1
  8. After you save your new Alert, you can run the following commands to view the Alert details from the Kapacitor database
    • kapacitor list tasks
    • kapacitor show <id_from_list_tasks_command_above>

Final thoughts

These tools make a great OpenSource monitoring solution that can handle easy to advanced alerting.  My next step is to research using this solution for live stats.

KapacitorRules3.png