Observium is a graphically oriented monitoring tool similar to Munin. The advantage of this solution is that it manages RRD graphs from Collectd.
Since today, a high-performance graphical interface is really something that's missing from Collectd, it would be a shame to have such a powerful solution without an equally capable interface. That's why after much research, I finally came across Observium which meets this need.
Installation
Prerequisites
We'll use Debian 6 for this tutorial. Here is the list of required packages (use non-free repositories for the snmp-mibs-downloader package):
Let's change the Observium location in the configuration file, add an entry for fping, and modify the SQL fields to adapt them with the correct data (/var/www/observium/config.php):
<?php## Have a look in defaults.inc.php for examples of settings you can set here. DO NOT EDIT defaults.inc.php!### Database config$config['db_host']="localhost";$config['db_user']="USERNAME";$config['db_pass']="PASSWORD";$config['db_name']="observium";### Locations$config['fping']="/usr/bin/fping";$config['install_dir']="/var/www/observium";...
Next, we'll import the schema for building the database:
## As the snmp packages come without MIB files due to license reasons, loading# of MIBs is disabled by default. If you added the MIBs you can reenable# loaging them by commenting out the following line.# mibs :mibdirs/var/www/observium/mibs
Crontab
You'll need to create a user such as admin for example and add a host before initializing and retrieving the first data.
Once done, we run the data collection for the first time:
Even though I contacted the Observium developers, you'll have issues if you want to integrate Collectd with hostnames that have uppercase names. Indeed, since it makes sense to have lowercase hostnames, they decided not to handle uppercase. And if, like me, your hostnames in Collectd are uppercase, it's impossible to perform an integration. I searched for 1000 ways to properly work around this problem, and each time it required code rewriting rather than configuration on the Collectd or Observium side.
So, I ended up modifying the code, but very, very, very slightly. In fact, I simply took care of the host creation script so it creates symbolic links (I know it's not super clean) (addhost.php):
#!/usr/bin/env php<?php/* Observium Network Management and Monitoring System * Copyright (C) 2006-2011, Observium Developers - http://www.observium.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * See COPYING for more details. */include("includes/defaults.inc.php");include("config.php");include("includes/functions.php");if(isset($argv[1])&&$argv[1]){$host=strtolower($argv[1]);$community=$argv[2];$snmpver=strtolower($argv[3]);$host_upper=strtoupper($host);$host_fullpath=$config['collectd_dir'].'/'.$host;$host_fullpath_upper=$config['collectd_dir'].'/'.$host_upper;if(is_numeric($argv[4])){$port=$argv[4];}else{$port=161;}if(@!$argv[5]){$transport='udp';}else{$transport=$argv[5];}if(!$snmpver)$snmpver="v2c";if($community){unset($config['snmp']['community']);$config['snmp']['community'][]=$community;}addHost($host,$community,$snmpver,$port='161',$transport='udp');# Add symlink to correct uppercase hostname problemsif(is_dir($host_fullpath)oris_link($host_fullpath)){exit(0);}elseif(is_dir($host_fullpath_upper)){symlink($host_fullpath_upper,$host_fullpath);}}else{printConsole_Color::convert("Observium v".$config['version']." Add Host ToolUsage: ./addhost.php <%Whostname%n> [community] [v1|v2c] [port] [".join("|",$config['snmp']['transports'])."]%rRemeber to discover the host afterwards.%n");}?>