- char filename[BUFFER_SIZE];
- int status;
-
- /* construct filename */
- status = snprintf (filename, BUFFER_SIZE, filename_format, inst);
- if (status < 1)
- return;
- else if (status >= BUFFER_SIZE)
- return;
-
- rrd_update_file (host, filename, val, ds_def, ds_num);
-}
-
-/*
- * hddtemp_get_name
- *
- * Description:
- * Try to "cook" a bit the drive name as returned
- * by the hddtemp daemon. The intend is to transform disk
- * names into <major>-<minor> when possible.
- */
-static char *hddtemp_get_name (char *drive)
-{
- hddname_t *list;
- char *ret;
-
- for (list = first_hddname; list != NULL; list = list->next)
- if (strcmp (drive, list->name) == 0)
- break;
-
- if (list == NULL)
- {
- DBG ("Don't know %s, keeping name as-is.", drive);
- return (strdup (drive));
- }
-
- if ((ret = (char *) malloc (128 * sizeof (char))) == NULL)
- return (NULL);
-
- if (snprintf (ret, 128, "%i-%i", list->major, list->minor) >= 128)
- {
- free (ret);
- return (NULL);
- }
-
- return (ret);
-}
-
-static void hddtemp_submit (char *inst, double temperature)
-{
- char buf[BUFFER_SIZE];
-
- if (snprintf (buf, BUFFER_SIZE, "%u:%.3f", (unsigned int) curtime, temperature)
- >= BUFFER_SIZE)
- return;
-
- plugin_submit (MODULE_NAME, inst, buf);
-}
-
-static void hddtemp_read (void)
-{
- char buf[BUFFER_SIZE];