charts.d.plugin is a Netdata external plugin. It is an orchestrator for data collection modules written in BASH v4+.

It runs as an independent process ps fax shows it

It is started and stopped automatically by Netdata

It communicates with Netdata via a unidirectional pipe (sending data to the netdata daemon)

Supports any number of data collection modules

charts.d.plugin has been designed so that the actual script that will do data collection will be permanently in
memory, collecting data with as little overheads as possible
(i.e. initialize once, repeatedly collect values with minimal overhead).

charts.d.plugin looks for scripts in /usr/lib/netdata/charts.d.
The scripts should have the filename suffix: .chart.sh.

charts.d.plugin itself can be configured using the configuration file /etc/netdata/charts.d.conf
(to edit it on your system run /etc/netdata/edit-config charts.d.conf). This file is also a BASH script.

In this file, you can place statements like this:

enable_all_charts="yes"
X="yes"
Y="no"

where X and Y are the names of individual charts.d collector scripts.
When set to yes, charts.d will evaluate the collector script (see below).
When set to no, charts.d will ignore the collector script.

The variable enable_all_charts sets the default enable/disable state for all charts.

The module script must be called X.chart.sh and placed in /usr/libexec/netdata/charts.d.

If the module needs a configuration, it should be called X.conf and placed in /etc/netdata/charts.d.
The configuration file X.conf is also a BASH script itself.
To edit the default files supplied by Netdata, run /etc/netdata/edit-config charts.d/X.conf,
where X is the name of the module.

All functions and global variables defined in the script and its configuration, must begin with X_.

The following functions must be defined:

X_check() - returns 0 or 1 depending on whether the module is able to run or not
(following the standard Linux command line return codes: 0 = OK, the collector can operate and 1 = FAILED,
the collector cannot be used).

Charts.d will run in debug mode, with an update frequency of 1, evaluating only the collector scripts
X, Y and Z. You can define zero or more module scripts. If none is defined, charts.d will evaluate all
module scripts available.

Keep in mind that if your configs are not in /etc/netdata, you should do the following before running
charts.d.plugin:

exportNETDATA_USER_CONFIG_DIR="/path/to/etc/netdata"

Also, remember that Netdata runs chart.d.plugin as user netdata (or any other user the netdata process is configured to run as).

charts.d.plugin will call the X_update() function one after another. This means that a delay in collector X
will also delay the collection of Y and Z.

You can have multiple charts.d.plugin running to overcome this problem.

This is what you need to do:

Decide a new name for the new charts.d instance: example charts2.d.

Create/edit the files /etc/netdata/charts.d.conf and /etc/netdata/charts2.d.conf and enable / disable the
module you want each to run. Remember to set enable_all_charts="no" to both of them, and enable the individual
modules for each.

link /usr/libexec/netdata/plugins.d/charts.d.plugin to /usr/libexec/netdata/plugins.d/charts2.d.plugin.
Netdata will spawn a new charts.d process.

Execute the above in this order, since Netdata will (by default) attempt to start new plugins soon after they are
created in /usr/libexec/netdata/plugins.d/.