AWS using Ansible? Yes, it's possible!

  Although, I've used Ansible extensively for a lot of automation and orchestration tasks, using Ansible for AWS was indeed, a new territory for me.  This turned out to be a blessing, since along with using Ansible for AWS tasks, I also learnt how to use WSL (Windows Subsystem for Linux) on a Windows machine. Though WSL's been around for some time, I still hadn't come around to using it since I was mostly using my Macbook pro. Not anymore, though!  Anyway, I have listed below the steps to: Install WSL on Windows 11 23H2 patch Install AWS CLI on Ubuntu 22.04 (Exact version - 22.04.3 LTS) Install Ansible and the amazon.aws collection Use AWS CLI to get the list of  VPCs in the region - us-east-1 (or a region of your choice) Create a python file/script to get the list of VPCs in the region - us-east-1 (or a region of your choice) Create an Ansible playbook to get the list of VPCs in the region - us-east-1 (or a region of your choice.   You may download the comple...

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

Check if UTL_FILE and FND_FILE are working fine

Modify retention period of workflow queues

Clone database home (clone.pl) deprecated in Oracle 19c