- else if (strcasecmp ("Instance", option->key) == 0)
- status = csnmp_config_add_data_instance (dd, option);
- else if (strcasecmp ("InstancePrefix", option->key) == 0)
- status = csnmp_config_add_data_instance_prefix (dd, option);
- else if (strcasecmp ("Values", option->key) == 0)
- status = csnmp_config_add_data_values (dd, option);
- else if (strcasecmp ("Shift", option->key) == 0)
+ else if (strcasecmp("Plugin", option->key) == 0)
+ status = cf_util_get_string(option, &dd->plugin_name);
+ else if (strcasecmp("Instance", option->key) == 0) {
+ if (dd->is_table) {
+ /* Instance is OID */
+ WARNING("snmp plugin: Option `Instance' is deprecated, please update "
+ "Data \"%s\" block to use option `TypeInstanceOID'.",
+ dd->name);
+ status = csnmp_config_add_data_instance_oid(dd, option,
+ false /* type instance */);
+ } else {
+ /* Instance is a simple string */
+ WARNING("snmp plugin: Option `Instance' is deprecated, please update "
+ "Data \"%s\" block to use option `TypeInstance'.",
+ dd->name);
+ status = cf_util_get_string(option, &dd->type_instance);
+ }
+ } else if (strcasecmp("PluginInstance", option->key) == 0)
+ status = cf_util_get_string(option, &dd->plugin_instance);
+ else if (strcasecmp("TypeInstance", option->key) == 0)
+ status = cf_util_get_string(option, &dd->type_instance);
+ else if (strcasecmp("PluginInstanceOID", option->key) == 0)
+ status = csnmp_config_add_data_instance_oid(dd, option,
+ true /* plugin instance */);
+ else if (strcasecmp("TypeInstanceOID", option->key) == 0)
+ status = csnmp_config_add_data_instance_oid(dd, option,
+ false /* type instance */);
+ else if (strcasecmp("InstancePrefix", option->key) == 0)
+ status = cf_util_get_string(option, &dd->instance_prefix);
+ else if (strcasecmp("HostnameOID", option->key) == 0)
+ status = csnmp_config_add_data_hostname_oid(dd, option);
+ else if (strcasecmp("Values", option->key) == 0)
+ status = csnmp_config_add_data_values(dd, option);
+ else if (strcasecmp("Shift", option->key) == 0)