Renan Rangel crunching technology for breakfast


XenServer auto_poweron script

Posted by Renan Rangel

In the past, it was possible to set which XenServer VMs would auto start during boot with the host server. Since the 6.x version, this can no longer be set in the GUI and you must use command line to do the same thing (How to Setup XenServer 6.x to Auto-Start Virtual Machines).

I created a script that will help you set the VMs you want to auto start. Remember that first you have to enable your pool to autostart VMs like this:

# get pool uuid with "xe pool-list"
xe pool-param-set uuid=<pool_uuid> other-config:auto_poweron=true

After that, you can download and execute the script on your XenServer host like this:

# list all VMs and if they are set to auto start :
# set a VM to auto start on boot:
perl <vmname> <true|false>

Get the script from the Gist below. You can move it to your $PATH and rename it to your liking:


Sending AWS CloudWatch alarms to a Hipchat room

Posted by Renan Rangel

I was trying the other day to receive CloudWatch alarms on a Hipchat room, when I had the idea to use AWS Lambda to do the hard work for me, instead of having to run it on some server to receive an HTTP request from SNS.

After you create your Hipchat integration, note down the token and room number so you can use it with the Lambda function.

You need to start by creating a SNS topic to receive the alarm notifications and subscribe it to a Lambda function. Everytime you get an alarm from CloudWatch, it gets sent to SNS, which will call the Lambda function that will connect to the Hipchat API and send it to your room.

You can fing the script in rvrangel/cloudwatch-hipchat at GitHub or just copy it below. Don't forget to adjust your Hipchat variables!

Tagged as: , 3 Comments

Public DNS Comparison

Posted by Renan Rangel

I have been using Google DNS for some time and, while I agree that it does a good job, it also has some drawbacks. I have looked for some other public DNS providers, trying to find some information about which ones do not redirect when a record is not found or that work with DNSBLs (DNS Blackhole List), but the information is not simple to find. So I decided to gather the information and display here for public (and my own) use.

Getting redirected to a search page when a domain is not found really pisses me of. I know that some of these providers (like OpenDNS) support their free service this way, but it is really annoying. The table below shows the comparison of a few services:

DNS Server IP Address 1 IP Address 2 NXDOMAIN DNSBL support Query time
Google DNS
DNS Advantage

*NXDOMAIN - Returns a "domain not found" instead of a search page.
*DNSBL - Supports DNS based blacklists for use with mail servers.
*Query time - As measured from a server in San Francisco.

It is a shame most servers do not accept these 2 things. I guess you should keep the ones that don't do search redirects for unknown domains for desktops and the others for mail servers that require DNSBLs. Also, it was a bit surprising seeing Google DNS taking so much time compared to the others.

Tagged as: No Comments

Getting real-time information about TCP connections

Posted by Renan Rangel

Every sysadmin has a good set of tools that he works with. A nice addition to the Linux sysadmin that usually has to manage a gateway/firewall or other computers with a high number of connections is tcptrack.


It can show you the active TCP connections in real-time, sort them by speed, activity, etc, show how many connections currently exist and also their state. It is a simple tool but very informative - it can be very helpful when you need to find where traffic is coming from. As a bonus, it also supports tcpdump-like filters, so you can display only the connections you are looking for.

If you are using Debian Squeeze, you are out of luck (tcptrack exists in lenny and wheezy, but not in squeeze [?]), you will have to download and compile the lastest version. If you are running Gentoo, just emerge theĀ net-analyzer/tcptrack ebuild.