summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 603d00c)
raw | patch | inline | side by side (parent: 603d00c)
author | Ivan Kurnosov <zerkms@zerkms.com> | |
Sat, 23 Sep 2017 05:32:14 +0000 (17:32 +1200) | ||
committer | Ivan Kurnosov <zerkms@zerkms.com> | |
Sat, 23 Sep 2017 05:32:14 +0000 (17:32 +1200) |
lxc/lxd containers at the moment cannot properly report the swap io (the corresponding /proc/vmstat are not virtualized), so added an option to disable that reporting.
Enabled by default.
Closes: #2433
Enabled by default.
Closes: #2433
src/collectd.conf.in | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history | |
src/swap.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index f35f3284a5bf5cb22fbbae5c598957174b5e5e75..4512a8758930a88a422de0f30acc7a2dad278c47 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# ReportBytes true
# ValuesAbsolute true
# ValuesPercentage false
+# ReportIO true
#</Plugin>
#<Plugin table>
# SystemManagementInterrupt true
# DigitalTemperatureSensor true
# PackageThermalManagement true
-# RunningAveragePowerLimit "7"
+# RunningAveragePowerLimit "7"
#</Plugin>
#<Plugin unixsock>
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 63e62efb062f8d3656ebf2d050176d80c816b67f..f13ffcd922c40aa4f2663fb5c89ac0216fdeff12 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
@@ -4329,11 +4329,11 @@ If enabled, the plugin sends a notification if the replication slave I/O and /
or SQL threads are not running. Defaults to B<false>.
=item B<WsrepStats> I<true|false>
-
+
Enable the collection of wsrep plugin statistics, used in Master-Master
replication setups like in MySQL Galera/Percona XtraDB Cluster.
User needs only privileges to execute 'SHOW GLOBAL STATUS'
-
+
=item B<ConnectTimeout> I<Seconds>
Sets the connect timeout for the MySQL client.
grouped by version and whether the system runs as server or client.
It is possibly to omit metrics for a specific NFS version by setting one or
-more of the following options to B<false> (all of them default to B<true>).
+more of the following options to B<false> (all of them default to B<true>).
=over 4
This is useful for deploying I<collectd> in a heterogeneous environment, where
swap sizes differ and you want to specify generic thresholds or similar.
+=item B<ReportIO> B<true>|B<false>
+
+Enables or disables reporting swap IO. Defaults to B<true>.
+
+This is useful for the cases when swap IO is not neccessary, is not available,
+or is not reliable.
+
=back
=head2 Plugin C<syslog>
=item B<BlockDeviceFormat> B<target>|B<source>
If I<BlockDeviceFormat> is set to B<target>, the default, then the device name
-seen by the guest will be used for reporting metrics.
+seen by the guest will be used for reporting metrics.
This corresponds to the C<E<lt>targetE<gt>> node in the XML definition of the
domain.
diff --git a/src/swap.c b/src/swap.c
index a5531c24e86247532ca68323cc1200818e9eebc2..78f05c5f968971ac961c3637935e6aaa7f55108c 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
static _Bool values_absolute = 1;
static _Bool values_percentage = 0;
+static _Bool report_io = 1;
static int swap_config(oconfig_item_t *ci) /* {{{ */
{
cf_util_get_boolean(child, &values_absolute);
else if (strcasecmp("ValuesPercentage", child->key) == 0)
cf_util_get_boolean(child, &values_percentage);
+ else if (strcasecmp("ReportIO", child->key) == 0)
+ cf_util_get_boolean(child, &report_io);
else
WARNING("swap plugin: Unknown config option: \"%s\"", child->key);
}
else
swap_read_combined();
- swap_read_io();
+ if (report_io)
+ swap_read_io();
return 0;
} /* }}} int swap_read */
reserved = (gauge_t)(pmemory.pgsp_rsvd * pagesize);
swap_submit_usage(NULL, total - free, free, "reserved", reserved);
- swap_submit_derive("in", (derive_t)pmemory.pgspins * pagesize);
- swap_submit_derive("out", (derive_t)pmemory.pgspouts * pagesize);
+
+ if (report_io) {
+ swap_submit_derive("in", (derive_t)pmemory.pgspins * pagesize);
+ swap_submit_derive("out", (derive_t)pmemory.pgspouts * pagesize);
+ }
return 0;
} /* }}} int swap_read */