Skip to content

Instantly share code, notes, and snippets.

View skottler's full-sized avatar

Sam Kottler skottler

View GitHub Profile
class utility {
package { "htop":
ensure => installed,
}
}
node default {
include hiera
include nagios::client
}
class nagios::client {
file { "$nrpedir/nrpe.cfg":
owner => $nrpeuser,
group => $nrpegroup,
mode => 644,
content => template("nagios/nrpe.cfg.erb")
}
}
$allowed_hosts = ['localhost', 'nagios.mycompany.com']
$nrpeservice = "nrpe"
$nrpepattern = "nrpe"
$nrpepackage = "nrpe"
$nrpedir = "/etc/nagios"
$nrpeuser = "nrpe"
$nrpegroup = "nrpe"
$pluginsdir = "/usr/local/nagios/libexec"
:hierarchy: - %{environment}/%{location}/%{calling_module}
- %{environment}/%{calling_module}
- common
hiera nagios_server environment=dev location=virginia calling_module=nagios
environments/
|-- dev
| |-- hieradb
| | |-- Ubuntu.yaml
| | |-- CentOS.yaml
| | `-- common.yaml
| `-- modules
| `-- nagios
`-- prod
|-- hieradb
setgid ubuntu
setuid ubuntu
start on runlevel [2345]
stop on runlevel [016]
#!/usr/bin/env python
import sys
import time
import argparse
from datetime import timedelta
import pyes
__version__ = '0.1.0'
#!/usr/bin/ruby
require 'puppet'
require 'net/http'
require 'yaml'
Factsdir = "/var/lib/puppet/yaml/facts"
Foreman = "http://foreman"
node = ARGV[0]