sfree (ce);
} /* void cache_free */
+/* Send out notifications for "missing" values. */
static int uc_send_notification (const char *name)
{
cache_entry_t *ce = NULL;
return (-1);
}
- memset (&ds, '\0', sizeof (ds));
- memset (&vl, '\0', sizeof (vl));
+ memset (&ds, 0, sizeof (ds));
+ memset (&vl, 0, sizeof (vl));
+
sstrncpy (vl.host, host, sizeof (vl.host));
sstrncpy (vl.plugin, plugin, sizeof (vl.plugin));
if (plugin_instance != NULL)
if (type_instance != NULL)
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
-
/* Copy the associative members */
notification_init (&n, NOTIF_FAILURE, /* host = */ NULL,
host, plugin, plugin_instance, type, type_instance);
return (-1);
}
- /* Check if the entry has been updated in the meantime */
+ /* Check if the entry has been updated since we marked it as "missing" in
+ * uc_check_timeout() */
if ((n.time - ce->last_update) < (2 * ce->interval))
{
ce->state = STATE_OKAY;