Mark Mzyk | February 5, 2013
Show basic info about the node, truncated and nicely formated:
knife node show <node_name>
Show all the information about a node, nicely formated:
knife node show -l <node_name>
Three ways to list node information, in the raw json form (note the -l or –long option is needed to return all node data for knife node show so that all node attribute data is included)
knife node show -l -F json <node_name>
knife node show -l --format=json <node_name>
knife raw /nodes/<node_name>
How to list a single node attribute:
knife node show <node_name> -a <attribute_name>
attribute_name will be something like kernel or platform.
However, this doesn’t work for nested attributes, such as node[kernel][machine], as knife node show doesn’t understand nested attributes.
If you don’t want to use the raw json and grep, you can find a nested attribute by doing a search:
knife search node <query_to_run> -a <main_attribute>.<nested_attribute>
knife search node name:<node_name> -a kernel.machine
Hopefully this is useful information to others. Information on using search to find nested attributes was originally found on this log of the #chef irc channel.
Filed in: Tools.