Skip to content

Make paths configurable for pnp4nagios #145

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

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
7 changes: 5 additions & 2 deletions manifests/pnp4nagios.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
$nagios_command_line = '/usr/libexec/pnp4nagios/process_perfdata.pl --bulk',
$nagios_service_name = 'pnp4nagios-service',
$nagios_service_action_url = '/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$',
$nagios_html_base_path = '/usr/share/nagios/html',
$perflog = '/var/log/pnp4nagios/service-perfdata',
# The apache config snippet
$apache_httpd = true,
$apache_httpd_conf_content = undef,
$apache_httpd_conf_source = undef,
$apache_httpd_conf_file = '/etc/httpd/conf.d/pnp4nagios.conf',
$apache_httpd_alias_path = '/pnp4nagios',
# Other
Boolean $selinux = true,
$html_base_path = '/usr/share/nagios/html/pnp4nagios',
$ssi = false
) {

Expand Down Expand Up @@ -70,9 +73,9 @@
# https://docs.pnp4nagios.org/pnp-0.6/webfe
# Content from /usr/share/doc/pnp4nagios-0.6.25/contrib/ssi/status-header.ssi
if $ssi {
file { '/usr/share/nagios/html/ssi/common-header.ssi':
file { "${nagios_html_base_path}/ssi/common-header.ssi":
ensure => 'present',
source => "puppet:///modules/${module_name}/pnp4nagios/common-header.ssi",
content => template("${module_name}/pnp4nagios/common-header.ssi.erb"),
require => Package['nagios'],
}
}
Expand Down
4 changes: 2 additions & 2 deletions templates/apache_httpd/httpd-pnp4nagios.conf.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER

Alias /pnp4nagios "/usr/share/nagios/html/pnp4nagios"
Alias <%= @apache_httpd_alias_path %> "<%= @html_base_path %>"

<Directory "/usr/share/nagios/html/pnp4nagios">
<Directory "<%= @html_base_path %>">
AllowOverride None
<% if !@apache_allowed_from.empty? -%>
Order Deny,Allow
Expand Down
9 changes: 9 additions & 0 deletions templates/pnp4nagios/common-header.ssi.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<%# vim: set ts=8 sw=2 tw=0 et ft=eruby.html :%>
<script src="<%= @apache_httpd_alias_path %>/media/js/jquery-min.js" type="text/javascript"></script>
<script src="<%= @apache_httpd_alias_path %>/media/js/jquery.cluetip.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery('a.tips').cluetip({ajaxCache: false, dropShadow: false,showTitle: false });
});
</script>