summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 47d5efe)
raw | patch | inline | side by side (parent: 47d5efe)
author | Andres J. Diaz <ajdiaz@connectical.com> | |
Mon, 9 Aug 2010 08:45:06 +0000 (10:45 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Tue, 10 Aug 2010 08:24:37 +0000 (10:24 +0200) |
- The Port configuration option is a string, not a number. Fix
documentation.
- Fix a bad status assignement in port parser.
- Remove default node. Now node is mandatory to prevent
duplicates in tree.
- Update configuration example too.
documentation.
- Fix a bad status assignement in port parser.
- Remove default node. Now node is mandatory to prevent
duplicates in tree.
- Update configuration example too.
src/collectd.conf.in | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history | |
src/redis.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index 8389e83057096fac28c07bd9fd313da70692df5a..c96edad2fbc0d56fd32a70c6b8c0bd787108495b 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
#<Plugin redis>
# <Node example>
# Host "redis.example.com"
-# Port 6379
-# Database 0
+# Port "6379"
# Timeout 2000
# </Node>
#</Plugin>
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 6aba195835e0575b040b8a0f9adfeaf7f1c5a754..4541870b4ad530e28de01000b8713876cc2d9f91 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
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>
diff --git a/src/redis.c b/src/redis.c
index ec69631d65903136392126cf730f87f7ac3cc8bd..0ccc8ba80209657ceeec1fdc082fd0150a5303e0 100644 (file)
--- a/src/redis.c
+++ b/src/redis.c
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 )
{