<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>knife status — chef-client Man Pages</title> <link rel="stylesheet" href="_static/guide.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> </head> <body> <div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> <a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> </div> <div class="document"> <div class="documentwrapper"> <div class="body"> <div class="section" id="knife-status"> <h1>knife status<a class="headerlink" href="#knife-status" title="Permalink to this headline">¶</a></h1> <p>The <strong>knife status</strong> subcommand is used to display a brief summary of the nodes on a Chef server, including the time of the most recent successful chef-client run.</p> <div class="section" id="syntax"> <h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> <p>This subcommand has the following syntax:</p> <div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status <span class="o">(</span>options<span class="o">)</span> </pre></div> </div> </div> <div class="section" id="options"> <h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> </div> <p>This subcommand has the following options:</p> <dl class="docutils"> <dt><tt class="docutils literal"><span class="pre">QUERY</span></tt></dt> <dd>The search query used to identify a a list of items on a Chef server. This option uses the same syntax as the <tt class="docutils literal"><span class="pre">search</span></tt> sub-command.</dd> <dt><tt class="docutils literal"><span class="pre">-H</span></tt>, <tt class="docutils literal"><span class="pre">--hide-healthy</span></tt></dt> <dd>Use to hide nodes on which a chef-client run has occurred within the previous hour.</dd> <dt><tt class="docutils literal"><span class="pre">-r</span> <span class="pre">RUN_LIST</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span> <span class="pre">RUN_LIST</span></tt></dt> <dd>A comma-separated list of roles and/or recipes to be applied.</dd> <dt><tt class="docutils literal"><span class="pre">-s</span></tt>, <tt class="docutils literal"><span class="pre">--sort-reverse</span></tt></dt> <dd>Use to sort a list by last run time, descending.</dd> </dl> </div> <div class="section" id="examples"> <h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> <p>The following examples show how to use this Knife subcommand:</p> <p><strong>View status, include run-lists</strong></p> <p>To include run lists in the status, enter:</p> <div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status --run-list </pre></div> </div> <p>to return something like:</p> <div class="highlight-bash"><div class="highlight"><pre>20 hours ago, dev-vm.chisamore.com, ubuntu 10.04, dev-vm.chisamore.com, 10.66.44.126, role<span class="o">[</span>lb<span class="o">]</span>. 3 hours ago, i-225f954f, ubuntu 10.04, ec2-67-202-63-102.compute-1.amazonaws.com, 67.202.63.102, role<span class="o">[</span>web<span class="o">]</span>. 3 hours ago, i-a45298c9, ubuntu 10.04, ec2-174-129-127-206.compute-1.amazonaws.com, 174.129.127.206, role<span class="o">[</span>web<span class="o">]</span>. 3 hours ago, i-5272a43f, ubuntu 10.04, ec2-184-73-9-250.compute-1.amazonaws.com, 184.73.9.250, role<span class="o">[</span>web<span class="o">]</span>. 3 hours ago, i-226ca64f, ubuntu 10.04, ec2-75-101-240-230.compute-1.amazonaws.com, 75.101.240.230, role<span class="o">[</span>web<span class="o">]</span>. 3 hours ago, i-f65c969b, ubuntu 10.04, ec2-184-73-60-141.compute-1.amazonaws.com, 184.73.60.141, role<span class="o">[</span>web<span class="o">]</span>. </pre></div> </div> <p><strong>View status using a date range</strong></p> <p>To show the status for nodes on which the chef-client did not run successfully within the past hour, enter:</p> <div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status --hide-healthy </pre></div> </div> <p>to return something like:</p> <div class="highlight-bash"><div class="highlight"><pre>1 hour ago, i-256f884f, ubuntu 12.04, ec2-67-202-63-102.compute-1.amazonaws.com, 67.202.63.102, role<span class="o">[</span>web<span class="o">]</span>. 1 hour ago, i-a47823c9, ubuntu 10.04, ec2-174-129-127-206.compute-1.amazonaws.com, 184.129.143.111, role<span class="o">[</span>lb<span class="o">]</span>. </pre></div> </div> <p><strong>View status using a query</strong></p> <p>To show the status of a subset of nodes that are returned by a specific query, enter:</p> <div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status <span class="s2">"role:web"</span> --run-list </pre></div> </div> <p>to return something like:</p> <div class="highlight-bash"><div class="highlight"><pre>3 hours ago, i-225f954f, ubuntu 10.04, ec2-67-202-63-102.compute-1.amazonaws.com, 67.202.63.102, role<span class="o">[</span>web<span class="o">]</span>. 3 hours ago, i-a45298c9, ubuntu 10.04, ec2-174-129-127-206.compute-1.amazonaws.com, 174.129.127.206, role<span class="o">[</span>web<span class="o">]</span>. 3 hours ago, i-5272a43f, ubuntu 10.04, ec2-184-73-9-250.compute-1.amazonaws.com, 184.73.9.250, role<span class="o">[</span>web<span class="o">]</span>. 3 hours ago, i-226ca64f, ubuntu 10.04, ec2-75-101-240-230.compute-1.amazonaws.com, 75.101.240.230, role<span class="o">[</span>web<span class="o">]</span>. 3 hours ago, i-f65c969b, ubuntu 10.04, ec2-184-73-60-141.compute-1.amazonaws.com, 184.73.60.141, role<span class="o">[</span>web<span class="o">]</span>. </pre></div> </div> <p><strong>View status for all nodes</strong></p> <p>To view the status of all nodes in the organization, enter:</p> <div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife status </pre></div> </div> <p>to return something like:</p> <div class="highlight-bash"><div class="highlight"><pre>20 hours ago, dev-vm.chisamore.com, ubuntu 10.04, dev-vm.chisamore.com, 10.66.44.126 3 hours ago, i-225f954f, ubuntu 10.04, ec2-67-202-63-102.compute-1.amazonaws.com, 67.202.63.102 3 hours ago, i-a45298c9, ubuntu 10.04, ec2-174-129-127-206.compute-1.amazonaws.com, 174.129.127.206 3 hours ago, i-5272a43f, ubuntu 10.04, ec2-184-73-9-250.compute-1.amazonaws.com, 184.73.9.250 3 hours ago, i-226ca64f, ubuntu 10.04, ec2-75-101-240-230.compute-1.amazonaws.com, 75.101.240.230 3 hours ago, i-f65c969b, ubuntu 10.04, ec2-184-73-60-141.compute-1.amazonaws.com, 184.73.60.141 </pre></div> </div> </div> </div> </div> </div> <div class="clearer"></div> </div> </body> </html>