Integrare collectd cu Graphite

Postat la Mon 17 September 2018 in proiecte

Am prezentat in articolul legat de collectd o interfata de vizualizarea graficelor generare din fisierele RRD si comparand cu graficele generate de Graphite descoperim ca nu se ridica la acelasi nivel, in special din punct de vedere al granularitatii metricilor stocate.

Incepand cu versiunea 5 collectd include un plugin ce permite salvarea datelor in Graphite.

Creem fisierul /etc/collectd.d/graphite.config

LoadPlugin write_graphite
LoadPlugin aggregation
<Plugin write_graphite>
    <Node "graphite">
        Host "xxx.xxx.xxx.xxx"
        Port "2003"
        Protocol "tcp"
        LogSendErrors true
        Prefix "collectd."
        EscapeCharacter "_"
        SeparateInstances true
        StoreRates true
        AlwaysAppendDS false
    </Node>
</Plugin>
<Plugin "aggregation">
    <Aggregation>
        Plugin "cpu"
        Type "cpu"
        GroupBy "Host"
        GroupBy "TypeInstance"
        CalculateAverage true
    </Aggregation>
</Plugin>
<Plugin df>
    ReportByDevice false
    ReportReserved true
    ReportInodes true
    ValuesAbsolute true
    ValuesPercentage true
    ReportInodes true
</Plugin>
<Chain "PostCache">
    <Rule>
        <Match regex>
            Plugin "^cpu$"
            PluginInstance "^[0-9]+$"
        </Match>
        <Target write>
            Plugin "aggregation"
        </Target>
    Target stop
    </Rule>
Target "write"
</Chain>

si repornim serviciul collectd.

systemctl restart collectd

In scurt timp vom gasi metricile salvate de forma collectd.{server}.... cu care putem crea grafice

si mai apoi putem grupa aceste grafice in dashboard-uri: