fixes #5843
This commit is contained in:
Michael Friedrich 2014-06-13 22:39:17 +02:00
parent 614af5b0e5
commit 5bea405c67
39 changed files with 22 additions and 1533 deletions

View File

@ -1,2 +0,0 @@
send_nsca.cfg text eol=lf
nsca-ng.cfg text eol=lf

View File

@ -1,26 +0,0 @@
/**
* A host definition. You can create your own configuration files
* in the conf.d directory (e.g. one per host). By default all *.conf
* files in this directory are included.
*/
object Host "nsca-ng" {
import "generic-host"
display_name = "nsca-ng test"
}
apply Service "PassiveService1" {
import "generic-service"
check_command = "passive"
assign where host.name == "nsca-ng"
}
apply Service "PassiveService2" {
import "generic-service"
check_command = "passive"
assign where host.name == "nsca-ng"
}

View File

@ -1,13 +0,0 @@
/**
* The ido_mysql library implements IDO functionality
* for MySQL.
*/
library "db_ido_mysql"
object IdoMysqlConnection "ido-mysql" {
user = "icinga"
password = "icinga"
host = "localhost"
database = "icinga"
}

View File

@ -1,8 +0,0 @@
_____ _ ___
|_ _| (_) |__ \
| | ___ _ _ __ __ _ __ _ ) |
| | / __| | '_ \ / _` |/ _` | / /
_| || (__| | | | | (_| | (_| | / /_
|_____\___|_|_| |_|\__, |\__,_| |____|
__/ |
|___/

View File

@ -1,128 +0,0 @@
#
# Sample configuration for nsca-ng(8). See the nsca-ng.cfg(5) man page.
#
# PLEASE SET THE PERMISSIONS OF THIS FILE APPROPRIATELY TO MAKE SURE THAT ONLY
# AUTHORIZED USERS CAN ACCESS IT!
#
#
# Most probably, you'll have to specify the path to the Nagios command file.
#
command_file = "/var/run/icinga2/cmd/icinga2.cmd"
#
# These configuration settings are optional.
#
# listen = "monitoring.example.com:5668" # Default: "*".
# pid_file = "/var/run/nsca-ng.pid" # Default: create no PID file.
# temp_directory = "/dev/shm" # Default: "/tmp".
# tls_ciphers = "PSK-AES256-CBC-SHA" # Default: see nsca-ng.cfg(5).
# chroot = "/usr/local/nagios/var" # Default: don't chroot(2).
# user = "nagios" # Default: don't switch user.
# log_level = 2 # Default: 3.
# max_command_size = 65536 # Default: 16384.
# max_queue_size = 128 # Default: 1024.
# timeout = 15.0 # Default: 60.0.
#
user = "nsca"
#
# Clients provide a client ID (think: user name) and a password. The same
# ID/password combination may be used by multiple clients. In order to
# authorize clients to submit check results and/or other external commands, at
# least one "authorize" section must be specified. The client ID (which follows
# the "authorize" keyword) may be "*". In this case, the block will be used as
# fallback if no section is defined for a given client ID. No other wildcard
# characters are available, and "*" has no special meaning unless the client ID
# is exactly "*".
#
# Authorizations are specified using the "commands", "hosts, and/or "services"
# variables within an "authorize" section. These variables are (lists of)
# extended POSIX regular expressions (see the regex(7) man page), but with an
# implicit leading "^" and trailing "$". The "commands" patterns are matched
# against the full command string transmitted by the client, except for the
# leading bracketed timestamp. The "hosts" and "services" variables are
# syntactic sugar, e.g.:
#
# services = {
# "http@web-server",
# "disk"
# }
#
# is equivalent to
#
# commands = {
# "PROCESS_SERVICE_CHECK_RESULT;web-server;http;.+;.+",
# "PROCESS_SERVICE_CHECK_RESULT;[^;]+;disk;.+;.+"
# }
#
# Some examples:
#
# Authenticated "root" clients may submit arbitrary check results and any other
# monitoring commands.
#
# authorize "root" {
# password = "cM5vBM9CtCWTH1SwnxFEOfp8VAmQq2vd"
# commands = ".*"
# }
#
# Authenticated "checker" clients may submit arbitrary check results, but no
# other commands.
#
# authorize "checker" {
# password = "s2LDCy4CiK6yrlcHhTXT6agFh067XYE3"
# hosts = ".*"
# services = ".*"
# }
#
# Authenticated "mail-checker" clients may submit check results for arbitrary
# services on hosts whose names begin with "pop", "imap", or "smtp".
#
# authorize "mail-checker" {
# password = "1HOiwYonRoLByCaX6lfY5KDhP484THzV"
# services = {
# ".+@pop.*",
# ".+@imap.*",
# ".+@smtp.*"
# }
# }
#
# Authenticated "system-checker" clients may submit check results for the
# "disk", "swap", and "load" services on arbitrary hosts.
#
# authorize "system-checker" {
# password = "rDCnSMFaM9wb5Yzjd6JwRcvHEwmC9ZlQ"
# services = {
# "disk",
# "swap",
# "load"
# }
# }
#
#
# The "*" section applies when no other section matches the client's identity.
# In order to authorize clients to actually submit check results (or other
# commands), at least one "commands" and/or "services" expression must be
# specified.
#
authorize "*" {
password = "change-me"
#
# The original NSCA server permits all authenticated clients to submit
# arbitrary check results. To get this behaviour, enable the following
# lines:
#
hosts = ".*"
services = ".*"
commands = ".*"
}
#
# Other files can be included. If a directory is specified, all "*.cfg" and
# "*.conf" files within this directory and all subdirectories are included.
#
# include(nsca-ng.d/included.cfg)
#

View File

@ -1,29 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.5 (GNU/Linux)
mQINBEvSKUIBEADLGnUj24ZVKW7liFN/JA5CgtzlNnKs7sBg7fVbNWryiE3URbn1
JXvrdwHtkKyY96/ifZ1Ld3lE2gOF61bGZ2CWwJNee76Sp9Z+isP8RQXbG5jwj/4B
M9HK7phktqFVJ8VbY2jfTjcfxRvGM8YBwXF8hx0CDZURAjvf1xRSQJ7iAo58qcHn
XtxOAvQmAbR9z6Q/h/D+Y/PhoIJp1OV4VNHCbCs9M7HUVBpgC53PDcTUQuwcgeY6
pQgo9eT1eLNSZVrJ5Bctivl1UcD6P6CIGkkeT2gNhqindRPngUXGXW7Qzoefe+fV
QqJSm7Tq2q9oqVZ46J964waCRItRySpuW5dxZO34WM6wsw2BP2MlACbH4l3luqtp
Xo3Bvfnk+HAFH3HcMuwdaulxv7zYKXCfNoSfgrpEfo2Ex4Im/I3WdtwME/Gbnwdq
3VJzgAxLVFhczDHwNkjmIdPAlNJ9/ixRjip4dgZtW8VcBCrNoL+LhDrIfjvnLdRu
vBHy9P3sCF7FZycaHlMWP6RiLtHnEMGcbZ8QpQHi2dReU1wyr9QgguGU+jqSXYar
1yEcsdRGasppNIZ8+Qawbm/a4doT10TEtPArhSoHlwbvqTDYjtfV92lC/2iwgO6g
YgG9XrO4V8dV39Ffm7oLFfvTbg5mv4Q/E6AWo/gkjmtxkculbyAvjFtYAQARAQAB
tCFFUEVMICg2KSA8ZXBlbEBmZWRvcmFwcm9qZWN0Lm9yZz6JAjYEEwECACAFAkvS
KUICGw8GCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRA7Sd8qBgi4lR/GD/wLGPv9
qO39eyb9NlrwfKdUEo1tHxKdrhNz+XYrO4yVDTBZRPSuvL2yaoeSIhQOKhNPfEgT
9mdsbsgcfmoHxmGVcn+lbheWsSvcgrXuz0gLt8TGGKGGROAoLXpuUsb1HNtKEOwP
Q4z1uQ2nOz5hLRyDOV0I2LwYV8BjGIjBKUMFEUxFTsL7XOZkrAg/WbTH2PW3hrfS
WtcRA7EYonI3B80d39ffws7SmyKbS5PmZjqOPuTvV2F0tMhKIhncBwoojWZPExft
HpKhzKVh8fdDO/3P1y1Fk3Cin8UbCO9MWMFNR27fVzCANlEPljsHA+3Ez4F7uboF
p0OOEov4Yyi4BEbgqZnthTG4ub9nyiupIZ3ckPHr3nVcDUGcL6lQD/nkmNVIeLYP
x1uHPOSlWfuojAYgzRH6LL7Idg4FHHBA0to7FW8dQXFIOyNiJFAOT2j8P5+tVdq8
wB0PDSH8yRpn4HdJ9RYquau4OkjluxOWf0uRaS//SUcCZh+1/KBEOmcvBHYRZA5J
l/nakCgxGb2paQOzqqpOcHKvlyLuzO5uybMXaipLExTGJXBlXrbbASfXa/yGYSAG
iVrGz9CE6676dMlm8F+s3XXE13QZrXmjloc6jwOljnfAkjTGXjiB7OULESed96MR
XtfLk0W5Ab9pd7tKDR6QHI7rgHXfCopRnZ2VVQ==
=V/6I
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -1,30 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.19 (GNU/Linux)
mQGiBFKHzk4RBACSHMIFTtfw4ZsNKAA03Gf5t7ovsKWnS7kcMYleAidypqhOmkGg
0petiYsMPYT+MOepCJFGNzwQwJhZrdLUxxMSWay4Xj0ArgpD9vbvU+gj8Tb02l+x
SqNGP8jXMV5UnK4gZsrYGLUPvx47uNNYRIRJAGOPYTvohhnFJiG402dzlwCg4u5I
1RdFplkp9JM6vNM9VBIAmcED/2jr7UQGsPs8YOiPkskGHLh/zXgO8SvcNAxCLgbp
BjGcF4Iso/A2TAI/2KGJW6kBW/Paf722ltU6s/6mutdXJppgNAz5nfpEt4uZKZyu
oSWf77179B2B/Wl1BsX/Oc3chscAgQb2pD/qPF/VYRJU+hvdQkq1zfi6cVsxyREV
k+IwA/46nXh51CQxE29ayuy1BoIOxezvuXFUXZ8rP6aCh4KaiN9AJoy7pBieCzsq
d7rPEeGIzBjI+yhEu8p92W6KWzL0xduWfYg9I7a2GTk8CaLX2OCLuwnKd7RVDyyZ
yzRjWs0T5U7SRAWspLStYxMdKert9lLyQiRHtLwmlgBPqa0gh7Q+SWNpbmdhIE9w
ZW4gU291cmNlIE1vbml0b3JpbmcgKEJ1aWxkIHNlcnZlcikgPGluZm9AaWNpbmdh
Lm9yZz6IYAQTEQIAIAUCUofOTgIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJ
EMbjGcM0QQaCgSQAnRjXdbsyqziqhmxfAKffNJYuMPwdAKCS/IRCVyQzApFBtIBQ
1xuoym/4C7kCDQRSh85OEAgAvPwjlURCi8z6+7i60no4n16dNcSzd6AT8Kizpv2r
9BmNBff/GNYGnHyob/DMtmO2esEuVG8w62rO9m1wzzXzjbtmtU7NZ1Tg+C+reU2I
GNVu3SYtEVK/UTJHAhLcgry9yD99610tYPN2Fx33Efse94mXOreBfCvDsmFGSc7j
GVNCWXpMR3jTYyGj1igYd5ztOzG63D8gPyOucTTl+RWN/G9EoGBv6sWqk5eCd1Fs
JlWyQX4BJn3YsCZx3uj1DWL0dAl2zqcn6m1M4oj1ozW47MqM/efKOcV6VvCs9SL8
F/NFvZcH4LKzeupCQ5jEONqcTlVlnLlIqId95Z4DI4AV9wADBQf/S6sKA4oH49tD
Yb5xAfUyEp5ben05TzUJbXs0Z7hfRQzy9+vQbWGamWLgg3QRUVPx1e4IT+W5vEm5
dggNTMEwlLMI7izCPDcD32B5oxNVxlfj428KGllYWCFj+edY+xKTvw/PHnn+drKs
LE65Gwx4BPHm9EqWHIBX6aPzbgbJZZ06f6jWVBi/N7e/5n8lkxXqS23DBKemapyu
S1i56sH7mQSMaRZP/iiOroAJemPNxv1IQkykxw2woWMmTLKLMCD/i+4DxejE50tK
dxaOLTc4HDCsattw/RVJO6fwE414IXHMv330z4HKWJevMQ+CmQGfswvCwgeBP9n8
PItLjBQAXIhJBBgRAgAJBQJSh85OAhsMAAoJEMbjGcM0QQaCzpAAmwUNoRyySf9p
5G3/2UD1PMueIwOtAKDVVDXEq5LJPVg4iafNu0SRMwgP0Q==
=icbY
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -1,15 +0,0 @@
#
# Sample configuration for send_nsca(8). See the send_nsca.cfg(5) man page.
#
# PLEASE SET THE PERMISSIONS OF THIS FILE APPROPRIATELY TO MAKE SURE THAT ONLY
# AUTHORIZED USERS CAN ACCESS IT!
#
identity="nsca-ng"
# identity = "web-checker" # Default: `hostname`.
# password = "8a5UMsMzZhu6sSPkSmSaqC3HjMGCLwdt" # Default: "change-me".
# server = "monitoring.example.com" # Default: "localhost".
# tls_ciphers = "PSK-AES256-CBC-SHA" # See send_nsca.cfg(5).
# delay = 2 # Default: 0.
# port = 5668 # Default: 5668.
# timeout = 10 # Default: 15.

View File

@ -1,3 +0,0 @@
nsca-ng PassiveService1 0 This is a test passive result check returning OK
nsca-ng PassiveService2 1 This is a test passive result check returning BAD

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,104 +0,0 @@
<html>
<head>
<title>
Icinga 2 Demo Vagrant Box
</title>
<style type="text/css">
body {
top: 0px;
left: 0px;
height: 100%;
position: fixed;
background: #fff;
box-shadow: inset -5px 0 5px 0px #000;
width: 1024px;
padding-top: 20px;
overflow:scroll;
font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Helvetica, Arial, sans-serif;
font-size: 0.72em;
color: #262625;
}
ul {
margin: 0;
padding: 0;
list-style: none;
}
li {
padding: 5px 10px;
}
table {
border:1px solid;
}
th {
border:1px solid;
}
td {
border:1px solid;
}
a:link, a:visited, a:active {
color: #0489B1;
text-decoration: underline;
}
a:hover {
color: #01A9DB;
text-decoration: underline;
}
h1 {
font-size: 1.5em;
}
h2 {
font-size: 1.2em;
padding-left: 10px;
}
h3 {
padding-left: 20px;
}
h4 {
padding-left: 30px;
}
.active {
background: #336699;
box-shadow: inset -5px 0px 10px -5px #000;
}
pre {
font-family: "courier new", courier, monospace;
font-size: 12px;
}
</style>
</head>
<img src="icinga_wall.png">
<h1>Welcome to the Icinga 2.x Demo Vagrant Box!</h1>
<h2>GUI</h2>
<p>
Available user interfaces.
</p>
<table>
<tr><th>GUI</th><th>Url</th><th>Credentials</th></tr>
<tr><td>Icinga Classic UI</td><td><a href="/icinga" target="_blank">/icinga</a></td><td>icingaadmin/icingaadmin</td></tr>
<tr><td>Icinga Web</td><td><a href="/icinga-web" target="_blank">/icinga-web</a></td><td>root/password</td></tr>
</table>
<h2>SSH</h2>
SSH is available through 'vagrant ssh' with passwordless sudo ('sudo -i').
<h1>Documentation</h1>
The official Icinga 2 documentation is available at <a href="https://docs.icinga.org">docs.icinga.org</a>.
</html>

View File

@ -1,44 +0,0 @@
include apache
include icinga2
include icinga2-classicui
include icinga2-icinga-web
include nagios-plugins
include nsca-ng
####################################
# Start page at http://localhost/
####################################
file { '/var/www/html/index.html':
source => 'puppet:////vagrant/.vagrant-puppet/files/var/www/html/index.html',
owner => 'apache',
group => 'apache',
require => Package['apache']
}
file { '/var/www/html/icinga_wall.png':
source => 'puppet:////vagrant/.vagrant-puppet/files/var/www/html/icinga_wall.png',
owner => 'apache',
group => 'apache',
require => Package['apache']
}
####################################
# Misc
####################################
package { 'vim-enhanced':
ensure => 'installed'
}
file { '/etc/motd':
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/motd',
owner => root,
group => root
}
user { 'vagrant':
groups => ['icinga', 'icingacmd'],
require => [User['icinga'], Group['icingacmd']]
}

View File

@ -1,2 +0,0 @@
#!/bin/bash
echo "The Icinga 2 Vagrant VM has finished installing. See http://localhost:8080 for more details."

View File

@ -1,38 +0,0 @@
# Class: apache
#
# This class installs the apache server.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# include apache
#
class apache {
$apache = $::operatingsystem ? {
/(Debian|Ubuntu)/ => 'apache2',
/(RedHat|CentOS|Fedora)/ => 'httpd'
}
package { $apache:
ensure => installed,
alias => 'apache'
}
exec { 'iptables-allow-http':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
unless => 'grep -Fxqe "-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables',
command => 'lokkit --enabled --service=http'
}
service { $apache:
enable => true,
ensure => running,
alias => 'apache',
require => [ Package['apache'], Exec['iptables-allow-http'] ]
}
}

View File

@ -1,49 +0,0 @@
# Define: cpan
#
# Download and install Perl modules from the Perl Archive Network, the canonical location for Perl code and modules.
#
# Parameters:
# [*creates*] - target directory the software will install to.
# [*timeout* ] - timeout for the CPAN command.
#
# Actions:
#
# Requires:
#
# Perl
#
# Sample Usage:
#
# cpan { 'perl-module':
# creates => '/usr/local/share/perl5/perl-module',
# timeout => 600
# }
#
define cpan(
$creates,
$timeout
) {
Exec { path => '/usr/bin' }
package { 'perl-CPAN':
ensure => installed
}
file { [ '/root/.cpan/', '/root/.cpan/CPAN/' ]:
ensure => directory
}
file { '/root/.cpan/CPAN/MyConfig.pm':
content => template('cpan/MyConfig.pm.erb'),
require => [ Package['perl-CPAN'],
File[[ '/root/.cpan/', '/root/.cpan/CPAN/' ]] ]
}
exec { "cpan-${name}":
command => "sudo perl -MCPAN -e 'install ${name}'",
creates => $creates,
require => File['/root/.cpan/CPAN/MyConfig.pm'],
timeout => $timeout
}
}

View File

@ -1,68 +0,0 @@
$CPAN::Config = {
'applypatch' => q[],
'auto_commit' => q[0],
'build_cache' => q[100],
'build_dir' => q[/root/.cpan/build],
'build_dir_reuse' => q[0],
'build_requires_install_policy' => q[ask/yes],
'bzip2' => q[/usr/bin/bzip2],
'cache_metadata' => q[1],
'check_sigs' => q[0],
'commandnumber_in_prompt' => q[1],
'connect_to_internet_ok' => q[1],
'cpan_home' => q[/root/.cpan],
'curl' => q[/usr/bin/curl],
'ftp' => q[],
'ftp_passive' => q[1],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gpg' => q[/usr/bin/gpg],
'gzip' => q[/bin/gzip],
'halt_on_failure' => q[0],
'histfile' => q[/root/.cpan/histfile],
'histsize' => q[100],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/root/.cpan/sources],
'load_module_verbosity' => q[v],
'lynx' => q[],
'make' => q[/usr/bin/make],
'make_arg' => q[],
'make_install_arg' => q[],
'make_install_make_command' => q[/usr/bin/make],
'makepl_arg' => q[INSTALLDIRS=site],
'mbuild_arg' => q[],
'mbuild_install_arg' => q[],
'mbuild_install_build_command' => q[./Build],
'mbuildpl_arg' => q[--installdirs site],
'ncftp' => q[],
'ncftpget' => q[],
'no_proxy' => q[],
'pager' => q[/usr/bin/less],
'patch' => q[],
'perl5lib_verbosity' => q[v],
'prefer_installer' => q[MB],
'prefs_dir' => q[/root/.cpan/prefs],
'prerequisites_policy' => q[follow],
'scan_cache' => q[atstart],
'shell' => q[/bin/bash],
'show_unparsable_versions' => q[0],
'show_upload_date' => q[0],
'show_zero_versions' => q[0],
'tar' => q[/bin/tar],
'tar_verbosity' => q[v],
'term_is_latin' => q[1],
'term_ornaments' => q[1],
'test_report' => q[0],
'trust_test_report_history' => q[0],
'unzip' => q[/usr/bin/unzip],
'urllist' => [],
'use_sqlite' => q[0],
'wget' => q[/usr/bin/wget],
'yaml_load_code' => q[0],
'yaml_module' => q[YAML],
};
1;
__END__

View File

@ -1,37 +0,0 @@
# Class: epel
#
# Configure EPEL repository.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# include epel
#
class epel {
yumrepo { 'epel':
mirrorlist => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=${::architecture}",
enabled => '1',
gpgcheck => '1',
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6',
descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}"
}
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6":
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet:////vagrant/.vagrant-puppet/files/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6"
}
epel::key { "RPM-GPG-KEY-EPEL-6":
path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6",
before => Yumrepo['icinga-rpm-snapshot']
}
}

