Skip to content

Commit

Permalink
version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
eumel8 committed Oct 30, 2013
1 parent 9694005 commit 4be51c0
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 26 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions files/icinga/apache2.conf
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# apache configuration for icinga

ScriptAlias /cgi-bin/icinga /usr/lib/cgi-bin/icinga
ScriptAlias /icinga/cgi-bin /usr/lib/cgi-bin/icinga
ScriptAlias /cgi-bin/icinga /usr/lib/icinga/cgi
ScriptAlias /icinga/cgi-bin /usr/lib/icinga/cgi

# Where the stylesheets (config files) reside
Alias /icinga/stylesheets /usr/share/icinga/htdocs/stylesheets

# Where the HTML pages live
Alias /icinga /usr/share/icinga/htdocs

<DirectoryMatch (/usr/share/icinga/htdocs|/usr/lib/cgi-bin/icinga)>
<DirectoryMatch (/usr/share/icinga/htdocs|/usr/lib/icinga/cgi)>
Options FollowSymLinks

DirectoryIndex index.html
Expand Down
4 changes: 4 additions & 0 deletions manifests/nrpe.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
}
}

package { 'nagios-plugins-mem':
ensure => present,
}

package { 'nagios-plugins':
ensure => present,
}
Expand Down
50 changes: 33 additions & 17 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
package { 'nagios':
ensure => present,
}
package { 'nagios-plugins-nrpe':
ensure => present,
}
service { 'nagios':
ensure => running,
enable => true,
Expand All @@ -69,6 +72,9 @@
ensure => present,
alias => 'nagios',
}
package { 'nagios-plugins-nrpe':
ensure => present,
}
service { 'nagios3':
ensure => running,
enable => true,
Expand Down Expand Up @@ -193,17 +199,17 @@
mode => '0755',
force => true;

'/etc/apache2':
ensure => directory;

'/etc/apache2/conf.d':
ensure => directory,
require => File['/etc/apache2'];

# '/etc/apache2':
# ensure => directory;
#
# '/etc/apache2/conf.d':
# ensure => directory,
# require => File['/etc/apache2'];
#
'/etc/apache2/conf.d/nagios.conf':
ensure => 'link',
target => '/etc/nagios/apache2.conf',
require => File['/etc/apache2/conf.d'];
# require => File['/etc/apache2/conf.d'];
}
}

Expand Down Expand Up @@ -246,6 +252,9 @@
ensure => installed,
alias => 'icinga',
}
package { 'nagios-plugins-nrpe':
ensure => present,
}

service {
'icinga':
Expand All @@ -260,6 +269,13 @@
'/usr/share/icinga':
ensure => directory;

'/var/lib/icinga/':
ensure => directory,
require => Package[icinga],
owner => nagios,
group => nagios,
mode => '0755';

'/var/cache/icinga/':
ensure => directory,
require => Package[icinga],
Expand All @@ -274,7 +290,7 @@
group => nagios,
mode => '0750';

'/var/lib/nagios/rw':
'/var/lib/icinga/rw':
ensure => directory,
require => Package[icinga],
owner => nagios,
Expand Down Expand Up @@ -356,17 +372,17 @@
require => Package['icinga'],
notify => Service['icinga'];

'/etc/apache2':
ensure => directory;

'/etc/apache2/conf.d':
ensure => directory,
require => File['/etc/apache2'];
# '/etc/apache2':
# ensure => directory;
#
# '/etc/apache2/conf.d':
# ensure => directory,
# require => File['/etc/apache2'];

'/etc/apache2/conf.d/icinga.conf':
ensure => 'link',
target => '/etc/icinga/apache2.conf',
require => File['/etc/apache2/conf.d'];
target => '/etc/icinga/apache2.conf';
# require => File['/etc/apache2/conf.d'];
}
}
default: {
Expand Down
8 changes: 4 additions & 4 deletions templates/collect_checks_pl.erb
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ open(NS,$ns) || "cant start $ns: $!";
print CFG "define service {\n";
print CFG " use cloud-service\n";
print CFG " host_name <%= fqdn %>\n";
print CFG " service_description Service Net $process\n";
print CFG " service_description Service Net $port $process\n";
print CFG " check_command check_tcp!$port\n";
print CFG "}\n";
} elsif (($service =~ /127.0.0.1/) && ($port)) {
print NRP "command[check_net_$process]=/usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p $port -w 5 -c 10 \n";
print NRP "command[check_net_".$port."_".$process."]=/usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p $port -w 5 -c 10 \n";
print CFG "define service {\n";
print CFG " use cloud-service\n";
print CFG " host_name <%= fqdn %>\n";
print CFG " service_description Localservice Net $process\n";
print CFG " check_command check_nrpe_1arg!check_net_$process\n";
print CFG " service_description Localservice Net $port $process\n";
print CFG " check_command check_nrpe_1arg!check_net_".$port."_".$process."\n";
print CFG "}\n";
}
}
Expand Down
4 changes: 2 additions & 2 deletions templates/icinga/icinga_cfg.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ status_update_interval=10
icinga_user=nagios
icinga_group=nagios

check_external_commands=0
check_external_commands=1
command_check_interval=-1
command_file=/var/lib/icinga/rw/icinga.cmd
external_command_buffer_slots=4096
Expand Down Expand Up @@ -134,7 +134,7 @@ high_host_flap_threshold=20.0

date_format=iso8601

p1_file=/usr/lib/icinga/p1.pl
p1_file=/usr/share/icinga/p1.pl

enable_embedded_perl=1
use_embedded_perl_implicitly=1
Expand Down

0 comments on commit 4be51c0

Please sign in to comment.