- /**/
- for (char *ptr = cell->value; *ptr != '\0'; ptr++) {
- if ((*ptr > 0) && (*ptr < 32))
- *ptr = ' ';
- else if (*ptr == '/')
- *ptr = '_';
- }
-
- DEBUG("snmp plugin: il->instance = `%s';", cell->value);
- csnmp_cells_append(&instance_cells_head, &instance_cells_tail, cell);
+ csnmp_cell_replace_reserved_chars(cell);
+
+ DEBUG("snmp plugin: il->type_instance = `%s';", cell->value);
+ csnmp_cells_append(&type_instance_cells_head,
+ &type_instance_cells_tail, cell);
+ }
+ } else if (oid_list_todo[i] == OID_TYPE_PLUGININSTANCE) {
+ if ((vb->type == SNMP_ENDOFMIBVIEW) ||
+ (snmp_oid_ncompare(data->plugin_instance.oid.oid,
+ data->plugin_instance.oid.oid_len, vb->name,
+ vb->name_length,
+ data->plugin_instance.oid.oid_len) != 0)) {
+ DEBUG("snmp plugin: host = %s; data = %s; TypeInstance left its "
+ "subtree.",
+ host->name, data->name);
+ oid_list_todo[i] = 0;
+ continue;
+ }
+
+ /* Allocate a new `csnmp_cell_char_t', insert the instance name and
+ * add it to the list */
+ csnmp_cell_char_t *cell =
+ csnmp_get_char_cell(vb, &data->plugin_instance.oid, host, data);
+ if (cell == NULL) {
+ ERROR("snmp plugin: host %s: csnmp_get_char_cell() failed.",
+ host->name);
+ status = -1;
+ break;