View File

@ -1,13 +0,0 @@
# inspired by https://github.com/stahnma/puppet-module-epel/blob/master/manifests/rpm_gpg_key.pp
define epel::key($path) {
exec { "import-key-${name}":
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => "rpm --import ${path}",
unless => "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids < ${path}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')",
require => File[$path],
logoutput => 'on_failure'
}
}

View File

@ -1,39 +0,0 @@
# Class: icinga-rpm-snapshot
#
# Configure Icinga repositories.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# include icinga-rpm-snapshot
#
class icinga-rpm-snapshot {
yumrepo { 'icinga-rpm-snapshot':
mirrorlist => "http://packages.icinga.org/epel/6/snapshot/ICINGA-snapshot.repo",
# baseurl is required, otherwise mirrorlist errors by yum
baseurl => "http://packages.icinga.org/epel/6/snapshot/",
enabled => '1',
gpgcheck => '1',
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA',
descr => "Icinga Snapshot Packages for Enterprise Linux 6 - ${::architecture}"
}
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA":
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet:////vagrant/.vagrant-puppet/files/etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA"
}
icinga-rpm-snapshot::key { "RPM-GPG-KEY-ICINGA":
path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA",
before => Yumrepo['icinga-rpm-snapshot']
}
}

View File

@ -1,13 +0,0 @@
# inspired by https://github.com/stahnma/puppet-module-epel/blob/master/manifests/rpm_gpg_key.pp
define icinga-rpm-snapshot::key($path) {
exec { "import-key-${name}":
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => "rpm --import ${path}",
unless => "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids < ${path}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')",
require => File[$path],
logoutput => 'on_failure'
}
}

