---
title: "Monitoring CloudStack with Collectd"
description: "Monitoring CloudStack with Collectd"
date: 2013-12-08
tags: ["cloudstack","monitoring"]
url: https://www.exoscale.com/blog/monitoring-cloudstack/
---
# Monitoring CloudStack with Collectd

Following on the Cloudstack Collaboration Conference last month in 
Amsterdam, we are releasing the tooling we use in our public cloud
to cope with large Cloudstack implementations.

Today, we publish our [collectd](https://collectd.org/) Cloudstack 
plugin which can gather all these metrics:

* Number of instances : Total, Running and Stopped
* Public IPs: Total and Used
* Private IPs: Total and Used
* Memory: Total (with and without over-provisioning), Allocated and Used
* CPU: Total (with and without over-provisioning), Allocated and Used
* Primary Storage: Total (with and without over-provisioning), Allocated and Used
* Secondary Storage: Total and Used
* LocalStorage : Total and Used
* Network: Read and Write
* Console Proxy : Number of active sessions

Once collected by a collectd probe machine or directly on your CloudStack Server
you can push these metrics in a graphing server like we do. We use 
[Graphite](https://graphiteapp.org/) to generate a nice dashboard overview
of this infra.

Installation is quite simple, just drop the plugin in the plugins folder of 
your collectd installation and add the following configuration to your 
collectd.conf:

    <LoadPlugin python>
        Globals true
    </LoadPlugin>

    <Plugin python>
        # cloudstack.py is at /usr/lib/collectd/cloudstack.py
        ModulePath "/usr/lib64/collectd/"

        Import "cloudstack"

    <Module cloudstack>
      Api "https://mycloudstack.com:443/client/api"
      Auth "True"
      ApiKey "RANDOM-KEY-FROM-CS"
      Secret "SECRET-FROM-CS"
    </Module>
    </Plugin>


Download, fork and improve this code on our [github page](https://github.com/exoscale/collectd-cloudstack)

