Controls whether C<DERIVE> and C<COUNTER> metrics are converted to a I<rate>
before sending. Defaults to B<true>.
+=item B<SendNotifications> B<true>|B<false> (Publish only)
+
+Controls whether notifications are sent. Defaults to B<false>.
+
+Notifications are published to an C<event> subtopic for each type instance.
+
+Example:
+
+ collectd/host/interface-eth0/if_octets/event
+
=item B<CleanSession> B<true>|B<false> (Subscribe only)
Controls whether the MQTT "cleans" the session up after the subscriber
#include "plugin.h"
#include "utils/common/common.h"
+
#include "utils/format_json/format_json.h"
#include "utils_complain.h"
char *topic_prefix;
bool store_rates;
bool retain;
+ bool send_notifications;
/* For subscribing */
pthread_t thread;
* Prefix "collectd"
* StoreRates true
* Retain false
+ * SendNotifications false
* QoS 0
* CACert "ca.pem" Enables TLS if set
* CertificateFile "client-cert.pem" optional
cf_util_get_boolean(child, &conf->store_rates);
else if (strcasecmp("Retain", child->key) == 0)
cf_util_get_boolean(child, &conf->retain);
+ else if (strcasecmp("SendNotifications", child->key) == 0)
+ cf_util_get_boolean(child, &conf->send_notifications);
else if (strcasecmp("CACert", child->key) == 0)
cf_util_get_string(child, &conf->cacertificatefile);
else if (strcasecmp("CertificateFile", child->key) == 0)
&(user_data_t){
.data = conf,
});
- plugin_register_notification(cb_name, mqtt_notification,
- &(user_data_t){
- .data = conf,
- });
+
+ if (conf->send_notifications) {
+ plugin_register_notification(cb_name, mqtt_notification,
+ &(user_data_t){
+ .data = conf,
+ });
+ }
+
return 0;
} /* mqtt_config_publisher */