View File

@ -1,40 +0,0 @@
class icinga-web {
include icinga-rpm-snapshot
include php
include mysql
include pgsql
php::extension { ['php-mysql']:
require => [ Class['mysql'] ]
}
php::extension { ['php-pgsql']:
require => [ Class['pgsql'] ]
}
package { 'icinga-web':
ensure => latest,
require => Class['icinga-rpm-snapshot'],
notify => Service['apache']
}
package { 'icinga-web-mysql':
ensure => latest,
require => Class['icinga-rpm-snapshot'],
notify => Service['apache']
}
exec { 'create-mysql-icinga-web-db':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
unless => 'mysql -uicinga_web -picinga_web icinga_web',
command => 'mysql -uroot -e "CREATE DATABASE icinga_web; GRANT ALL ON icinga_web.* TO icinga_web@localhost IDENTIFIED BY \'icinga_web\';"',
require => Service['mysqld']
}
exec { 'populate-icinga-web-mysql-db':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
unless => 'mysql -uicinga_web -picinga_web icinga_web -e "SELECT * FROM nsm_user;" &> /dev/null',
command => 'mysql -uicinga_web -picinga_web icinga_web < /usr/share/icinga-web/etc/schema/mysql.sql',
require => [ Package['icinga-web'], Exec['create-mysql-icinga-web-db'] ]
}
}

