Puppet 4 Integration
Puppet is IT automation software that enables system administrators to manage provisioning and configuration of their infrastructure. We know that in addition to maintaining correct infrastructure configuration, system administrators additionally rely on monitoring to help prevent outages. Our Puppet module was created with this in mind, and allows your Puppet infrastructure code to manage your LogicMonitor account as well. This enables you to confirm that correct device properties are maintained, that devices are monitored by the correct Collector, that they remain in the right device groups and much more.
Notes:
- This module is compatible with Puppet versions 3 and 4, and is a different (newer) version of our original module
- This module is only compatible with linux servers. Windows compatibility may be added in future releases.
- This module requires PuppetDB
Module Overview
LogicMonitor’s Puppet module defines 5 classes and 4 custom resource types:
Classes
- logicmonitor: Handles setting the credentials needed to interact with the LogicMonitor API
- logicmonitor::master: Collects the exported lm_device resources and lm_devicegroup resources. Communicates with the LogicMonitor API
- logicmonitor::collector: Handles LogicMonitor collector management for the device. Declares an instances of lm_collector and lm_installer resources
- logicmonitor::device: Declares an exported lm_device resource
- logicmonitor::device_group: Declares an exported lm_device_group resource
Resource Types
- lm_device_group: Defines the behavior of the handling of LogicMonitor device groups. We recommend using exported resources
- lm_device: Defines the handling behavior of LogicMonitor devices. Used only within the logicmonitor::device class
- lm_collector: Defines the handling behavior of LogicMonitor collectors. Used only with the logicmonitor::collector class
- lm_installer: Defines the handling behavior of LogicMonitor collector binary installers. Used only within the logicmonitor::collector class
Requirements
In order to use LogicMonitor’s Puppet Module, you’ll need to make sure you have the following:
- Ruby 1.8.7 or 1.9.3
- Puppet 3.X or Puppet 4.x
- JSON Ruby gem (included by default in Ruby 1.9.3)
- Store Configs in Puppet
Store configs are required for the exported resources used by this module. To enable store configs, add storeconfigs = true to the [master] section of your puppet.conf file, like so:
Once enabled, PuppetDB is needed to store the config info.
5. Device Configuration
As with your other LogicMonitor devices, the collector will need to communicate with the device in order to gather data. Make sure the correct properties and authentication protocols are configured as part of the Puppet installation.
Installing the LogicMonitor Puppet Module
You can install LogicMonitor’s Puppet Module one of two ways:
- using Puppet’s Module Tool
- using GitHub
Using Puppet’s Module Tool
Run the following command on your Puppet Master to download and install the most recent version of the LogicMonitor Puppet Module published on Puppet Forge:
Using GitHub
Getting Started
Once you’ve installed LogicMonitor’s Puppet Module, you can get started using the following sections:
Create a new user for Puppet
We recommend you create a new user with administrator privileges in your Logic Monitor account that you will use exclusively within your Puppet nodes to track changes made by Puppet in the audit log. You will need to provision this user API Tokens.
Configuration
- Class: logicmonitor (modules/logicmonitor/manifests/init.pp)
This is the top level class for the LogicMonitor module; it only needs to be defined on the Puppet Master. It’s purpose is to set the LogicMonitor credentials to be used by all the child classes.
- Class: logicmonitor::master (modules/logicmonitor/manifests/master.pp)
The master class enables communication between the LogicMonitor module and your LogicMonitor account for group and device management. This class acts as the collector for the lm_device and lm_devicegroup exported resources. This prevents conflicts and provides a single point of contact for communicating with the LogicMonitor API. This class must be explicitly declared on a single device. NOTE: All devices with the logicmonitor::collector and logicmonitor::master classes will need to be able to make outgoing https requests.
Parameters: none
- Class: logicmonitor::collector (modules/logicmonitor/manifests/collector.pp)
This class manages the creation, download and installation of a LogicMonitor collector on the specified node.
- The only absolute requirement for a collector node is that it is Linux and can make an outgoing SSL connection over port 443
- We suggest the collector system have at least 1G of RAM
- If the collector will be collecting data for more than 100 devices, it is a good idea to dedicate a machine to it
- Class: logicmonitor::device (modules/logicmonitor/manifests/device.pp)
This class is used to add devices to your LogicMonitor account. Devices which are managed through Puppet will have any properties not specified in the device definition removed.
Adding a Device Group:
Type: lm_device_group Device groups should be added using an exported resource to prevent conflicts. It is recommend device groups are added from the same node where the logicmonitor::master class is included. Devices can be included in zero, one, or many device groups. Device groups are used to organize how your LogicMonitor Devices are displayed and managed and do not require a collector . Properties set at the device group level will be inherited by any devices added to the group.
Examples
To add collector to a node:
If you want to specify a specific location where you’d like to install a collector:
To add and edit properties of device groups use lm_devicegroup, example below.
For more examples of the module in action, check out logicmonitor-puppet-v4/README.md.