This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Yet another graphite dashboard

1.0.1 2015-12-14 02:53 UTC

This package is not auto-updated.

Last update: 2021-10-11 13:33:27 UTC


Build Status Coverage Status Code Climate Latest Stable Version Latest Unstable Version MIT license


Yet Another Graphite Dashboard - because why not? It's heavily inspired by the Etsy dashboard framework but only provides a very small subset of features. If you have a lot of hosts or need advanced features I'd recommend checking that out.


yagd look


  • PHP >= 5.5
  • Graphite


  • in your dashboards repo, run: composer require mrtazz/yagd
  • copy config.example.php to config.php and adapt it
  • write php to create your dashboards

Usage examples

Generic dashboards

There is a generic Page.php class included which can just include all Graphite graphs you have in an array called $metrics like this:


$metrics = array(

$page = new Page($CONFIG);

Display CollectD host data

If you are using collectd to gather system level graphs you can draw basic information onto a dashboard like this:

Configure hosts in your config.php

$CONFIG['hosts'] = [
        "" => [
            "cpus" => 2,
            "filesystems" => [ 'root', 'var', ]
            "additional_metrics" => [
                "disk temp" => [
                "disk temperature" => "collectd.foo_example_com.disktemp-ada*.current",

And then drop something like this into e.g. htdocs/hosts.php:


require __DIR__ . '/../vendor/autoload.php';


use Yagd\CollectdHost;
use Yagd\Page;

$page = new Page($CONFIG);
echo $page->getHeader($CONFIG["title"],

foreach($CONFIG["hosts"] as $host => $data) {

    $fss = empty($data["filesystems"]) ? [] : $data["filesystems"];

    $server = new CollectdHost($host, $data["cpus"], $fss,
    echo "<h2> {$host} </h2>";

echo $page->getFooter();

Inject a select box into the navbar

For the host page for example you might wanna have an easy way to only show one host. For that you can inject a select box into the header navbar like this:


$selectbox = "";
$selectbox .= "<form method='get' action='hosts.php' style='margin-top: 15px'class='pull-right'>";
$selectbox .= "   <select name='hostname' onchange='this.form.submit()'>";
    foreach ($CONFIG["hosts"] as $host => $data) {
        $selected = ($_GET["hostname"] == $host) ? "selected" : "";
        $selectbox .= "<option value='{$host}' {$selected}>{$host}</option>";
$selectbox .= "</select>";
$selectbox .= "</form>";

$page = new Page($CONFIG);
echo $page->getHeader($CONFIG["title"],

if (empty($_GET["hostname"])) {
    $hosts = $CONFIG["hosts"];
} else {
    $hosts = [ $_GET["hostname"] => $CONFIG["hosts"][$_GET["hostname"]] ];

This will show the content of $selectbox in the header and only show the actually selected host (if one was selected) on the page.