View File

@ -1,40 +0,0 @@
class icinga2-classicui {
include icinga-rpm-snapshot
include icinga2
# workaround for package conflicts
# icinga-gui pulls icinga-gui-config automatically
package { 'icinga2-classicui-config':
ensure => latest,
before => Package["icinga-gui"],
require => Class['icinga-rpm-snapshot'],
notify => Service['apache']
}
package { 'icinga-gui':
ensure => latest,
alias => 'icinga-gui'
}
# runtime users
group { 'icingacmd':
ensure => present
}
user { 'icinga':
ensure => present,
groups => 'icingacmd',
managehome => false
}
user { 'apache':
groups => ['icingacmd', 'vagrant'],
require => [ Class['apache'], Group['icingacmd'] ]
}
icinga2::feature { 'statusdata': }
icinga2::feature { 'command': }
icinga2::feature { 'compatlog': }
}

View File

@ -1,17 +0,0 @@
class icinga2-icinga-web {
include icinga-web
include icinga2-ido-mysql
include icinga2-ido-pgsql
exec { 'set-icinga2-cmd-pipe-path':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => 'sed -i \'s/\/var\/spool\/icinga\/cmd\/icinga.cmd/\/var\/run\/icinga2\/cmd\/icinga2.cmd/g\' /etc/icinga-web/conf.d/access.xml',
require => Package['icinga-web']
}
exec { 'clear-config-cache':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => '/usr/bin/icinga-web-clearcache',
require => Exec['set-icinga2-cmd-pipe-path']
}
}

