author | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 12 Jan 2016 08:03:09 +0000 (09:03 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 12 Jan 2016 08:03:09 +0000 (09:03 +0100) |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index 729aa032d0caa2bd4df5711acd2b4af0b50a4839..689677c96236a665598f4306e9d03d18bf72123a 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
#<Plugin iptables>
# Chain table chain
+# Chain6 table chain
#</Plugin>
#<Plugin irq>
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index ba700a98ab3e62ce004022e0918e01ae1f10c89c..42ade4ee7fe6c50f60ca8876c02473a780a1d7e6 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
=item B<Chain> I<Table> I<Chain> [I<Comment|Number> [I<Name>]]
-Select the rules to count. If only I<Table> and I<Chain> are given, this plugin
-will collect the counters of all rules which have a comment-match. The comment
-is then used as type-instance.
+=item B<Chain6> I<Table> I<Chain> [I<Comment|Number> [I<Name>]]
+
+Select the iptables/ip6tables filter rules to count packets and bytes from.
+
+If only I<Table> and I<Chain> are given, this plugin will collect the counters
+of all rules which have a comment-match. The comment is then used as
+type-instance.
If I<Comment> or I<Number> is given, only the rule with the matching comment or
the I<n>th rule will be collected. Again, the comment (or the number) will be
diff --git a/src/curl_json.c b/src/curl_json.c
index 98ba0bb2ed9db58462fe465a6f8dbe902c17e6ae..448db15eed78d91f34028b39d6577ea3048b914e 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
return (len);
#endif
- if (status != yajl_status_ok)
- {
- unsigned char *msg =
- yajl_get_error(db->yajl, /* verbose = */ 1,
- /* jsonText = */ (unsigned char *) buf, (unsigned int) len);
- ERROR ("curl_json plugin: yajl_parse failed: %s", msg);
- yajl_free_error(db->yajl, msg);
- return (0); /* abort write callback */
- }
-
- return (len);
+ unsigned char *msg = yajl_get_error(db->yajl, /* verbose = */ 1,
+ /* jsonText = */ (unsigned char *) buf, (unsigned int) len);
+ ERROR ("curl_json plugin: yajl_parse failed: %s", msg);
+ yajl_free_error(db->yajl, msg);
+ return (0); /* abort write callback */
} /* }}} size_t cj_curl_callback */
static int cj_get_type (cj_key_t *key)
diff --git a/src/email.c b/src/email.c
index f5dcf7090fa37f53737aa7bd559aecf98fdf65e7..6a0c0a45718e7b167a5e179f028b40a6eb1cce06 100644 (file)
--- a/src/email.c
+++ b/src/email.c
}
connection = malloc (sizeof (*connection));
- if (connection != NULL)
+ if (connection == NULL)
{
close (remote);
continue;
index a3b8fdfa0cfa63cd45cddfa70bc633573a541321..420471df577eb28aece3cc3770fca73ffce2faec 100644 (file)
return (0);
close (srv->fd);
+ srv->fd = -1;
free (srv->sa);
srv->sa = NULL;
srv->sa_len = 0;
next = srv->next;
- if (srv->fd >= 0)
- {
- close (srv->fd);
- srv->fd = -1;
- }
-
free (srv->node);
free (srv->service);
free (srv->username);
diff --git a/src/netapp.c b/src/netapp.c
index f446d597de1f27610b0be1c7e2cfde8957509a79..f761e290dfb509432f24fa6a2b5f6e517c2e5963 100644 (file)
--- a/src/netapp.c
+++ b/src/netapp.c
{
notification_t n;
- memset (&n, 0, sizeof (&n));
+ memset (&n, 0, sizeof (n));
n.time = cdtime ();
sstrncpy (n.host, hostname, sizeof (n.host));
sstrncpy (n.plugin, "netapp", sizeof (n.plugin));
diff --git a/src/openvpn.c b/src/openvpn.c
index 663a82d8fd9221fd6b138361efb03b340dc3666f..93c8f1b58363fbf8f7a27f4f03a5b4077f74fee8 100644 (file)
--- a/src/openvpn.c
+++ b/src/openvpn.c
/* create a new vpn element since file, version and name are ok */
temp = (vpn_status_t *) malloc (sizeof (vpn_status_t));
+ if (temp == NULL)
+ {
+ char errbuf[1024];
+ ERROR ("openvpn plugin: malloc failed: %s",
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+ sfree (status_file);
+ return (1);
+ }
temp->file = status_file;
temp->version = status_version;
temp->name = status_name;
if (vpn_list == NULL)
{
char errbuf[1024];
- ERROR ("openvpn plugin: malloc failed: %s",
+ ERROR ("openvpn plugin: realloc failed: %s",
sstrerror (errno, errbuf, sizeof (errbuf)));
sfree (temp->file);
diff --git a/src/perl.c b/src/perl.c
index 0a166a1ba184754782e6fd57de370e3eb57247ca..3b498f9b7ea348caf5048bc27932ccf3e0deb714 100644 (file)
--- a/src/perl.c
+++ b/src/perl.c
/* the ithread no longer exists */
if (NULL == t)
+ {
+ pthread_mutex_unlock (&perl_threads->mutex);
return;
+ }
c_ithread_destroy (ithread);
diff --git a/src/snmp.c b/src/snmp.c
index cf7d975e4b858663f04f0f847e4c7dd7778d1f3f..ae41d03ae8562781a5ba0f7ec1ff155666f63795 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
@@ -1379,7 +1379,7 @@ static int csnmp_dispatch_table (host_definition_t *host, data_definition_t *dat
static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
{
struct snmp_pdu *req;
- struct snmp_pdu *res;
+ struct snmp_pdu *res = NULL;
struct variable_list *vb;
const data_set_t *ds;