[chef] Re: Know if a node is shutted down (or not).


Chronological Thread 
  • From: Eric Herot < >
  • To:
  • Subject: [chef] Re: Know if a node is shutted down (or not).
  • Date: Tue, 14 May 2013 08:46:10 -0400

Hi Jacobo,

I don't know that there is any way to specifically generate a sort of "state: stopped" attribute since it necessarily relies on ohai running when the server is in that state (which would be paradoxical).  However in our own environment we determine if a node is "running" if it has an ohai_time of (Time.now.to_i - ohai_time) > (chef_run_interval + splay_time + some_fudge_factor).  I.e. if the node hasn't updated ohai in a while, it is assumed to be "off."  Of course this also ropes in nodes where ohai isn't being run for some other reason but usually that still meets our needs.

Hope this helps,

Eric

On May 14, 2013, at 07:44 , Jacobo García wrote:

Hello chefs,

I am interested in learning how to get through chef/ohai the state of a node. This means to know if a node is turned off or on.

Some of my recipes use chef search and since I am using a cloud infrastructure provider is pretty typical that I have nodes turned off but registered in chef. This sometimes does not play nice resulting in configuration of services that include nodes that idealistically should not be included.

Thanks in advance.

Jacobo García López de Araujo




Archive powered by MHonArc 2.6.16.

§