View File

@ -1,124 +0,0 @@
class icinga2 {
include icinga-rpm-snapshot
package { 'icinga2':
ensure => latest,
require => Class['icinga-rpm-snapshot'],
alias => 'icinga2'
}
package { 'icinga2-bin':
ensure => latest,
require => Class['icinga-rpm-snapshot'],
alias => 'icinga2-bin'
}
package { 'icinga2-common':
ensure => latest,
require => Class['icinga-rpm-snapshot'],
alias => 'icinga2-common'
}
package { 'icinga2-doc':
ensure => latest,
require => Class['icinga-rpm-snapshot'],
alias => 'icinga2-doc'
}
package { 'icinga2-debuginfo':
ensure => latest,
require => Class['icinga-rpm-snapshot'],
alias => 'icinga2-debuginfo'
}
service { 'icinga2':
enable => true,
ensure => running,
hasrestart => true,
alias => 'icinga2',
require => Package['icinga2']
}
file { "/etc/icinga2/features-enabled/*":
notify => Service['icinga2']
}
icinga2::feature { 'livestatus': }
}
class icinga2-ido-mysql {
include icinga-rpm-snapshot
include mysql
package { 'icinga2-ido-mysql':
ensure => latest,
require => Class['icinga-rpm-snapshot'],
alias => 'icinga2-ido-mysql'
}
file { '/etc/icinga2/features-available/ido-mysql.conf':
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icinga2/features-available/ido-mysql.conf',
require => Package['icinga2'],
notify => Service['icinga2']
}
exec { 'create-mysql-icinga2-ido-db':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
unless => 'mysql -uicinga -picinga icinga',
command => 'mysql -uroot -e "CREATE DATABASE icinga; GRANT ALL ON icinga.* TO icinga@localhost IDENTIFIED BY \'icinga\';"',
require => Service['mysqld']
}
exec { 'populate-icinga2-ido-mysql-db':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
unless => 'mysql -uicinga -picinga icinga -e "SELECT * FROM icinga_dbversion;" &> /dev/null',
command => 'mysql -uicinga -picinga icinga < /usr/share/doc/icinga2-ido-mysql-$(rpm -q icinga2-ido-mysql | cut -d\'-\' -f4)/schema/mysql.sql',
require => [ Package['icinga2-ido-mysql'], Exec['create-mysql-icinga2-ido-db'] ]
}
icinga2::feature { 'ido-mysql':
require => Exec['populate-icinga2-ido-mysql-db']
}
}
class icinga2-ido-pgsql {
include icinga-rpm-snapshot
include pgsql
package { 'icinga2-ido-pgsql':
ensure => latest,
require => Class['icinga-rpm-snapshot'],
alias => 'icinga2-ido-pgsql'
}
exec { 'create-pgsql-icinga2-ido-db':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
unless => 'sudo -u postgres psql -tAc "SELECT 1 FROM pg_roles WHERE rolname=\'icinga\'" | grep -q 1',
command => 'sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD \'icinga\';" && \
sudo -u postgres createdb -O icinga -E UTF8 icinga && \
sudo -u postgres createlang plpgsql icinga',
require => Service['postgresql']
}
exec { 'populate-icinga2-ido-pgsql-db':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
environment => ['PGPASSWORD=icinga'],
unless => 'psql -U icinga -d icinga -c "SELECT * FROM icinga_dbversion;" &> /dev/null',
command => 'psql -U icinga -d icinga < /usr/share/doc/icinga2-ido-pgsql-$(rpm -q icinga2-ido-pgsql | cut -d\'-\' -f4)/schema/pgsql.sql',
require => [ Package['icinga2-ido-pgsql'], Exec['create-pgsql-icinga2-ido-db'] ]
}
icinga2::feature { 'ido-pgsql':
require => Exec['populate-icinga2-ido-pgsql-db']
}
}
define icinga2::feature ($feature = $title) {
exec { "icinga2-feature-${feature}":
path => '/bin:/usr/bin:/sbin:/usr/sbin',
unless => "readlink /etc/icinga2/features-enabled/${feature}.conf",
command => "icinga2-enable-feature ${feature}",
require => [ Package['icinga2'] ],
notify => Service['icinga2']
}
}

