Monitoring A Cluster of Servers

This guide describes how to set up monitoring if you are utilizing groups of servers


Introduction

Observu offers a way to monitor a cluster of servers. This is not that much different from regular monitoring, but there are two important differences:

  • Agents can share a single KEY, making it easy for automated deployment and changing groups of clusters
  • Extra options for managing monitors that disapear from a group (e.g. when you are using auto-scaling)

Setting up a Server Cluster

Before you can start monitoring a group of servers, Observu needs to know about it and you need an API key, to configure the agents. To do so:

  • Choose 'Add a group' on the dashboard
  • Enter a proper name
  • Select the 'Server Cluster' type
  • Click 'Save'
  • Obtain the add-data API key for this group

The API key is required in the next step: installing and configuring the agent.

Installing The Agent

We assume that, by the time you are looking at this option, having to set up each agent by hand, is no longer suitable. Therefore we will describe a more suitable form of installation, that may require some extra work.

  1. Download the agent files from https://observu.com/downloads/linux_agent_latest.tar.gz
  2. Extract them somewhere, e.g. ~/observu-install
  3. copy observu.conf.cluster-skeleton to /etc/observu.conf
  4. Edit /etc/observu.conf and replace {KEY} with the API key obtained above
  5. Install dependencies: libwww-perl using a package manager
  6. run: ./install.sh -snm
    to install without automated dependency installation, configuration wizard and manual start
  7. Start the daemon, if you want to. (If you are creating a system image, this is often not needed/desirable)

Note: the reason why we do not let install.sh manage dependencies, is because you are probably already using another system to manage dependency installation. If you do want to have the install script manage them, just run install.sh without the -s option.

The exact way to achieve these steps varies from platform to platform:

Ubuntu


mkdir ~/observu-install
cd ~/observu-install
wget -O linux_agent_latest.tar.gz  https://observu.com/downloads/linux_agent_latest.tar.gz
tar -xzf linux_agent_latest.tar.gz
cd linux_observu_agent
sudo cp observu.conf.cluster-skeleton /etc/observu.conf
sudo vi /etc/observu.conf
sudo apt-get install libwww-perl libcrypt-ssleay-perl
sudo ./install.sh -snm
sudo /etc/init.d/observu start

Debian


mkdir ~/observu-install
cd ~/observu-install
wget -O linux_agent_latest.tar.gz  https://observu.com/downloads/linux_agent_latest.tar.gz
tar -xzf linux_agent_latest.tar.gz
cd linux_observu_agent
cp observu.conf.cluster-skeleton /etc/observu.conf
vi /etc/observu.conf
apt-get install libwww-perl libcrypt-ssleay-perl
./install.sh -snm
/etc/init.d/observu start

CentOS (tested with 5.1)


mkdir ~/observu-install
cd ~/observu-install
wget -O linux_agent_latest.tar.gz  https://observu.com/downloads/linux_agent_latest.tar.gz
tar -xzf linux_agent_latest.tar.gz
cd linux_observu_agent
cp observu.conf.cluster-skeleton /etc/observu.conf
vi /etc/observu.conf
yum install perl-libwww-perl perl-Crypt-SSLeay
./install.sh -snm
/etc/init.d/observu start

Automation using Chef

If you are using Opscode Chef to configure your servers, we've got a cookbook that installs the Observu agent.

The cookbook basically executes the steps described above, the only thing you need to do is configure the API key.

Basic Steps

  • Make sure you've got a chef repository
  • Download the cookbook from github
  • Extract it into the cookbooks directory of your repository
  • Specify cluster API key e.g. using node[:observu][:key] = "ABCDEFGHIJKLMNOPQ"
  • Deploy...

Example: node.json

This example is a bit more elaborate, it uses a JSON file to configure a node, but the principle is the same for ruby. In this case it sets a specific agent download URL (e.g. in case you need a specific older version) and sets a custom command to produce the monitor name. (in this case specific to Amazon EC2: the instance id)


{
  "observu": {
    "agent_download_url": "https://observu.com/downloads/linux_agent_latest.tar.gz",
    "key": "{your observu cluster key}",
    "monitor_name_command": "curl http://169.254.169.254/latest/meta-data/instance-id"
  },
  "run_list": [ "role[web]", "recipe[observu-agent]" ]
}

Note: you can also configure to install a specific version of the agent. To do so, see our list of all available agent downloads.