/chef-ohai-plugins

Plugins to collect information about installed applications and SAP systems.

Primary LanguageRubyApache License 2.0Apache-2.0

chef-ohai-plugins

When using Chef to manage your infrastructure, you may find that you need some detailed information about the current state of machine's applications. You might also find that you'd like to be able to collect and analyse such data; for example, one might want to list all the servers with a specific version of an application.

When you are working with servers that have SAP systems installed, you may want additional information about those systems, like their system IDs.

This repo contains custom ohai plugins to do just that; collect information about installed applications and SAP systems.

Ohai is a tool that is used to collect system configuration data, which is provided to the Chef Infra Client for use within cookbooks. Ohai is run by the Chef Infra Client at the beginning of every Chef run to determine system state.

Chef Infra is a powerful automation platform that transforms infrastructure into code. Whether you’re operating in the cloud, on-premises, or in a hybrid environment, Chef automates how infrastructure is configured, deployed, and managed across your network, no matter its size.

Requirements

These plugins are for use with ohai. Ohai can be installed standalone, however it is more common that you'll use this as a part of the Chef Infra Client.

Download and Installation

We've laid out this repo as a cookbook, so that you can use it to install the plugins. If you'd like to distribute them manually, you'll find the plugins in the root of the /files/ directory.

  1. Simply put the desired ohai plugins in your system's ohai directory
  2. Use the Chef ohai cookbook to install the plugins
  3. Use this cookbook to install the plugins

Available Plugins

sap_sid

Not a BASIS consultant? Do not worry! This custom Ohai plugin will retrieve every hidden detail of an SAP system installation.

Get insight into which support package, kernel release or even database you are running on.

Give it a try, by running >ohai -d ./files/ sap

sap_sid exposes:

  • System ID
  • DB Platform: SAP HANA, IBM DB6, SAP MaxDB, Oracle
  • System type: J2EE, ABAP or Dual Stack
  • Central Instance number
  • Kernel and patch level release along its kernel variant
  • Alias names for the hosted SAP system

installed_applications

Get the applications installed on your system, along with various metadata like versions, install paths, and how the application was detected.

NOTE: Chef 14 includes node['packages'] which provides basic information about the applications and packages. This is designed to give more details.

Configuration

Though ohai plugins are not configurable, we do encourage any contributions to these plugins that might make them more useful, so long as existing functionality is maintained.

Contributions

Contributions are welcomed, and encouraged. Please use the below as a guideline for your input.

  1. Fork the cookbook
  2. Document your planned change
  3. Write your test criteria, and add a suite to the kitchen file if needed.
  4. Write and test your changes
  5. Submit a pull request
  6. Sit back and wait for your awesome code to be merged

Support

If you require support, please reach out or raise an issue.

License

Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache License, Version 2.0 except as noted otherwise in the LICENSE file.