Skip to main content

Posts

Showing posts from July, 2017

CredStash and Ansible – Hide those CloudFormation Secrets

One of the great features of Infrastructure as a Code ( IaC ) is the ability to keep all the infrastructure description in a Git repository. You can track any change made to the infrastructure, and even revert the infrastructure to a specific deployment just like with any other code. CloudFormation  is one of the best IaC example out there. I use it to describe almost all of the AWS resources I manage. I generate the JSON template using the wonderful Python based tool named  Troposphere . To make the JSON template creation even more flexible, I transform the Troposphere Python files to Ansible templates. I use  Jenkins  to orchestrate all the templating, JSON file generation, and creation or updating of the CloudFormation stacks. So, the flow is basically as follows: Create the Troposphere file as an Ansible template and insert Ansible variables or lookups where appropriate. Generate the Troposphere Python file from the ansible template using the Ansible templating engine. R

Zabbix, AWS and Auto Registration

One of the things I love the most with AWS is  auto-scaling . You choose an AMI, set some parameters and AWS will spin instances up and down whenever a threshold is breached. But with all these instances spinning up and down there are some unknowns. For example, what is the IP address of the new instance? Its host name? This can be critical when other components of your infrastructure are dependent on knowing these parameters. I had this problem when I started to use  Zabbix  as the monitoring system. At first it seemed like a complicated one, but Zabbix has a wonderful feature called  Auto Registration  which can be used exactly for this situation. I will try to show how to configure auto registration both on the client (EC2 instance running Ubuntu 14.04) and on the Zabbix server (Zabbix Server 2.4.2). Zabbix-agent Installation and Configuration Let’s start with installing zabbix-agent on the Ubuntu client: 1 2 $ sudo apt-get update $ sudo apt-get install -y zab

Zabbix and CloudWatch: mix them together the Grafana way.

Many times, when I am debugging an environment, I find myself opening a lot of web browser tabs and windows to get metrics and see graphs from a number of data sources. It is a tiresome and prone to error way to go as each metric can be presented in a different timezone, and there is no way to stack them together. Grafana  is an excellent solution to this problem as it can aggregate and mix many data sources and present them in a rich way. In this post I will show how to aggregate and mix metrics from Zabbix and AWS CloudWatch. Installing Grafana We will install Grafana 2.5.0 on an Ubuntu 14.04 server. Full installation documentation can be found  here . First, download and install the  .deb  package and its dependencies: 1 2 3 $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_2.5.0_amd64.deb $ sudo apt-get install -y adduser libfontconfig $ sudo dpkg -i grafana_2.5.0_amd64.deb Now, start the service: 1 $ sudo service grafana-server s