Package Oracle JRE installed on AWS

Greetings All,

Is there any way to query and get results on which server Oracle JRE is installed via chef . we have like 500+ servers both windows and linux platforms hosted on AWS and these servers got registered to chef , my requirement is to get a report on what all the servers Oracle JRE is installed on using chef.

Please help it is quite urgent.

Thanks
Prash

Hi @prash,

For a quick solution try:
knife search node name:* --attribute languages.java
(this is populated with the following ohai plugin: https://github.com/chef/ohai/blob/master/lib/ohai/plugins/java.rb)

I do not know how you install java on your nodes, but if all nodes are registered to the chef-server you could try searching from the chef-server

knife node show <node_name> --long --attribute languages --format json
knife node show <node_name> --long --attribute packages --format json

If you can find the oracle jre somewhere in these two attributes, then you can do knife search with a specific filter.
If none of the above knife node show commands contain the desired data, then you could do:
knife ssh <node_name> 'java -version' --ssh-user <user> -ssh-password <password> -a ipaddress

for windows you would need to use knife winrm