# Node Information

**URL:** <https://discourse.chef.io/t/node-information/10338>\
**Category:** Chef Automate\
**Created:** [February 1, 2017, 7:41pm UTC](https://discourse.chef.io/t/node-information/10338 "2017-02-01T19:41:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prash](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@prash](https://discourse.chef.io/u/prash)\
**Post date:** [February 1, 2017, 7:41pm UTC](https://discourse.chef.io/t/node-information/10338/1 "2017-02-01T19:41:27Z")

</div>

Greetings Professional,

I have registered over 100 Nodes (both linux& windows) to chef automate server , but now i need to know the information of os-version, platform and packages installed on each and every particular node in a csv file format . i know that there is a command called ohai but it gives more information which i required can any one suggest me a cookbook or a recipe to retrieve all the node information …

Thanks  
Prash

---

<div class="post-metadata">

**Author:** ![svucich](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/svucich/32/1717_2.png) [@svucich](https://discourse.chef.io/u/svucich)\
**Post date:** [February 1, 2017, 9:51pm UTC](https://discourse.chef.io/t/node-information/10338/2 "2017-02-01T21:51:09Z")

</div>

I would use the RUBY CSV output in combination with the Ohai Properties. This could be done a few ways, but declaring the platform agnostic properties first may be the best way, separating the Windows vs Linux properties within the if/elsif statements to allow the cookbook to be truly agnostic.

```
# Define operating platform from the ohai values
op_sys = node['os']

if op_sys == 'windows'
# Define platform specific data 
hostname = node['hostname']
ip = node["ip_address"]

# Now the csv part, and filling the data
    require "csv"
    CSV.open("file.csv", "wb") do |csv|
      csv << ["hostname", "operatingsystem", "IP"]
      csv << ["#{hostname}", "#{op_sys}", "#{ip}"]
    end

elsif op_sys == 'linux'
# Define platform specific data 
    CSV.open("file.csv", "wb") do |csv|
            # some more code/logic for linux
    end
end

```

[Here](https://docs.chef.io/ohai.html) are some basic details about the ohai properties

\*\*\* I DID NOT TEST THIS, SO YOU MAY NEED TO FINE TUNE\*\*\*
