A sensor feed that retrieves attributes from Chef server and converts selected attributes to sensors.
To use this feed, you must provide the entity, the name of the node as it is known to Chef, and a collection of attribute
sensors. The attribute sensors must follow the naming convention of starting with the string chef.attribute.
followed by a period-separated path through the Chef attribute hierarchy. For example, an attribute sensor named
chef.attribute.sql_server.instance_name would cause the feed to search for a Chef attribute called
sql_server, and within that an attribute instance_name, and set the sensor to the value of this
attribute.
This feed uses the knife tool to query all the attributes on a named node. It then iterates over the configured
list of attribute sensors, using the sensor name to locate an equivalent Chef attribute. The sensor is then set to the value
of the Chef attribute.
Example:
Override
protected void connectSensors() {
nodeAttributesFeed = ChefAttributeFeed.newFeed(this, nodeName, new AttributeSensor[]{
SqlServerNode.CHEF_ATTRIBUTE_NODE_NAME,
SqlServerNode.CHEF_ATTRIBUTE_SQL_SERVER_INSTANCE_NAME,
SqlServerNode.CHEF_ATTRIBUTE_SQL_SERVER_PORT,
SqlServerNode.CHEF_ATTRIBUTE_SQL_SERVER_SA_PASSWORD
});
}
}