Name Last Update
files Loading commit data...
lib/puppet Loading commit data...
manifests Loading commit data...
spec Loading commit data...
templates Loading commit data...
.project Loading commit data...
README.markdown Loading commit data...
Rakefile Loading commit data...
metadata.json Loading commit data...

snmp

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup
  4. Usage 4.1 Parameters
  5. Reference
  6. Limitations
  7. Development

Overview

Module to configure snmpd server on RedHat 5/6/7, CentOS 5/6/7, Suse 11,12

Module Description

This module allows administrator to configure a basic snmpd server with:

  • a Read Only community
  • a Read Write community
  • Filter Read Only source
  • Filter Read Write source
  • Filter Read Only view
  • Filter Read Write view
  • Enable/Disable connection log
  • Configure observium's distro script
  • Enable/Disable RO and RW access
  • Define System location
  • Define System administrator

Setup

puppet module vacosta-simple_snmp

Usage

node node.example.com {
        class { 'simple_snmp':
                ro_community => "SecureString",
                ro_source => "192.168.1.0/24",
                rw_community => "VerySecureString",
                rw_source => "192.168.1.2/32",
                rw_enable => true,
                enable_observium_distro => true,
                contact_name => "Victor Acosta",
                contact_mail => "support@example.com"
        }
}
node node.example.com {
        class { 'simple_snmp':
                ro_community => "SecureString",
                ro_source => "192.168.1.0/24",
                rw_enable => false
        }
}

Parameters

log_connection: Enable or disable connection logs

Default: true

ro_community: Read Only community

Default: "SecureString"

rw_community: Read Write community

Default: "VerySecureString"

ro_source: Read Only source

Default: "0.0.0.0/0"

rw_source: Read Write source

Default: "127.0.0.1/32"

ro_view: Read Only view

Default: ".1"

rw_view: Read Write view

Default: ".1"

rw_enable: Enable or Disable Read Write access

Default: false

ro_enable: Enable or Disable Read Only access

Default: true

syslocation: System location

Default: "A beautiful DataCenter"

contact_name: Administrator name

Default: "sysadmin"

contact_mail: Administrator mail

Default: "sysadmin@example.com"

enable_observium_distro: Enable or disable observium's distro script

Default: false

simple_snmp_enable: Enable or disable this module, if false, this module will do nothing

Default: true

Reference

With this definition

node node.example.com {
        class { 'simple_snmp':
                ro_community => "SecureString",
                ro_source => "192.168.1.0/24",
                rw_community => "VerySecureString",
                rw_source => "192.168.1.2/32",
                rw_enable => true,
                enable_observium_distro => true,
                contact_name => "Victor Acosta",
                contact_mail => "support@example.com"
        }
}

The module will configure the /etc/snmp/snmpd.conf as follow:

syslocation A beautiful DataCenter
syscontact Victor Acosta <support@example.com>
rwcommunity VerySecureString 192.168.1.2/32 .1
rocommunity SecureString 192.168.1.0/24 .1
dontLogTCPWrappersConnects true
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/local/bin/distro

Also copies the distro script to the server (only if enable_observium_distro => true), then start and enables the snmpd service

Limitations

Puppet > 4.0 RHEL 5/6/7 CentOS 5/6/7 Suse 11/12

Development

What's next:

  • More than one ro_community and rw_community