Book Image

Chef Infrastructure Automation Cookbook Second Edition

By : Matthias Marschall
Book Image

Chef Infrastructure Automation Cookbook Second Edition

By: Matthias Marschall

Overview of this book

Table of Contents (14 chapters)
Chef Infrastructure Automation Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up SNMP for external monitoring services


Simple Network Management Protocol (SNMP) is the standard way to monitor all your network devices. You can use Chef to install the SNMP service on your node and configure it to match your needs.

Getting ready

Make sure that you have a cookbook named my_cookbook and that the run_list of your node includes my_cookbook, as described in the Creating and using cookbooks, section in Chapter 1, Chef Infrastructure.

Create your Berksfile in your Chef repository including my_cookbook:

mma@laptop:~/chef-repo $ subl Berksfile
cookbook 'my_cookbook', path: './cookbooks/my_cookbook'

How to do it...

Let's change some attributes and install SNMP on our node:

  1. Add the dependency on the snmp cookbook to your cookbook's metadata.rb:

    mma@laptop:~/chef-repo $ subl cookbooks/my_cookbook/metadata.rb
    
    depends "snmp"
  2. Install the dependent cookbooks:

    mma@laptop:~/chef-repo $ berks install
    
    ...TRUNCATED OUTPUT...
    Installing snmp (3.0.1)
    Using my_cookbook (0.1.0) at './cookbooks...