-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 59adf16
Showing
23 changed files
with
376 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name 'ghoneycutt-snmp' | ||
version '1.0.0' | ||
|
||
dependency 'ghoneycutt/lsbprovider', '>= 1.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
snmp | ||
|
||
Released 20100628 - Garrett Honeycutt - GPLv2 | ||
|
||
This is the snmp module for managing snmp clients. The given template | ||
is a good starting point, though you will need to modify the network locations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# This file is being maintained by Puppet. | ||
# DO NOT EDIT | ||
|
||
# 14 Dec 2007 - Garrett Honeycutt - [email protected] | ||
# | ||
# released under GPL | ||
# | ||
# returns number of 'master' processes running | ||
# | ||
# there should be one process if postfix is operating correctly | ||
# | ||
|
||
masterProcsAmount=`/usr/local/bin/check_procs -C master -c 1:1 | /usr/bin/awk '{print $3}'` | ||
echo $masterProcsAmount | ||
exit $masterProcsAmount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# This file is being maintained by Puppet. | ||
# DO NOT EDIT | ||
|
||
# 5 Dec 2007 - Garrett Honeycutt - [email protected] | ||
# | ||
# released under GPL | ||
# | ||
# returns number of stopped/traced processes running | ||
# | ||
# note: the 'sched' process is always in state T, so on Solaris this should | ||
# always return 1 and under linux this should always return 0 | ||
|
||
stoppedProcsAmount=`/usr/local/bin/check_procs -s T | /usr/bin/awk '{print $3}'` | ||
echo $stoppedProcsAmount | ||
exit $stoppedProcsAmount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# This file is being maintained by Puppet. | ||
# DO NOT EDIT | ||
|
||
# returns number of zombie processes running | ||
|
||
zombieProcsAmount=`/usr/local/bin/check_procs -s Z | /usr/bin/awk '{print $3}'` | ||
echo $zombieProcsAmount | ||
exit $zombieProcsAmount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Class: snmp | ||
# | ||
# This module manages snmp and is included by the generic module | ||
# to be applied to *ALL* nodes | ||
# | ||
# Requires: | ||
# class snmp::files | ||
# class lsbprovider::files | ||
# $snmpSyslocation must be set in site manifest, ie "$snmpSyslocation = "CompanyX NOC" | ||
# $contactEmail must be set in site manifest | ||
# | ||
class snmp { | ||
|
||
include snmp::files | ||
|
||
package { "net-snmp": } | ||
|
||
file { "/etc/snmp/snmpd.conf": | ||
content => template("snmp/snmpd.conf.erb"), | ||
notify => Service["snmpd"], | ||
require => [ Class["snmp::files"], Package["net-snmp"] ], | ||
} # file | ||
|
||
service { "snmpd": | ||
enable => true, | ||
ensure => running, | ||
require => Package["net-snmp"], | ||
} # service | ||
} # class snmp | ||
|
||
# | ||
# Grab snmpd helper scripts | ||
# | ||
class snmp::files inherits lsbprovider::files { | ||
|
||
File["/opt/$lsbProvider/bin"] { | ||
source +> ["puppet:///modules/snmp/scripts/","puppet:///modules/snmp/binaries/$platform"], | ||
sourceselect => all, | ||
} | ||
} # class snmp::files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
+-----------------------------------------------------------------------+ | ||
| | | ||
| ==> DO NOT EDIT THIS FILE! <== | | ||
| | | ||
| You should edit the `Modulefile` and run `puppet-module build` | | ||
| to generate the `metadata.json` file for your releases. | | ||
| | | ||
+-----------------------------------------------------------------------+ | ||
*/ | ||
|
||
{} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name 'ghoneycutt-snmp' | ||
version '1.0.0' | ||
|
||
dependency 'ghoneycutt/lsbprovider', '>= 1.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
snmp | ||
|
||
Released 20100628 - Garrett Honeycutt - GPLv2 | ||
|
||
This is the snmp module for managing snmp clients. The given template | ||
is a good starting point, though you will need to modify the network locations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# This file is being maintained by Puppet. | ||
# DO NOT EDIT | ||
|
||
# 14 Dec 2007 - Garrett Honeycutt - [email protected] | ||
# | ||
# released under GPL | ||
# | ||
# returns number of 'master' processes running | ||
# | ||
# there should be one process if postfix is operating correctly | ||
# | ||
|
||
masterProcsAmount=`/usr/local/bin/check_procs -C master -c 1:1 | /usr/bin/awk '{print $3}'` | ||
echo $masterProcsAmount | ||
exit $masterProcsAmount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
# This file is being maintained by Puppet. | ||
# DO NOT EDIT | ||
|
||
# 5 Dec 2007 - Garrett Honeycutt - [email protected] | ||
# | ||
# released under GPL | ||
# | ||
# returns number of stopped/traced processes running | ||
# | ||
# note: the 'sched' process is always in state T, so on Solaris this should | ||
# always return 1 and under linux this should always return 0 | ||
|
||
stoppedProcsAmount=`/usr/local/bin/check_procs -s T | /usr/bin/awk '{print $3}'` | ||
echo $stoppedProcsAmount | ||
exit $stoppedProcsAmount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# This file is being maintained by Puppet. | ||
# DO NOT EDIT | ||
|
||
# returns number of zombie processes running | ||
|
||
zombieProcsAmount=`/usr/local/bin/check_procs -s Z | /usr/bin/awk '{print $3}'` | ||
echo $zombieProcsAmount | ||
exit $zombieProcsAmount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Class: snmp | ||
# | ||
# This module manages snmp and is included by the generic module | ||
# to be applied to *ALL* nodes | ||
# | ||
# Requires: | ||
# class snmp::files | ||
# class lsbprovider::files | ||
# $snmpSyslocation must be set in site manifest, ie "$snmpSyslocation = "CompanyX NOC" | ||
# $contactEmail must be set in site manifest | ||
# | ||
class snmp { | ||
|
||
include snmp::files | ||
|
||
package { "net-snmp": } | ||
|
||
file { "/etc/snmp/snmpd.conf": | ||
content => template("snmp/snmpd.conf.erb"), | ||
notify => Service["snmpd"], | ||
require => [ Class["snmp::files"], Package["net-snmp"] ], | ||
} # file | ||
|
||
service { "snmpd": | ||
enable => true, | ||
ensure => running, | ||
require => Package["net-snmp"], | ||
} # service | ||
} # class snmp | ||
|
||
# | ||
# Grab snmpd helper scripts | ||
# | ||
class snmp::files inherits lsbprovider::files { | ||
|
||
File["/opt/$lsbProvider/bin"] { | ||
source +> ["puppet:///modules/snmp/scripts/","puppet:///modules/snmp/binaries/$platform"], | ||
sourceselect => all, | ||
} | ||
} # class snmp::files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": "1.0.0", | ||
"dependencies": [ | ||
{ | ||
"version_requirement": ">= 1.0.0", | ||
"name": "ghoneycutt/lsbprovider" | ||
} | ||
], | ||
"name": "ghoneycutt-snmp", | ||
"checksums": { | ||
"templates/snmpd.conf.erb": "9dce86b17b9e4de7dfaf04eafeffa40a", | ||
"spec/spec_helper.rb": "ca19ec4f451ebc7fdb035b52eae6e909", | ||
"files/scripts/postfix_procs": "6da078317b0acdad7d72b8eee6b956af", | ||
"README": "f1ca34a4b952c79c97e4dfcab22c645e", | ||
"files/scripts/zombie_procs": "df67d40c7faf6215619298aa39f2c6fa", | ||
"files/scripts/stopped_procs": "41ec6392ee6a75f3f94f583198354e23", | ||
"tests/init.pp": "27ab1c2c08d9d088d84e6927d906c169", | ||
"spec/spec.opts": "a600ded995d948e393fbe2320ba8e51c", | ||
"metadata.json": "d34d0b70aba36510fbc2df4e667479ef", | ||
"Modulefile": "2a54c23fe1b7ce292d26e6a906a9e09e", | ||
"manifests/init.pp": "f7d3c02431cc4b169ae155de36a55a7e" | ||
}, | ||
"types": [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--format | ||
s | ||
--colour | ||
--loadby | ||
mtime | ||
--backtrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'pathname' | ||
dir = Pathname.new(__FILE__).parent | ||
$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib') | ||
|
||
require 'mocha' | ||
require 'puppet' | ||
gem 'rspec', '=1.2.9' | ||
require 'spec/autorun' | ||
|
||
Spec::Runner.configure do |config| | ||
config.mock_with :mocha | ||
end | ||
|
||
# We need this because the RAL uses 'should' as a method. This | ||
# allows us the same behaviour but with a different method name. | ||
class Object | ||
alias :must :should | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# This file is being maintained by Puppet. | ||
# DO NOT EDIT | ||
|
||
############################################################################### | ||
# Access Control | ||
############################################################################### | ||
|
||
# Sources | ||
# sec.name source community | ||
com2sec local localhost public | ||
com2sec <%= lsbProvider %> localhost <%= lsbProvider %> | ||
com2sec <%= lsbProvider %> 10.1.0.0/16 <%= lsbProvider %> | ||
|
||
# Security mappings | ||
group MyROGroup v2c local | ||
group MyROGroup v2c <%= lsbProvider %> | ||
|
||
# Views | ||
# incl/excl subtree mask | ||
view all included .1 80 | ||
view system included .iso.org.dod.internet.mgmt.mib-2.system | ||
view sysView included system | ||
|
||
# Access levels | ||
# context sec.model sec.level match read write notif | ||
access MyROGroup "" any noauth exact all none none | ||
|
||
############################################################################### | ||
# System contact information | ||
############################################################################### | ||
|
||
syslocation <%= snmpSyslocation %> | ||
syscontact Root <<%= contactEmail %>> | ||
|
||
############################################################################### | ||
# disk checks | ||
############################################################################### | ||
|
||
# disk checks - "alarm" at 80% full | ||
disk / 20% | ||
disk /boot 20% | ||
disk /data 20% | ||
|
||
############################################################################### | ||
# load average checks | ||
############################################################################### | ||
|
||
# Check for loads: | ||
load 10 10 10 | ||
|
||
############################################################################### | ||
# Extensible sections. | ||
############################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include snmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--format | ||
s | ||
--colour | ||
--loadby | ||
mtime | ||
--backtrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'pathname' | ||
dir = Pathname.new(__FILE__).parent | ||
$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib') | ||
|
||
require 'mocha' | ||
require 'puppet' | ||
gem 'rspec', '=1.2.9' | ||
require 'spec/autorun' | ||
|
||
Spec::Runner.configure do |config| | ||
config.mock_with :mocha | ||
end | ||
|
||
# We need this because the RAL uses 'should' as a method. This | ||
# allows us the same behaviour but with a different method name. | ||
class Object | ||
alias :must :should | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# This file is being maintained by Puppet. | ||
# DO NOT EDIT | ||
|
||
############################################################################### | ||
# Access Control | ||
############################################################################### | ||
|
||
# Sources | ||
# sec.name source community | ||
com2sec local localhost public | ||
com2sec <%= lsbProvider %> localhost <%= lsbProvider %> | ||
com2sec <%= lsbProvider %> 10.1.0.0/16 <%= lsbProvider %> | ||
|
||
# Security mappings | ||
group MyROGroup v2c local | ||
group MyROGroup v2c <%= lsbProvider %> | ||
|
||
# Views | ||
# incl/excl subtree mask | ||
view all included .1 80 | ||
view system included .iso.org.dod.internet.mgmt.mib-2.system | ||
view sysView included system | ||
|
||
# Access levels | ||
# context sec.model sec.level match read write notif | ||
access MyROGroup "" any noauth exact all none none | ||
|
||
############################################################################### | ||
# System contact information | ||
############################################################################### | ||
|
||
syslocation <%= snmpSyslocation %> | ||
syscontact Root <<%= contactEmail %>> | ||
|
||
############################################################################### | ||
# disk checks | ||
############################################################################### | ||
|
||
# disk checks - "alarm" at 80% full | ||
disk / 20% | ||
disk /boot 20% | ||
disk /data 20% | ||
|
||
############################################################################### | ||
# load average checks | ||
############################################################################### | ||
|
||
# Check for loads: | ||
load 10 10 10 | ||
|
||
############################################################################### | ||
# Extensible sections. | ||
############################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include snmp |