Netdata Community

Global parameter 'plugins directory' doesn't honor more than one value

Hi all.

I’m trying to migrate my custom plugins into /etc/netdata/custom-plugins.d from the install /usr/libexec/netdata/plugins.d directory. However, netdata now doesn’t recognize the plugins.

Looking at the configuration, the default plugins directory specifies /etc/netdata/custom-plugins.d:

# curl -s http://localhost:19999/netdata.conf | grep 'plugins directory'
	# plugins directory = "/usr/libexec/netdata/plugins.d" "/etc/netdata/custom-plugins.d"

I’ve also tried overriding it but encountered the same problem.

However, if I just specify a single directory (e.g. /etc/netdata/custom-plugins.d or even /tmp) then I see messages in the error.log indicating it can’t find certain built-in files. For example:

2021-12-02 12:11:24: netdata INFO  : MAIN : (0649@daemon/mai:get_system_info): System info script /tmp/system-info.sh not found.

I’m running

# netdata -v
netdata v1.31.0

On

centos 7

Hi, @mjtice. I tested the default configuration

(I have Netdata installed under “/opt”)

[ilyam@pc ~]$ curl -s http://localhost:19999/netdata.conf | grep 'plugins directory'
	# plugins directory = "/opt/netdata/usr/libexec/netdata/plugins.d" "/opt/netdata/etc/netdata/custom-plugins.d"

And it works for me

[ilyam@pc ~]$ ps aux | grep netdata | grep go.d
netdata     4555  0.5  0.0 732360 25808 ?        Sl   14:22   0:00 /opt/netdata/etc/netdata/custom-plugins.d/gogo.d.plugin 1
netdata     4561  0.3  0.0 732360 25480 ?        Sl   14:22   0:00 /opt/netdata/usr/libexec/netdata/plugins.d/go.d.plugin 1

Ensure netdata user has permission to execute the plugin in the custom dir.

[ilyam@pc ~]$ ls -l /opt/netdata/etc/netdata/custom-plugins.d/gogo.d.plugin
-rwxr-x--- 1 root netdata 28639232 дек  3 14:15 /opt/netdata/etc/netdata/custom-plugins.d/gogo.d.plugin

The first value must be not custom plugins.d.

Hi @ilyam8. I’ve tried on another host with the same outcome.

# curl -s http://localhost:19999/netdata.conf | grep 'plugins directory'
	# plugins directory = "/usr/libexec/netdata/plugins.d" "/etc/netdata/custom-plugins.d"

The dir is owned by root but has global permissions. However, I’ll change it to netdata

chown -R netdata.netdata /etc/netdata/custom-plugins.d/

Restart…

systemctl restart netdata

Directory listing

ls -l /etc/netdata/custom-plugins.d/
total 16
-rw-r--r-- 1 netdata netdata 7200 Oct 28 07:44 postgres_table_size.chart.py
-rw-r--r-- 1 netdata netdata 6165 Oct 28 07:44 postgres_vacuum_execute_time.chart.py

Plugin is enabled

grep postgres_vacuum_execute_time /etc/netdata/conf.d/python.d.conf
postgres_vacuum_execute_time: yes

But ps still isn’t showing that dir

ps aux | grep netdata
netdata  155124 25.1  0.2 2976396 2670408 ?     Ssl  07:35   0:21 /usr/sbin/netdata -P /var/run/netdata/netdata.pid -D
netdata  155126  0.0  0.0  78868  2540 ?        Sl   07:35   0:00 /usr/sbin/netdata --special-spawn-server
netdata  155476  0.0  0.0   9696  1540 ?        S    07:35   0:00 /usr/bin/bash /usr/libexec/netdata/plugins.d/tc-qos-helper.sh 5
netdata  155484  4.7  0.0  97028 18928 ?        S    07:35   0:04 /usr/libexec/netdata/plugins.d/apps.plugin 5
netdata  155503  0.9  0.0 228300 36120 ?        Sl   07:35   0:00 /usr/bin/python /usr/libexec/netdata/plugins.d/python.d.plugin 5
netdata  155507  0.4  0.0 725184 14344 ?        Sl   07:35   0:00 /usr/libexec/netdata/plugins.d/go.d.plugin 5

Oh, I see. It is not a plugin (a plugin has suffix .plugin), but python.d module. Indeed, moving them to /etc/netdata/custom-plugins.d/ won’t do.

There is an issue - Location for custom python modules. It is closed (not implemented), but we could revisit it.