The C<redis> plugin connect to a list of redis servers and gather
information about the server state. The C<redis> plugin support multiserver
configuration, each server configuration block is called node and identify
-one redis instance (host and port). If no B<Node> block found, then any
-configuration option is assigned to a virtual node called C<default>. Here
-are a configuration example code:
+one redis instance (host and port). Here is a configuration example code:
<Plugin redis>
<Node example>
Host "localhost"
- Port 6379
+ Port "6379"
Timeout 2000
</Node>
</Plugin>
if (strcasecmp ("Host", option->key) == 0)
status = cf_util_get_string_buffer (option, rn->host, sizeof (rn->host));
else if (strcasecmp ("Port", option->key) == 0)
- status = rn->port = cf_util_get_port_number (option);
+ rn->port = cf_util_get_port_number (option);
else if (strcasecmp ("Timeout", option->key) == 0)
status = cf_util_get_int (option, &rn->timeout);
else
if ( (status = redis_config_node (&rn, option)) == 0 )
status = redis_node_add (&rn);
}
- else if (strcasecmp ("Host", option->key) == 0)
- status = cf_util_get_string_buffer (option, rn.host, sizeof (rn.host));
- else if (strcasecmp ("Port", option->key) == 0)
- status = rn.port = cf_util_get_port_number (option);
- else if (strcasecmp ("Timeout", option->key) == 0)
- status = cf_util_get_int (option, &rn.timeout);
else
{
WARNING ("redis plugin: Option `%s' not allowed in redis"
break;
}
- if ( status == 0 && *rn.name != '\0') {
- status = redis_node_add (&rn);
- }
-
return (status);
} /* }}} */
while (c_avl_iterator_next (iter, (void *) &key, (void *) &rn) == 0)
{
- DEBUG ("redis plugin: querying info from node `%s'.", rn->name);
+ DEBUG ("redis plugin: querying info from node `%s' (%s:%d).", rn->name, rn->host, rn->port);
if ( (rh = credis_connect (rn->host, rn->port, rn->timeout)) == NULL )
{