Skip to content

Commit

Permalink
Set default settings for vPoller in the vpoller.so module
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Sep 12, 2014
1 parent dc03ea2 commit 430bdbe
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/zabbix/vpoller-module/vpoller.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int item_timeout = 0;
/* Default vPoller settings */
static unsigned CONFIG_VPOLLER_TIMEOUT = 10000;
static unsigned CONFIG_VPOLLER_RETRIES = 1;
static char *CONFIG_VPOLLER_PROXY = "tcp://localhost:10123";
static char *CONFIG_VPOLLER_PROXY = NULL;

/* ZeroMQ context used for creating sockets that connect to vPoller */
static void *zcontext = NULL;
Expand Down Expand Up @@ -93,6 +93,20 @@ zbx_module_load_config(void)
parse_cfg_file(MODULE_CONFIG_FILE, cfg, ZBX_CFG_FILE_OPTIONAL, ZBX_CFG_STRICT);
}

/*
* Function:
* zbx_module_set_defaults()
*
* Purpose:
* Set default settings for vPoller
*/
void
zbx_module_set_defaults(void)
{
if (CONFIG_VPOLLER_PROXY == NULL)
CONFIG_VPOLLER_PROXY = "tcp://localhost:10123";
}

/*
* Function:
* zbx_module_api_version()
Expand Down Expand Up @@ -295,6 +309,7 @@ int
zbx_module_init(void)
{
zbx_module_load_config();
zbx_module_set_defaults();

zabbix_log(LOG_LEVEL_DEBUG, "Creating ZeroMQ context for vPoller sockets");
zcontext = zmq_ctx_new();
Expand Down

0 comments on commit 430bdbe

Please sign in to comment.