Skip to content

Commit f71390d

Browse files
committed
Make paths configurable for pnp4nagios
1 parent 3505519 commit f71390d

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

manifests/pnp4nagios.pp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@
55
$nagios_command_line = '/usr/libexec/pnp4nagios/process_perfdata.pl --bulk',
66
$nagios_service_name = 'pnp4nagios-service',
77
$nagios_service_action_url = '/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$',
8+
$nagios_html_base_path = '/usr/share/nagios/html',
89
$perflog = '/var/log/pnp4nagios/service-perfdata',
910
# The apache config snippet
1011
$apache_httpd = true,
1112
$apache_httpd_conf_content = undef,
1213
$apache_httpd_conf_source = undef,
1314
$apache_httpd_conf_file = '/etc/httpd/conf.d/pnp4nagios.conf',
15+
$apache_httpd_alias_path = '/pnp4nagios',
1416
# Other
17+
$html_base_path = '/usr/share/nagios/html/pnp4nagios',
1518
$ssi = false
1619
) {
1720

@@ -61,9 +64,9 @@
6164
# https://docs.pnp4nagios.org/pnp-0.6/webfe
6265
# Content from /usr/share/doc/pnp4nagios-0.6.25/contrib/ssi/status-header.ssi
6366
if $ssi {
64-
file { '/usr/share/nagios/html/ssi/common-header.ssi':
67+
file { "${nagios_html_base_path}/ssi/common-header.ssi":
6568
ensure => 'present',
66-
source => "puppet:///modules/${module_name}/pnp4nagios/common-header.ssi",
69+
content => template("${module_name}/pnp4nagios/common-header.ssi.erb"),
6770
require => Package['nagios'],
6871
}
6972
}

templates/apache_httpd/httpd-pnp4nagios.conf.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
22

3-
Alias /pnp4nagios "/usr/share/nagios/html/pnp4nagios"
3+
Alias <%= @apache_httpd_alias_path %> "<%= @html_base_path %>"
44

5-
<Directory "/usr/share/nagios/html/pnp4nagios">
5+
<Directory "<%= @html_base_path %>">
66
AllowOverride None
77
<% if !@apache_allowed_from.empty? -%>
88
Order Deny,Allow
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<%# vim: set ts=8 sw=2 tw=0 et ft=eruby.html :%>
2+
<script src="<%= @apache_httpd_alias_path %>/media/js/jquery-min.js" type="text/javascript"></script>
3+
<script src="<%= @apache_httpd_alias_path %>/media/js/jquery.cluetip.js" type="text/javascript"></script>
4+
<script type="text/javascript">
5+
jQuery.noConflict();
6+
jQuery(document).ready(function() {
7+
jQuery('a.tips').cluetip({ajaxCache: false, dropShadow: false,showTitle: false });
8+
});
9+
</script>

0 commit comments

Comments
 (0)