Configuring collectd, InfluxDB and Grafana for NetScaler metrics

There are a lot of different tools out there to gather and present information about systems. I’ve been looking for something that’s easy to setup and free.

In this case, I wanted to present some metrics from NetScaler in nice graphs. I’m using three open source tools working together to make this possible:

  • collectd – Probe using SNMP and store the data in a database
  • InfluxDB – Database where the SNMP data is stored
  • Grafana – Connects to InfluxDB and creates nice graphs

I’m not going to do a deep-dive into how everything works, since there are a lot of better posts out there regarding that. I’m going to show a few steps how I installed and configured it on CentOS 7 and how I configured it to gather data from NetScaler.

Step 1, install the tools:

I’ll skip the collectd configuration until the end, since that’s where we define what we want to probe on the NetScaler. Step 2, configure InfluxDB:

Next, configure Grafana:

I’m using nginx as reverse proxy locally on the server, not going into details about it but the configuration looks like this:

Now for the fun, and maybe a little harder, part. Collectd! We need to define how we will be collecting the information from NetScaler, in my case this means editing /usr/share/collectd/types.db and creating ”types” that we can use with the SNMP plugin:

I’ve only created two examples, one for NetScaler system (ns_sys) and one for virtual servers (ns_vsvr). It’s important that the order here is matched with the order they are configured in collectd.

Now for the last configuration to get collectd up and running:

Now you just need to logon to Grafana and starta graphing the results. I’ve created two examples (ONLY examples, they need some tweaking to show the exact results):

You can find two json-files here (rename them from .txt to .json and import to Grafana):

NetScaler System
NetScaler vServer

Examples of how they look:

I hope this can help someone and feel free to leave a comment if you’ve found any issues or have better ways of doing this! Or just have questions.

Disclaimer: All information on this blog is offered "as is" with no warranty. It is strongly recommended that you verify all information and validate all scripts in isolated test environments before using them in production environments.