=head2 Plugin C<dcpmm>
The I<dcpmm plugin> will collect Intel(R) Optane(TM) DC Persistent Memory related performance statistics.
+The plugin requires root privileges to perform the statistics collection.
B<Synopsis:>
<Plugin "dcpmm">
Interval 10.0
- CollectHealth 0
- CollectPerfMetrics 1
- EnableDispatchAll 0
+ CollectHealth false
+ CollectPerfMetrics true
+ EnableDispatchAll false
</Plugin>
=over 4
Sets the I<Interval (in seconds)> in which the values will be collected. Defaults to C<global Interval> value.
This will override the I<global Interval> for I<dcpmm> plugin. None of the other plugins will be affected.
-=item B<CollectHealth> I<0>|I<1>
+=item B<CollectHealth> I<true>|I<false>
-Collects health information. I<CollectHealth and CollectPerfMetrics cannot be 1 at the same time>. Defaults to C<0>.
+Collects health information. I<CollectHealth and CollectPerfMetrics cannot be true at the same time>. Defaults to C<false>.
The health information metrics are the following:
health_status Overall health summary (0: normal | 1: non-critical | 2: critical | 3: fatal).
max_media_temp The media’s the highest temperature reported in degrees Celsius.
max_controller_temp The controller’s highest temperature reported in degrees Celsius.
-=item B<CollectPerfMetrics> I<0>|I<1>
+=item B<CollectPerfMetrics> I<true>|I<false>
-Collects memory performance metrics. I<CollectHealth and CollectPerfMetrics cannot be 1 at the same time>. Defaults to C<1>.
+Collects memory performance metrics. I<CollectHealth and CollectPerfMetrics cannot be true at the same time>. Defaults to C<true>.
The memory performance metrics are the following:
total_bytes_read Number of bytes transacted by the read operations.
read_hit_ratio Measures the efficiency of the buffer in the read path. Range of 0.0 - 0.75.
write_hit_ratio Measures the efficiency of the buffer in the write path. Range of 0.0 - 1.0.
-=item B<EnableDispatchAll> I<0>
+=item B<EnableDispatchAll> I<false>
This parameter helps to seamlessly enable simultaneous health and memory perf metrics collection in future.
-This is unused at the moment and I<must> always be I<0>.
+This is unused at the moment and I<must> always be I<false>.
=back
#include "pmw_api.h"
#define PLUGIN_NAME "dcpmm"
+#define PRINT_BOOL(s) (s ? "true" : "false")
int num_nvdimms;
-int enable_dispatch_all = 0;
+bool enable_dispatch_all = false;
cdtime_t interval = 0;
PMWATCH_OP_BUF pmw_output_buf;
PMWATCH_CONFIG_NODE pmwatch_config;
ret = PMWAPIGetDIMMCount(&num_nvdimms);
if (ret != 0) {
- ERROR(PLUGIN_NAME ": Failed to obtain count of Intel(R) Optane DCPMM.");
+ ERROR(PLUGIN_NAME ": Failed to obtain count of Intel(R) Optane DCPMM."
+ "A common cause for this is collectd running without"
+ "root privileges. Ensure that collectd is running with"
+ "root privileges.");
+
return ret;
}
ret = PMWAPIStart(pmwatch_config);
if (ret != 0) {
- ERROR(PLUGIN_NAME ": Failed to start the collection.");
+ ERROR(PLUGIN_NAME ": Failed to start the collection."
+ "A common cause for this is collectd running without"
+ "root privileges. Ensure that collectd is running with"
+ "root privileges.");
return ret;
}
}
} else if (strncasecmp("CollectHealth", child->key,
strlen("CollectHealth")) == 0) {
- ret = cf_util_get_int(child, &pmwatch_config.collect_health);
+ ret = cf_util_get_boolean(child, &pmwatch_config.collect_health);
+
} else if (strncasecmp("CollectPerfMetrics", child->key,
strlen("CollectPerfMetrics")) == 0) {
- ret = cf_util_get_int(child, &pmwatch_config.collect_perf_metrics);
+ ret = cf_util_get_boolean(child, &pmwatch_config.collect_perf_metrics);
} else if (strncasecmp("EnableDispatchAll", child->key,
strlen("EnableDispatchAll")) == 0) {
- ret = cf_util_get_int(child, &enable_dispatch_all);
+ ret = cf_util_get_boolean(child, &enable_dispatch_all);
} else {
ERROR(PLUGIN_NAME ": Unkown configuration parameter %s.", child->key);
ret = 1;
}
}
- DEBUG("%s Config: Interval %.2f ; CollectHealth %d ; CollectdPerfMetrics %d "
- "; EnableDispatchAll %d",
- PLUGIN_NAME, pmwatch_config.interval, pmwatch_config.collect_health,
- pmwatch_config.collect_perf_metrics, enable_dispatch_all);
+ DEBUG("%s Config: Interval %.2f ; CollectHealth %s ; CollectdPerfMetrics %s "
+ "; EnableDispatchAll %s",
+ PLUGIN_NAME, pmwatch_config.interval,
+ PRINT_BOOL(pmwatch_config.collect_health),
+ PRINT_BOOL(pmwatch_config.collect_perf_metrics),
+ PRINT_BOOL(enable_dispatch_all));
+
+ if (!pmwatch_config.collect_health && !pmwatch_config.collect_perf_metrics) {
+ ERROR(PLUGIN_NAME ": CollectdHealth and CollectPerfMetrics are disabled. "
+ "Enable atleast one.");
+ return 1;
+ }
plugin_register_complex_read(NULL, PLUGIN_NAME, dcpmm_read, interval, NULL);