.. _graphic_types:

###############
Types of graphs
###############

Centreon Broker handles most existing RRD graph types. It can handle
ABSOLUTE, COUNTER, DERIVE and GAUGE graphs as described in the
.. _rrdcreate man page: http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html .

Performance data syntax
=======================

For this purpose, Centreon Broker enhanced the existing Nagios'
performance data syntax. The standard syntax is like this::

  label=valueUOM;warn;crit;min;max

Where *UOM* is the unit, *warn* the warning threshold, *crit* the
critical threshold, *min* the minimal value and *max* the maximal
value.

The new enhanced syntax is as such::

  type[label]=valueUOM;warn;crit;min;max

Where *type* is one of **a**, **c**, **d** or **g** for *ABSOLUTE*,
*COUNTER*, *DERIVE* or *GAUGE*, respectively. When using the new syntax,
the square brackets are required around the *label*. However, Centreon
Broker still recognises the old syntax in which case it assumes that the
graph is of the *GAUGE* type.

Let's take an example::

  c[total_traffic_in]=123456789B;;;0;4294967296

In the case above, the *total_traffic_in* metric is of type *COUNTER*.
Its value is currently *123456789* and its unit is *B* (bytes). Its
value range from *0* (min) and *4294967296* (max). Warning and critical
thresholds are not specified.

Database relationship
=====================

The type of the metric in specified by the *data_source_type* field of
the **metrics** table. This table is filled by
:ref:`storage endpoints <user_modules_storage>`. The *data_source_type*
field is set only when a new metric is inserted in the table. This means
that if you modify the performance data format of an existing metric,
its type won't be updated. To achieve metric type change you need to
either use Centreon and force the metric type or follow the following
steps:

- update the *data_source_type* field of the target metric entry in
  the *metrics* table
- make Broker aware of this change (restart, SIGHUP)
- :ref:`rebuild the graph <exploit_graph_rebuild>`
