- vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
- sstrncpy (vl.plugin, "smart", sizeof (vl.plugin));
- sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
- sstrncpy (vl.type, "smart_attribute", sizeof (vl.type));
- sstrncpy (vl.type_instance, a->name, sizeof (vl.type_instance));
-
- plugin_dispatch_values (&vl);
-
- if (a->threshold_valid && a->current_value <= a->threshold)
- {
- notification_t notif = { NOTIF_WARNING,
- cdtime (),
- "",
- "",
- "smart", "",
- "smart_attribute",
- "",
- NULL };
- sstrncpy (notif.host, hostname_g, sizeof (notif.host));
- sstrncpy (notif.plugin_instance, dev, sizeof (notif.plugin_instance));
- sstrncpy (notif.type_instance, a->name, sizeof (notif.type_instance));
- ssnprintf (notif.message, sizeof (notif.message),
- "attribute %s is below allowed threshold (%d < %d)",
- a->name, a->current_value, a->threshold);
- plugin_dispatch_notification (¬if);
+ vl.values_len = STATIC_ARRAY_SIZE(values);
+ sstrncpy(vl.plugin, "smart", sizeof(vl.plugin));
+ sstrncpy(vl.plugin_instance, name, sizeof(vl.plugin_instance));
+ sstrncpy(vl.type, "smart_attribute", sizeof(vl.type));
+ sstrncpy(vl.type_instance, a->name, sizeof(vl.type_instance));
+
+ plugin_dispatch_values(&vl);
+
+ if (a->threshold_valid && a->current_value <= a->threshold) {
+ notification_t notif = {NOTIF_WARNING, cdtime(), "", "", "smart", "",
+ "smart_attribute", "", NULL};
+ sstrncpy(notif.host, hostname_g, sizeof(notif.host));
+ sstrncpy(notif.plugin_instance, name, sizeof(notif.plugin_instance));
+ sstrncpy(notif.type_instance, a->name, sizeof(notif.type_instance));
+ ssnprintf(notif.message, sizeof(notif.message),
+ "attribute %s is below allowed threshold (%d < %d)", a->name,
+ a->current_value, a->threshold);
+ plugin_dispatch_notification(¬if);