View File

@ -1,37 +0,0 @@
# Class: mysql
#
# This class installs the mysql server and client software.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# include mysql
#
class mysql {
Exec { path => '/usr/bin' }
package {
'mysql':
ensure => installed;
'mysql-server':
ensure => installed;
}
service { 'mysqld':
enable => true,
ensure => running,
require => Package['mysql-server']
}
file { '/etc/my.cnf':
content => template('mysql/my.cnf.erb'),
require => Package['mysql-server'],
notify => Service['mysqld']
}
}

View File

@ -1,133 +0,0 @@
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# This permits the application to give the threads system a hint for the
# desired number of threads that should be run at the same time. This
# value only makes sense on systems that support the thread_concurrency()
# function call (Sun Solaris, for example).
# You should try [number of CPUs]*(2..4) for thread_concurrency
thread_concurrency = 8
# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# allowed to at least thread_concurrency * table_open_cache in the variable "open-files-limit" in
# section [mysqld_safe]
table_open_cache = 256
# Size of the buffer used for doing full table scans.
# Allocated per thread, if a full scan is needed.
read_buffer_size = 1M
# When reading rows in sorted order after a sort, the rows are read
# through this buffer to avoid disk seeks. You can improve ORDER BY
# performance a lot, if set this to a high value.
# Allocated per thread, when needed.
read_rnd_buffer_size = 4M
# Sort buffer is used to perform sorts for some ORDER BY and GROUP BY
# queries. If sorted data does not fit into the sort buffer, a disk
# based merge sort is used instead - See the "Sort_merge_passes"
# status variable. Allocated per thread if sort is needed.
sort_buffer_size = 1M
# The maximum size of a query packet the server can handle as well as
# maximum query size server can process (Important when working with
# large BLOBs). enlarged dynamically, for each connection.
max_allowed_packet = 16M
# Query cache is used to cache SELECT results and later return them
# without actual executing the same query once again. Having the query
# cache enabled may result in significant speed improvements, if your
# have a lot of identical queries and rarely changing tables. See the
# "Qcache_lowmem_prunes" status variable to check if the current value
# is high enough for your load.
# Note: In case your tables change very often or if your queries are
# textually different every time, the query cache may result in a
# slowdown instead of a performance improvement.
query_cache_size = 16M
# *** INNODB Specific options ***
innodb_data_home_dir = /var/lib/mysql
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system. Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
innodb_buffer_pool_size = 256M
# InnoDB stores data in one or more data files forming the tablespace.
# If you have a single logical drive for your data, a single
# autoextending file would be good enough. In other cases, a single file
# per device is often a good choice. You can configure InnoDB to use raw
# disk partitions as well - please refer to the manual for more info
# about this.
innodb_data_file_path = ibdata1:10M:autoextend
# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit = 2
# The size of the buffer InnoDB uses for buffering log data. As soon as
# it is full, InnoDB will have to flush it to disk. As it is flushed
# once per second anyway, it does not make sense to have it very large
# (even with long transactions).
innodb_log_buffer_size = 8M
# Total number of files in the log group. A value of 2-3 is usually good
# enough.
innodb_log_files_in_group = 3
# The flush method InnoDB will use for Log. The tablespace always uses
# doublewrite flush logic. The default value is "fdatasync", another
# option is "O_DSYNC".
innodb_flush_method = O_DIRECT
innodb_support_xa = 0
innodb_file_per_table
# 25 % of buffer pool size
innodb_log_file_size = 64M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
# Increase the amount of open files allowed per process. Warning: Make
# sure you have set the global system limit high enough! The high value
# is required for a large number of opened tables
open-files-limit = 2048
[mysqldump]
# Do not buffer the whole result set in memory before writing it to
# file. Required for dumping very large tables
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout

View File

@ -1,9 +0,0 @@
class nagios-plugins {
include epel
# nagios plugins from epel
package { 'nagios-plugins-all':
ensure => installed,
require => Class['epel']
}
}

View File

