summaryrefslogtreecommitdiff
path: root/sitemodules
diff options
context:
space:
mode:
Diffstat (limited to 'sitemodules')
-rw-r--r--sitemodules/profiles/files/nrpe_agent/apt.cfg8
-rw-r--r--sitemodules/profiles/manifests/nrpe_agent.pp76
-rw-r--r--sitemodules/profiles/templates/nrpe_agent/nrpe_local.cfg.epp6
-rw-r--r--sitemodules/roles/manifests/svnserver.pp3
4 files changed, 92 insertions, 1 deletions
diff --git a/sitemodules/profiles/files/nrpe_agent/apt.cfg b/sitemodules/profiles/files/nrpe_agent/apt.cfg
new file mode 100644
index 0000000..7aa2887
--- /dev/null
+++ b/sitemodules/profiles/files/nrpe_agent/apt.cfg
@@ -0,0 +1,8 @@
+# THIS FILE IS MANAGED BY PUPPET, MANUAL CHANGES WILL BE OVERWRITTEN AT THE
+# NEXT PUPPET RUN.
+
+# 'check_apt' command definition
+command[check_apt]=/usr/lib/nagios/plugins/check_apt
+
+# 'check_apt_distupgrade' command definition
+command[check_apt_distupgrade]=/usr/lib/nagios/plugins/check_apt -d
diff --git a/sitemodules/profiles/manifests/nrpe_agent.pp b/sitemodules/profiles/manifests/nrpe_agent.pp
new file mode 100644
index 0000000..df7674d
--- /dev/null
+++ b/sitemodules/profiles/manifests/nrpe_agent.pp
@@ -0,0 +1,76 @@
+# Class: profiles::nrpe_agent
+# ===========================
+#
+# This class installs and configures the nrpe agent for remote monitoring.
+#
+# Parameters
+# ----------
+#
+# @param allowed_hosts list of allowed host IP addresses
+#
+# Examples
+# --------
+#
+# @example
+# class roles::myhost {
+# include profiles::nrpe_agent
+# }
+#
+# Authors
+# -------
+#
+# Jan Dittberner <jandd@cacert.org>
+#
+# Copyright
+# ---------
+#
+# Copyright 2018 Jan Dittberner
+class profiles::nrpe_agent (
+ Array[String] $allowed_hosts,
+) {
+ package { 'nagios-nrpe-server':
+ ensure => latest,
+ }
+
+ package { 'monitoring-plugins-basic':
+ ensure => latest,
+ }
+
+ service { 'nagios-nrpe-server':
+ ensure => running,
+ enabled => true,
+ }
+
+ file { '/etc/nagios/nrpe_local.cfg':
+ ensure => file,
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ content => epp(
+ 'profiles/nrpe_agent/nrpe_local.cfg.epp',
+ {
+ 'allowed_hosts' => $allowed_hosts
+ }
+ ),
+ require => Package['nagios-nrpe-server'],
+ notify => Service['nagios-nrpe-server'],
+ }
+
+ file { '/etc/nagios/nrpe.d':
+ ensure => directory,
+ owner => 'root',
+ group => 'root',
+ mode => '0755',
+ require => Package['nagios-nrpe-server'],
+ }
+
+ file { '/etc/nagios/nrpe.d/apt.cfg':
+ ensure => file,
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ source => 'puppet:///modules//profiles/nrpe_agent/apt.cfg',
+ require => [File['/etc/nagios/nrpe.d']],
+ notify => Service['nagios-nrpe-server'],
+ }
+}
diff --git a/sitemodules/profiles/templates/nrpe_agent/nrpe_local.cfg.epp b/sitemodules/profiles/templates/nrpe_agent/nrpe_local.cfg.epp
new file mode 100644
index 0000000..04792b3
--- /dev/null
+++ b/sitemodules/profiles/templates/nrpe_agent/nrpe_local.cfg.epp
@@ -0,0 +1,6 @@
+<%- | Array[String] $allowed_hosts = undef |-%>
+# THIS FILE IS MANAGED BY PUPPET, MANUAL CHANGES WILL BE OVERWRITTEN AT THE
+# NEXT PUPPET RUN.
+
+# local nrpe configuration
+allowed_hosts=<%= $allowed_hosts.join(',') %>
diff --git a/sitemodules/roles/manifests/svnserver.pp b/sitemodules/roles/manifests/svnserver.pp
index 64d4508..60a054f 100644
--- a/sitemodules/roles/manifests/svnserver.pp
+++ b/sitemodules/roles/manifests/svnserver.pp
@@ -18,8 +18,9 @@
# Copyright
# ---------
#
-# Copyright 2016 Jan Dittberner
+# Copyright 2016-2017 Jan Dittberner
#
class roles::svnserver {
include profiles::base
+ include profiles::nrpe_agent
}