+ values[0].gauge = value;
+
+ vl.values = values;
+ vl.values_len = 1;
+
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "ipmi", sizeof (vl.plugin));
+ sstrncpy (vl.type, list_item->sensor_type, sizeof (vl.type));
+ sstrncpy (vl.type_instance, list_item->sensor_name, sizeof (vl.type_instance));
+
+ plugin_dispatch_values (&vl);
+} /* void sensor_read_handler */
+
+static int sensor_list_add (ipmi_sensor_t *sensor)
+{
+ ipmi_sensor_id_t sensor_id;
+ c_ipmi_sensor_list_t *list_item;
+ c_ipmi_sensor_list_t *list_prev;
+
+ char buffer[DATA_MAX_NAME_LEN];
+ const char *entity_id_string;
+ char sensor_name[DATA_MAX_NAME_LEN];
+ char *sensor_name_ptr;
+ int sensor_type;
+ const char *type;
+ ipmi_entity_t *ent = ipmi_sensor_get_entity(sensor);
+
+ sensor_id = ipmi_sensor_convert_to_id (sensor);
+
+ memset (buffer, 0, sizeof (buffer));
+ ipmi_sensor_get_name (sensor, buffer, sizeof (buffer));
+ buffer[sizeof (buffer) - 1] = 0;
+
+ entity_id_string = ipmi_entity_get_entity_id_string (ent);
+
+ if (entity_id_string == NULL)
+ sstrncpy (sensor_name, buffer, sizeof (sensor_name));
+ else
+ ssnprintf (sensor_name, sizeof (sensor_name),
+ "%s %s", buffer, entity_id_string);
+
+ sstrncpy (buffer, sensor_name, sizeof (buffer));
+ sensor_name_ptr = strstr (buffer, ").");
+ if (sensor_name_ptr != NULL)
+ {
+ /* If name is something like "foo (123).bar",
+ * change that to "bar (123)".
+ * Both, sensor_name_ptr and sensor_id_ptr point to memory within the
+ * `buffer' array, which holds a copy of the current `sensor_name'. */
+ char *sensor_id_ptr;
+
+ /* `sensor_name_ptr' points to ").bar". */
+ sensor_name_ptr[1] = 0;
+ /* `buffer' holds "foo (123)\0bar\0". */
+ sensor_name_ptr += 2;
+ /* `sensor_name_ptr' now points to "bar". */
+
+ sensor_id_ptr = strstr (buffer, "(");
+ if (sensor_id_ptr != NULL)
+ {
+ /* `sensor_id_ptr' now points to "(123)". */
+ ssnprintf (sensor_name, sizeof (sensor_name),
+ "%s %s", sensor_name_ptr, sensor_id_ptr);
+ }
+ /* else: don't touch sensor_name. */
+ }
+ sensor_name_ptr = sensor_name;
+
+ /* Both `ignorelist' and `plugin_instance' may be NULL. */
+ if (ignorelist_match (ignorelist, sensor_name_ptr) != 0)
+ return (0);
+