Use

$ ohai

on the client to see the state.

OR use the chef server web interface.

knife search node key:pattern -a attribute

 

SHOW

====

$ knife node show -a apache

cc:
apache:
package: httpd
sites:
vchefh1h.com:
domain:     vchefh1h.com
port:       80
site_title: VCHEFH1H
vchefh2h.com:
domain:     vchefh2h.com
port:       80
site_title: VCHEFH2H
 
$ knife node show cc -a apache.sites
cc:
apache.sites:
vchefh1h.com:
domain:     vchefh1h.com
port:       80
site_title: VCHEFH1H
vchefh2h.com:
domain:     vchefh2h.com
port:       80
site_title: VCHEFH2H
[hallapa@cw chef-repo]$
 
$ knife node show -a apache.sites.name1:
apache.sites.name1:
domain:     name1.phh.com
port:       80
site_title: node1site

$ knife node show -a apache.sites.name1.domain

apache.sites.name1.domain:     name1.phh.com

$ knife node show cc -a memory

cc:

memory:

active:           873276kB

anon_pages:       910920kB

bounce:           0kB

buffers:          20kB

cached:           586884kB

commit_limit:     2989000kB

committed_as:     4242948kB

dirty:            8kB

free:             104836kB

hugepage_size:    2048kB

hugepages:

free:     0

reserved: 0

surplus:  0

total:    0

inactive:         633960kB

mapped:           125484kB

nfs_unstable:     0kB

page_tables:      31924kB

slab:             81084kB

slab_reclaimable: 37532kB

slab_unreclaim:   43552kB

swap:

cached: 10916kB

free:   1863680kB

total:  2097148kB

total:            1783708kB

vmalloc_chunk:    34359697400kB

vmalloc_total:    34359738367kB

vmalloc_used:     32728kB

writeback:        0kB

$ knife node show cc -a memory.active

cc:

memory.active: 873276kB

$ knife node show cc -a memory.swap
cc:
memory.swap:
cached: 10916kB
free:   1863680kB
total:  2097148kB
SEARCH

======

$ knife search node “os:linux”

1 items found

Node Name:   cc

Environment: _default

FQDN:        cc

IP:          10.32.9.34

Run List:    recipe[secdel], recipe[apache]

Roles:

Recipes:     secdel, secdel::default, apache, apache::default, php::default

Platform:    oracle 7.3

Tags:

$ knife search node “os:linux” -a recipes
1 items found
cc:
recipes:
secdel
secdel::default
apache
apache::default
php::default

$ knife search node “os:linux” -a memory.swap.free

1 items found

cc:

memory.swap.free: 1863680kB

$ knife search node “os:linux” -a “platform:*” -a memory.swap.free
1 items found
cc:
memory.swap.free: 1863680kB
platform:*:
$ knife search node “os:GNU/Linux” -a “kernel.release”
1 items found
cc:
kernel.release: 4.1.12-61.1.22.el7uek.x86_64
$ knife search node “os:GNU*” -a “kernel.release”
1 items found
cc:
kernel.release: 4.1.12-61.1.22.el7uek.x86_64
$ knife search node “kernel_release:4*”
1 items found
Node Name:   cc
Environment: _default
FQDN:        cc
IP:          10.32.9.34
Run List:    recipe[secdel], recipe[apache]
Roles:
Recipes:     secdel, secdel::default, apache, apache::default, php::default
Platform:    oracle 7.3
Tags:
$ knife search node “kernel_release:4*” -a kernel.release
1 items found
cc:
kernel.release: 4.1.12-61.1.22.el7uek.x86_64
$ knife search node “os:G* AND platform:oracle” -a kernel.release
1 items found
cc:
kernel.release: 4.1.12-61.1.22.el7uek.x86_64
$ knife search node “os:G* AND platform:oracle” -a platform_family
1 items found
cc:
platform_family: rhel
e.g.

knife search node “platform:ubuntu” -a memory.swap.free

knife search node “platform:*” -a memory.swap.free

knife search node “kernel_release:3.2*”

knife search node “kernel_release:3.2*” -a kernel.release

knife search node “kernel_release:*” -a kernel.release

 

knife search node “os:linux AND platform:ubuntu” -a kernel

knife search node “os:linux AND platform_family:debian” -a platform

knife search node “os:linux AND platform_family:debian” -a platform.family Searching for a nested value

knife search node “os:linux AND platform_family:debian” -a platform_family