@ -1,93 +0,0 @@
# Class: nsca-ng
#
# This class installs nsca-ng components
#
class nsca-ng {
include nsca-ng-server
include nsca-ng-client
}
# Class: nsca-ng-server
#
# This class installs nsca-ng server
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
class nsca-ng-server {
package { 'nsca-ng-server':
ensure => installed,
}
exec { 'iptables-allow-nsca-ng':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
unless => 'grep -Fxqe "-A INPUT -m state --state NEW -m tcp -p tcp --dport 5668 -j ACCEPT" /etc/sysconfig/iptables',
command => 'lokkit -p 5668:tcp'
}
user { "nsca":
ensure => "present",
groups => "icingacmd"
}
service { 'nsca-ng':
enable => true,
ensure => running,
hasrestart => true,
alias => 'nsca-ng',
require => [ Package['nsca-ng-server'], Exec['iptables-allow-nsca-ng'] ]
}
file { '/etc/nsca-ng.cfg':
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/nsca-ng.cfg',
require => Package['nsca-ng-server'],
notify => Service['nsca-ng']
}
}
# Class: nsca-ng-client
#
# This class installs nsca-ng client
#
# A example passive check result is stored in ~vagrant/passive_result.
#
# This can be called manually with:
# send_nsca -c /etc/send_nsca.cfg < /home/vagrant/passive_result
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
class nsca-ng-client {
package { 'nsca-ng-client':
ensure => installed,
}
file { '/etc/icinga2/conf.d/passive.conf':
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icinga2/conf.d/passive.conf',
require => Package['nsca-ng-client'],
notify => Service['icinga2']
}
file { '/etc/send_nsca.cfg':
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/send_nsca.cfg',
owner => 'root',
group => 'root',
mode => '0600',
require => Package['nsca-ng-client'],
}
file { '/home/vagrant/passive_result':
source => 'puppet:////vagrant/.vagrant-puppet/files/home/vagrant/passive_result',
require => Package['nsca-ng-client'],
}
}

View File

@ -1,43 +0,0 @@
# Class: pgsql
#
# This class installs the postgresql server and client software.
# Further it configures pg_hba.conf to trust the local icinga user.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# include pgsql
#
class pgsql {
Exec { path => '/sbin:/bin:/usr/bin' }
package {
'postgresql':
ensure => installed;
'postgresql-server':
ensure => installed;
}
exec { 'initdb':
creates => '/var/lib/pgsql/data/pg_xlog',
command => 'service postgresql initdb',
require => Package['postgresql-server']
}
service { 'postgresql':
ensure => running,
require => [Package['postgresql-server'], Exec['initdb']]
}
file { '/var/lib/pgsql/data/pg_hba.conf':
content => template('pgsql/pg_hba.conf.erb'),
require => [Package['postgresql-server'], Exec['initdb']],
notify => Service['postgresql']
}
}

View File

@ -1,84 +0,0 @@
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the
# PostgreSQL documentation for a complete description
# of this file. A short synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
#
# local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: "local" is a Unix-domain socket,
# "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an
# SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket.
#
# DATABASE can be "all", "sameuser", "samerole", a database name, or
# a comma-separated list thereof.
#
# USER can be "all", a user name, a group name prefixed with "+", or
# a comma-separated list thereof. In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names from
# a separate file.
#
# CIDR-ADDRESS specifies the set of hosts the record matches.
# It is made up of an IP address and a CIDR mask that is an integer
# (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that specifies
# the number of significant bits in the mask. Alternatively, you can write
# an IP address and netmask in separate columns to specify the set of hosts.
#
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi", "krb5",
# "ident", "pam", "ldap" or "cert". Note that "password" sends passwords
# in clear text; "md5" is preferred since it sends encrypted passwords.
#
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE. The available options depend on the different authentication
# methods - refer to the "Client Authentication" section in the documentation
# for a list of which options are available for which authentication methods.
#
# Database and user names containing spaces, commas, quotes and other special
# characters must be quoted. Quoting one of the keywords "all", "sameuser" or
# "samerole" makes the name lose its special character, and just match a
# database or username with that name.
#
# This file is read on server startup and when the postmaster receives
# a SIGHUP signal. If you edit the file on a running system, you have
# to SIGHUP the postmaster for the changes to take effect. You can use
# "pg_ctl reload" to do that.
# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections, you need to add more
# "host" records. In that case you will also need to make PostgreSQL listen
# on a non-local interface via the listen_addresses configuration parameter,
# or via the -i or -h command line switches.
#
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# icinga
local icinga icinga md5
host icinga icinga 127.0.0.1/32 md5
host icinga icinga ::1/128 md5
# icinga
local icinga icinga md5
host icinga icinga 127.0.0.1/32 md5
host icinga icinga ::1/128 md5
# "local" is for Unix domain socket connections only
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident

View File

@ -1,34 +0,0 @@
# define: php::extension
#
# Install additional PHP modules.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# php::extension { 'php-ldap': }
# php::extension { ['php-mysql'], ['php-pgsql']: }
#
define php::extension(
$ensure=installed
) {
include apache
include php
if $::require {
$require_ = [Package['apache'], Class['php'], $::require]
} else {
$require_ = [Package['apache'], Class['php']]
}
package { $name:
ensure => $ensure,
require => $require_,
notify => Service['apache']
}
}

View File

@ -1,38 +0,0 @@
# Class: php
#
# This class installs php.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# apache
#
# Sample Usage:
#
# include php
#
class php {
include apache
package { 'php':
ensure => installed,
require => Package['apache'],
notify => Service['apache']
}
file { '/etc/php.d/error_reporting.ini':
content => template('php/error_reporting.ini.erb'),
require => Package['php'],
notify => Service['apache']
}
file { '/etc/php.d/xdebug_settings.ini':
content => template('php/xdebug_settings.ini.erb'),
require => Package['php'],
notify => Service['apache']
}
}

View File

@ -1,4 +0,0 @@
error_reporting = E_ALL | E_STRICT
display_errors = On
display_startup_errors = On
html_errors = On

View File

@ -1,5 +0,0 @@
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 1024
xdebug.var_display_max_depth = 5
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1

View File

@ -1,19 +0,0 @@
# Class: wget
#
# This class installs wget.
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# include wget
#
class wget {
package { 'wget':
ensure => installed,
}
}

115
Vagrantfile vendored
View File

