Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine when chef last converged on a node?

Tags:

chef-infra

I am using Chef 11.12.4. For a given node, I would like to know when it last converged. I found a blog post about finding ohai_time, but it's not clear to me that it's necessarily the same value as last converge time.

The reason I want to know this is because I uploaded a new cookbook version, but I'm not seeing the change taking affect on my nodes. I want to know if converge is not running, or if converge has run, but my cookbook contained an error.

It would also be nice to know what the status of the last converge was.

I'm hoping for something like this:

$ knife node converge-status my-node-name
my-node-name successfully converged at 1:23:45 UTC.

Does this exist?

like image 619
Nick Heiner Avatar asked Oct 29 '25 15:10

Nick Heiner


2 Answers

You can use the knife status command which follows with a search query to know what nodes to return the status for: knife status 'role:xyz'

like image 166
Nowell Avatar answered Oct 31 '25 12:10

Nowell


If you have the hostname with you, you can also check like below

knife status 'hostname:<yourHostName>'
like image 32
maverick Avatar answered Oct 31 '25 12:10

maverick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!