0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-17 03:02:41 +00:00

Add user plugin dirs to environment ()

Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
This commit is contained in:
Vladimir Kobal 2022-06-24 11:32:18 +02:00 committed by GitHub
parent 7a14c6ae9f
commit 3a96ef03b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions
collectors/plugins.d
daemon

View file

@ -151,6 +151,7 @@ available for the plugin to use.
|`NETDATA_USER_CONFIG_DIR`|The directory where all Netdata-related user configuration should be stored. If the plugin requires custom user configuration, this is the place the user has saved it (normally under `/etc/netdata`).|
|`NETDATA_STOCK_CONFIG_DIR`|The directory where all Netdata -related stock configuration should be stored. If the plugin is shipped with configuration files, this is the place they can be found (normally under `/usr/lib/netdata/conf.d`).|
|`NETDATA_PLUGINS_DIR`|The directory where all Netdata plugins are stored.|
|`NETDATA_USER_PLUGINS_DIRS`|The list of directories where custom plugins are stored.|
|`NETDATA_WEB_DIR`|The directory where the web files of Netdata are saved.|
|`NETDATA_CACHE_DIR`|The directory where the cache files of Netdata are stored. Use this directory if the plugin requires a place to store data. A new directory should be created for the plugin for this purpose, inside this directory.|
|`NETDATA_LOG_DIR`|The directory where the log files are stored. By default the `stderr` output of the plugin will be saved in the `error.log` file of Netdata.|

View file

@ -847,6 +847,20 @@ void set_global_environment()
setenv("HOME", verify_required_directory(netdata_configured_home_dir), 1);
setenv("NETDATA_HOST_PREFIX", netdata_configured_host_prefix, 1);
{
BUFFER *user_plugins_dirs = buffer_create(FILENAME_MAX);
for (size_t i = 1; i < PLUGINSD_MAX_DIRECTORIES && plugin_directories[i]; i++) {
if (i > 1)
buffer_strcat(user_plugins_dirs, " ");
buffer_strcat(user_plugins_dirs, plugin_directories[i]);
}
setenv("NETDATA_USER_PLUGINS_DIRS", buffer_tostring(user_plugins_dirs), 1);
buffer_free(user_plugins_dirs);
}
analytics_data.data_length = 0;
analytics_set_data(&analytics_data.netdata_config_stream_enabled, "null");
analytics_set_data(&analytics_data.netdata_config_memory_mode, "null");