@ -1,115 +0,0 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
VAGRANT_REQUIRED_VERSION = "1.2.0"
# Require 1.2.x at least
if ! defined? Vagrant.require_version
if Gem::Version.new(Vagrant::VERSION) < Gem::Version.new(VAGRANT_REQUIRED_VERSION)
puts "Vagrant >= " + VAGRANT_REQUIRED_VERSION + " required. Your version is " + Vagrant::VERSION
exit 1
end
else
Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "centos-6.5-i386-vbox"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://boxes.icinga.org/centos-65-i386-vbox.box"
# The hostname the machine should have. Defaults to nil. If nil, Vagrant
# won't manage the hostname. If set to a string, the hostname will be set on boot.
config.vm.hostname = "icinga2.demo.icinga.org"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
config.vm.network :forwarded_port, guest: 80, host: 8080,
# Port collision auto-correction must be manually enabled for each forwarded port,
# since it is often surprising when it occurs and can lead the Vagrant user to
# think that the port wasn't properly forwarded. During a vagrant up or vagrant reload,
# Vagrant will output information about any collisions detections and auto corrections made,
# so you can take notice and act accordingly.
auto_correct: true
# forward port for nsca-ng. See note above regarding auto_correct
config.vm.network :forwarded_port, guest: 5668, host: 5668, auto_correct: true
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network :private_network, ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network :public_network
# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
# config.ssh.forward_agent = true
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "./config", "/vagrant/config"
# config.vm.synced_folder "./var/log", "/vagrant/var/log"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider :virtualbox do |vb|
# # Don't boot with headless mode
# vb.gui = true
#
# # Use VBoxManage to customize the VM. For example to change memory:
# vb.customize ["modifyvm", :id, "--memory", "1024"]
# end
#
# View the documentation for the provider you're using for more
# information on available options.
config.vm.provider "virtualbox" do |vb|
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant/config", "1"]
end
# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file base.pp in the manifests_path directory.
#
# An example Puppet manifest to provision the message of the day:
#
# # group { "puppet":
# # ensure => "present",
# # }
# #
# # File { owner => 0, group => 0, mode => 0644 }
# #
# # file { '/etc/motd':
# # content => "Welcome to your Vagrant-built virtual machine!
# # Managed by Puppet.\n"
# # }
#
# config.vm.provision :puppet do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "init.pp"
# end
config.vm.provision :puppet do |puppet|
puppet.module_path = ".vagrant-puppet/modules"
puppet.manifests_path = ".vagrant-puppet/manifests"
#puppet.options = "--verbose --debug"
end
config.vm.provision :shell, :path => ".vagrant-puppet/manifests/finalize.sh"
end

View File

@ -1018,46 +1018,32 @@ safely reload the Icinga 2 daemon.
## <a id="vagrant"></a> Vagrant Demo VM
The Icinga 2 Git repository contains support for [Vagrant](http://docs.vagrantup.com/v2/)
The Icinga Vagrant Git repository contains support for [Vagrant](http://docs.vagrantup.com/v2/)
with VirtualBox. Please note that Vagrant version `1.0.x` is not supported. At least
version `1.2.x` is required.
In order to build the Vagrant VM first you will have to check out
the Git repository:
$ git clone git://git.icinga.org/icinga2.git
$ git clone git://git.icinga.org/icinga-vagrant.git
Once you have checked out the Git repository you can build the VM using the
following command:
For Icinga 2 there are currently two scenarios available:
* `icinga2x` bringing up a standalone box with Icinga 2
* `icinga2x-cluster` setting up two virtual machines in a master/slave cluster
> **Note**
>
> Please consult the `README` file for each project for further installation
> details at [https://github.com/Icinga/icinga-vagrant]
Once you have checked out the Git repository navigate to your required
vagrant box and build the VM using the following command:
$ vagrant up
The Vagrant VM is based on CentOS 6.x and uses the official Icinga 2 RPM
packages from `packages.icinga.org`. The check plugins are installed from
EPEL providing RPMs with sources from the Monitoring Plugins project.
The Vagrant VMs are based on CentOS 6.x and are using the official
Icinga 2 RPM snapshot packages from `packages.icinga.org`. The check
plugins are installed from EPEL providing RPMs with sources from the
Monitoring Plugins project.
### <a id="vagrant-demo-guis"></a> Demo GUIs
In addition to installing Icinga 2 the Vagrant puppet modules also install the
Icinga 1.x Classic UI and Icinga Web.
GUI | Url | Credentials
----------------|----------------------------------------------------------------------|------------------------
Classic UI | [http://localhost:8080/icinga](http://localhost:8080/icinga) | icingaadmin / icingaadmin
Icinga Web | [http://localhost:8080/icinga-web](http://localhost:8080/icinga-web) | root / password
### <a id="vagrant-ssh"></a> SSH Access
You can access the Vagrant VM using SSH:
$ vagrant ssh
Alternatively you can use your favorite SSH client:
Name | Value
----------------|----------------
Host | 127.0.0.1
Port | 2222
Username | vagrant
Password | vagrant

View File

@ -139,10 +139,6 @@ passing the check results to Icinga 2.
remote sender to push check results into the Icinga 2 `ExternalCommandListener`
feature.
The [Icinga 2 Vagrant Demo VM](#vagrant) ships a demo integration and further samples.
## <a id="distributed-monitoring-high-availability"></a> Distributed Monitoring and High Availability
An Icinga 2 cluster consists of two or more nodes and can reside on multiple

View File

@ -19,7 +19,10 @@ SSH_OPTIONS="-o PasswordAuthentication=no"
SSH="ssh $SSH_OPTIONS $user@$host"
$SSH "mkdir /vagrant"
scp -qr ../../.vagrant-puppet $user@$host:/vagrant
# TODO clone git and use the icinga2x puppet modules
git clone git://git.icinga.org/icinga-vagrant.git
scp -qr icinga-vagrant/icinga2x/.vagrant-puppet $user@$host:/vagrant
rm -rf icinga-vagrant
$SSH "useradd vagrant"
$SSH "su -c 'mkdir -p -m 0700 ~/.ssh' vagrant"