#endif
char *words[MAX_WORDS] = { NULL };
- uint32_t SET_HASH = simple_hash("SET");
uint32_t BEGIN_HASH = simple_hash("BEGIN");
uint32_t END_HASH = simple_hash("END");
uint32_t FLUSH_HASH = simple_hash("FLUSH");
// debug(D_PLUGINSD, "PLUGINSD: words 0='%s' 1='%s' 2='%s' 3='%s' 4='%s' 5='%s' 6='%s' 7='%s' 8='%s' 9='%s'", words[0], words[1], words[2], words[3], words[4], words[5], words[6], words[7], words[8], words[9]);
- hash = simple_hash(s);
-
- if(likely(hash == SET_HASH && !strcmp(s, "SET"))) {
+ if(likely(!simple_hash_strcmp(s, "SET", &hash))) {
char *dimension = words[1];
char *value = words[2];
info("PLUGINSD: '%s' thread exiting", cd->fullfilename);
cd->obsolete = 1;
- cd->thread = (pthread_t)NULL;
pthread_exit(NULL);
return NULL;
}
if(pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) != 0)
error("Cannot set pthread cancel state to ENABLE.");
- char *dir_name = config_get("plugins", "plugins directory", PLUGINS_DIR);
int automatic_run = config_get_boolean("plugins", "enable running new plugins", 1);
int scan_frequency = (int) config_get_number("plugins", "check for new plugins every", 60);
DIR *dir = NULL;
for(;;) {
if(unlikely(netdata_exit)) break;
- dir = opendir(dir_name);
+ dir = opendir(netdata_configured_plugins_dir);
if(unlikely(!dir)) {
- error("Cannot open directory '%s'.", dir_name);
+ error("Cannot open directory '%s'.", netdata_configured_plugins_dir);
goto cleanup;
}
snprintfz(cd->id, CONFIG_MAX_NAME, "plugin:%s", pluginname);
strncpyz(cd->filename, file->d_name, FILENAME_MAX);
- snprintfz(cd->fullfilename, FILENAME_MAX, "%s/%s", dir_name, cd->filename);
+ snprintfz(cd->fullfilename, FILENAME_MAX, "%s/%s", netdata_configured_plugins_dir, cd->filename);
cd->enabled = enabled;
cd->update_every = (int) config_get_number(cd->id, "update every", rrd_update_every);