Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple fix #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions manifests/config/server/common.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
purge => true,
}

file{"${::icinga::confdir_server}/stylesheets":
recurse => true,
}

file{"${::icinga::confdir_server}/resource.cfg":
ensure => file,
content => template('icinga/common/resource.cfg.erb'),
Expand Down
7 changes: 7 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@
$process_service_perfdata_file = $::icinga::params::process_service_perfdata_file,
$service_perfdata_file_template = $::icinga::params::service_perfdata_file_template,
$service_perfdata_file_processing_interval = $::icinga::params::service_perfdata_file_processing_interval,
$idoutils_pkg = $::icinga::params::idoutils_pkg,
$idoutils_confdir = $::icinga::params::idoutils_confdir,
$idoutils_service = $::icinga::params::idoutils_service,
$idoutils_dbname = $::icinga::params::idoutils_dbname,
$idoutils_dbuser = $::icinga::params::idoutils_dbuser,
$idoutils_dbpass = $::icinga::params::idoutils_dbpass,
$idoutils_clear_tables_at_startup = $::icinga::params::idoutils_clear_tables_at_startup,
) inherits icinga::params {

# Some safety nets
Expand Down
6 changes: 6 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
$idoutils_dbname = 'icinga'
$idoutils_dbuser = 'icinga'
$idoutils_dbpass = 'icinga'
$idoutils_lock_file = '/var/run/icinga/ido2db.pid'
$idoutils_socket_name = '/var/lib/icinga/ido.sock'
$idoutils_clear_tables_at_startup = 1

# Plugin: Report
$jasper_vhost = '/etc/apache2/conf.d/jasperserver.conf'
Expand Down Expand Up @@ -168,6 +171,9 @@
$idoutils_dbname = 'icinga'
$idoutils_dbuser = 'icinga'
$idoutils_dbpass = 'icinga'
$idoutils_lock_file = '/var/run/ido2db.pid'
$idoutils_socket_name = '/var/spool/icinga/ido.sock'
$idoutils_clear_tables_at_startup = 1

# Plugin: Report
$jasper_vhost = '/etc/httpd/conf.d/jasperserver.conf'
Expand Down
7 changes: 5 additions & 2 deletions manifests/plugins/checkmem.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
$max_check_attempts = $::icinga::max_check_attempts,
$notification_period = $::icinga::notification_period,
$notifications_enabled = $::icinga::notifications_enabled,
$mem_package = [ 'nagios-plugins-mem' ],
) inherits icinga {

if $icinga::client {
package{'nagios-plugins-mem':
ensure => 'present',
if $mem_package {
package{'nagios-plugins-mem':
ensure => 'present',
}
}

@@nagios_service{"check_mem_${::fqdn}":
Expand Down
36 changes: 18 additions & 18 deletions manifests/plugins/idoutils/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@
"${::icinga::confdir_server}/idomod.cfg":
content => template('icinga/plugins/idoutils/idomod.cfg');

"${::icinga::idoutils_confdir}/mysql/icinga-web-priv.sql":
content => template('icinga/plugins/idoutils/icinga-web-priv.sql.erb'),
require => Mysqldb[$icinga::idoutils_dbname];
# "${::icinga::idoutils_confdir}/mysql/icinga-web-priv.sql":
# content => template('icinga/plugins/idoutils/icinga-web-priv.sql.erb'),
# require => Mysqldb[$icinga::idoutils_dbname];
}

Exec {
require => [
Package[$icinga::idoutils_pkg],
File["${::icinga::idoutils_confdir}/mysql/icinga-web-priv.sql"]
],
}

exec {
'icinga-db-priv':
command => "/usr/bin/mysql -u ${::icinga::idoutils_dbuser} --password=${::icinga::idoutils_dbpass} ${::icinga::idoutils_dbname} < ${::icinga::idoutils_confdir}/mysql/icinga-web-priv.sql",
unless => "/usr/bin/mysql -e \"select * from information_schema.user_privileges\" | grep ${::icinga::idoutils_dbname}";
'icinga-db-tables':
command => "/usr/bin/mysql -u ${::icinga::idoutils_dbuser} --password=${::icinga::idoutils_dbpass} ${::icinga::idoutils_dbname} < ${::icinga::idoutils_confdir}/mysql/mysql.sql",
unless => "/usr/bin/mysqlshow ${::icinga::idoutils_dbname} | grep icinga_contacts",
}
# Exec {
# require => [
# Package[$icinga::idoutils_pkg],
# File["${::icinga::idoutils_confdir}/mysql/icinga-web-priv.sql"]
# ],
# }

# exec {
# 'icinga-db-priv':
# command => "/usr/bin/mysql -u ${::icinga::idoutils_dbuser} --password=${::icinga::idoutils_dbpass} ${::icinga::idoutils_dbname} < ${::icinga::idoutils_confdir}/mysql/icinga-web-priv.sql",
# unless => "/usr/bin/mysql -e \"select * from information_schema.user_privileges\" | grep ${::icinga::idoutils_dbname}";
# 'icinga-db-tables':
# command => "/usr/bin/mysql -u ${::icinga::idoutils_dbuser} --password=${::icinga::idoutils_dbpass} ${::icinga::idoutils_dbname} < ${::icinga::idoutils_confdir}/mysql/mysql.sql",
# unless => "/usr/bin/mysqlshow ${::icinga::idoutils_dbname} | grep icinga_contacts",
# }
}
4 changes: 2 additions & 2 deletions templates/common/nrpe.cfg.erb
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ include_dir=<%= scope.lookupvar('icinga::includedir_client') %>
# The following examples use hardcoded command arguments...

command[check_users]=<%= scope.lookupvar('icinga::usrlib') %>/nagios/plugins/check_users -w 5 -c 10
command[check_disk]=<%= scope.lookupvar('icinga::usrlib') %>/nagios/plugins/check_disk -w 20% -c 10%
command[check_disk]=<%= scope.lookupvar('icinga::usrlib') %>/nagios/plugins/check_disk -w 15% -c 10%
command[check_zombie_procs]=<%= scope.lookupvar('icinga::usrlib') %>/nagios/plugins/check_procs -w 5 -c 10 -s Z
<% if scope.lookupvar('icinga::nrpe_allow_arguments') == '1' -%>
command[check_total_procs]=<%= scope.lookupvar('icinga::usrlib') %>/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$
<% else -%>
command[check_total_procs]=<%= scope.lookupvar('icinga::usrlib') %>/nagios/plugins/check_procs -w <%= scope.lookupvar('icinga::params::checktotalprocs_warning_level') %> -c <%= scope.lookupvar('icinga::params::checktotalprocs_critical_level') %>
<% end -%>
command[check_mem]=<%= scope.lookupvar('icinga::usrlib') %>/nagios/plugins/check_mem -w 90,25 -c 95,50
command[check_ping]=<%= scope.lookupvar('icinga::usrlib') %>/nagios/plugins/check_ping -H $ARG1$ -4 -w $ARG2$ -c $ARG3$ -p 5
command[check_ping]=<%= scope.lookupvar('icinga::usrlib') %>/nagios/plugins/check_ping -H $ARG1$ -4 -w $ARG2$ -c $ARG3$ -p 5
14 changes: 7 additions & 7 deletions templates/debian/cgi.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ use_ssl_authentication=0
# Alternatively you can specify contactgroups too, starting
# with Icinga 1.5.0

authorized_for_system_information=<%= scope.lookupvar('icinga::icinga_admins') %>
authorized_for_system_information=<%= scope.lookupvar('icinga::icinga_admins').join(",") %>


# CONFIGURATION INFORMATION ACCESS
Expand All @@ -144,7 +144,7 @@ authorized_for_system_information=<%= scope.lookupvar('icinga::icinga_admins') %
# Alternatively you can specify contactgroups too, starting
# with Icinga 1.5.0

authorized_for_configuration_information=<%= scope.lookupvar('icinga::icinga_admins') %>
authorized_for_configuration_information=<%= scope.lookupvar('icinga::icinga_admins').join(",") %>


# SYSTEM/PROCESS COMMAND ACCESS
Expand All @@ -158,7 +158,7 @@ authorized_for_configuration_information=<%= scope.lookupvar('icinga::icinga_adm
# Alternatively you can specify contactgroups too, starting
# with Icinga 1.5.0

authorized_for_system_commands=<%= scope.lookupvar('icinga::icinga_admins') %>
authorized_for_system_commands=<%= scope.lookupvar('icinga::icinga_admins').join(",") %>


# GLOBAL HOST/SERVICE VIEW ACCESS
Expand All @@ -172,8 +172,8 @@ authorized_for_system_commands=<%= scope.lookupvar('icinga::icinga_admins') %>
# with Icinga 1.5.0


authorized_for_all_services=<%= scope.lookupvar('icinga::icinga_admins') %>
authorized_for_all_hosts=<%= scope.lookupvar('icinga::icinga_admins') %>
authorized_for_all_services=<%= scope.lookupvar('icinga::icinga_admins').join(",") %>
authorized_for_all_hosts=<%= scope.lookupvar('icinga::icinga_admins').join(",") %>


# GLOBAL HOST/SERVICE COMMAND ACCESS
Expand All @@ -187,8 +187,8 @@ authorized_for_all_hosts=<%= scope.lookupvar('icinga::icinga_admins') %>
# Alternatively you can specify contactgroups too, starting
# with Icinga 1.5.0

authorized_for_all_service_commands=<%= scope.lookupvar('icinga::icinga_admins') %>
authorized_for_all_host_commands=<%= scope.lookupvar('icinga::icinga_admins') %>
authorized_for_all_service_commands=<%= scope.lookupvar('icinga::icinga_admins').join(",") %>
authorized_for_all_host_commands=<%= scope.lookupvar('icinga::icinga_admins').join(",") %>



Expand Down
4 changes: 2 additions & 2 deletions templates/debian/icinga.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ event_broker_options=-1

# Uncomment this to enable idomod.o
# Don't forget to also enable the daemon in /etc/default/icinga
#broker_module=/usr/lib/icinga/idomod.o config_file=/etc/icinga/idomod.cfg
broker_module=/usr/lib/icinga/idomod.so config_file=/etc/icinga/idomod.cfg

# LOG ROTATION METHOD
# This is the log rotation method that Icinga should use to rotate
Expand Down Expand Up @@ -1132,7 +1132,7 @@ high_host_flap_threshold=20.0
# strict-iso8601 (YYYY-MM-DDTHH:MM:SS)
#

date_format=us
date_format=strict-iso8601



Expand Down
9 changes: 4 additions & 5 deletions templates/plugins/idoutils/ido2db.cfg.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# This is the lockfile that IDO2DB will use to store its PID number
# in when it is running in daemon mode.

lock_file=/var/run/ido2db.pid
lock_file=<%= scope.lookupvar('icinga::idoutils_lock_file') %>



Expand Down Expand Up @@ -44,7 +44,7 @@ socket_type=unix
# This option is only valid if the socket type specified above
# is "unix".

socket_name=/var/spool/icinga/ido.sock
socket_name=<%= scope.lookupvar('icinga::idoutils_socket_name') %>


# SOCKET PERMISSIONS
Expand Down Expand Up @@ -131,7 +131,6 @@ db_port=3306
#db_socket=/var/lib/mysql/mysql.sock



# DATABASE NAME
# This option specifies the name of the database that should be used.
#
Expand Down Expand Up @@ -214,7 +213,7 @@ max_acknowledgements_age=44640
# Values: 0 - don't clean
# 1 - clean (default)

clean_realtime_tables_on_core_startup=1
clean_realtime_tables_on_core_startup=<%= scope.lookupvar('icinga::idoutils_clear_tables_at_startup') %>


## CLEAN CONFIG TABLES AT CORE STARTUP
Expand All @@ -226,7 +225,7 @@ clean_realtime_tables_on_core_startup=1
# Values: 0 - don't clean
# 1 - clean (default)

clean_config_tables_on_core_startup=1
clean_config_tables_on_core_startup=<%= scope.lookupvar('icinga::idoutils_clear_tables_at_startup') %>


# ***EXPERIMENTAL*** DB TRIMMING INTERVAL
Expand Down
6 changes: 3 additions & 3 deletions templates/plugins/idoutils/idomod.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ output_type=unixsocket

#output=/var/icinga/ido.dat
#output=127.0.0.1
output=/var/icinga/ido.sock
output=/var/lib/icinga/ido.sock



Expand Down Expand Up @@ -80,7 +80,7 @@ output_buffer_items=5000
# Icinga (re)starts, the IDO NEB module will read the contents of this
# file and send it to the IDO2DB daemon for processing.

buffer_file=/var/icinga/idomod.tmp
buffer_file=/var/lib/icinga/idomod.tmp



Expand Down Expand Up @@ -236,7 +236,7 @@ debug_verbosity=1
# DEBUG FILE
# This option determines where the daemon should write debugging information.

debug_file=/var/icinga/idomod.debug
debug_file=/var/log/icinga/idomod.debug



Expand Down