Skip to content

Commit

Permalink
Make paths configurable for pnp4nagios
Browse files Browse the repository at this point in the history
  • Loading branch information
towo committed Feb 13, 2019
1 parent 3505519 commit f71390d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 5 additions & 2 deletions manifests/pnp4nagios.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
$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
$html_base_path = '/usr/share/nagios/html/pnp4nagios',
$ssi = false
) {

Expand Down Expand Up @@ -61,9 +64,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>

0 comments on commit f71390d

Please sign in to comment.