From 124754b2fe6cfcc88b4f4c02ca690f141511bae2 Mon Sep 17 00:00:00 2001 From: varac Date: Sat, 23 Oct 2010 02:55:17 +0200 Subject: basic pnp4nagios grapher integration --- README | 19 +++++++++++++++++ files/pnp4nagios/pnp4nagios-popup-templates.cfg | 14 +++++++++++++ files/pnp4nagios/pnp4nagios-templates.cfg | 14 +++++++++++++ files/pnp4nagios/status-header.ssi | 8 ++++++++ manifests/defaults/pnp4nagios.pp | 27 +++++++++++++++++++++++++ manifests/pnp4nagios.pp | 17 ++++++++++++++++ manifests/pnp4nagios/popup.pp | 17 ++++++++++++++++ 7 files changed, 116 insertions(+) create mode 100644 files/pnp4nagios/pnp4nagios-popup-templates.cfg create mode 100644 files/pnp4nagios/pnp4nagios-templates.cfg create mode 100644 files/pnp4nagios/status-header.ssi create mode 100644 manifests/defaults/pnp4nagios.pp create mode 100644 manifests/pnp4nagios.pp create mode 100644 manifests/pnp4nagios/popup.pp diff --git a/README b/README index de1294d..47f17a9 100644 --- a/README +++ b/README @@ -213,6 +213,25 @@ Options to change the behavior of the nagios module: 'notice' if you would prefer them to be sent as IRC NOTICE messages. +PNP4Nagios integration +====================== +Currently, there are no pnp4nagios debian packages - you need to install pnp4nagios +from source. See http://docs.pnp4nagios.org/pnp-0.6/start for installation notes. +Integration in the nagios/icinga webinterface is configured by including either the +nagios::pnp4nagios or the nagios::pnp4nagios::popup class, the later one includes +fancy popups when you hoover over the extra service action image. +For hosts you need to use the host-pnp definition, for services the srv-pnp def. +i.e. + + @@nagios_service { "ping_example_node": + use => "generic-service,srv-pnp", + ... + + nagios_host { 'example_node': + use => 'generic-host,host-pnp', + ... + + Examples ======== diff --git a/files/pnp4nagios/pnp4nagios-popup-templates.cfg b/files/pnp4nagios/pnp4nagios-popup-templates.cfg new file mode 100644 index 0000000..0035c63 --- /dev/null +++ b/files/pnp4nagios/pnp4nagios-popup-templates.cfg @@ -0,0 +1,14 @@ +# http://docs.pnp4nagios.org/de/pnp-0.6/webfe + +define host { + name host-pnp + action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_ + register 0 +} + +define service { + name srv-pnp + action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$' class='tips' rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$ + register 0 +} + diff --git a/files/pnp4nagios/pnp4nagios-templates.cfg b/files/pnp4nagios/pnp4nagios-templates.cfg new file mode 100644 index 0000000..14b60c9 --- /dev/null +++ b/files/pnp4nagios/pnp4nagios-templates.cfg @@ -0,0 +1,14 @@ +# http://docs.pnp4nagios.org/de/pnp-0.6/webfe + +define host { + name host-pnp + action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_ + register 0 +} + +define service { + name srv-pnp + action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$ + register 0 +} + diff --git a/files/pnp4nagios/status-header.ssi b/files/pnp4nagios/status-header.ssi new file mode 100644 index 0000000..472be3a --- /dev/null +++ b/files/pnp4nagios/status-header.ssi @@ -0,0 +1,8 @@ + + + + diff --git a/manifests/defaults/pnp4nagios.pp b/manifests/defaults/pnp4nagios.pp new file mode 100644 index 0000000..f6556c9 --- /dev/null +++ b/manifests/defaults/pnp4nagios.pp @@ -0,0 +1,27 @@ +class nagios::defaults::pnp4nagios { + # performance data cmds + # http://docs.pnp4nagios.org/de/pnp-0.6/config#bulk_mode_mit_npcd + nagios_command { + 'process-service-perfdata-file-pnp4nagios-bulk-npcd': + command_line => '/bin/mv /var/lib/nagios3/service-perfdata /var/spool/pnp4nagios/npcd/service-perfdata.$TIMET$'; + 'process-host-perfdata-file-pnp4nagios-bulk-npcd': + command_line => '/bin/mv /var/lib/nagios3/host-perfdata /var/spool/pnp4nagios/npcd/host-perfdata.$TIMET$' + } + + # nagios host templates + # http://docs.pnp4nagios.org/de/pnp-0.6/webfe + + # this doesn't work, see manifests/pnp4nagios.pp + #nagios_host { 'host-pnp': + # action_url => '/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_', + # register => 0, + # #ensure => absent; + #} + + #nagios_service { 'service-pnp': + # #naginatorname => 'service-pnp', + # action_url => '/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$', + # register => 0, + # ensure => absent; + #} +} diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp new file mode 100644 index 0000000..051bad8 --- /dev/null +++ b/manifests/pnp4nagios.pp @@ -0,0 +1,17 @@ +class nagios::pnp4nagios { + include nagios::defaults::pnp4nagios + + package { [php5, php5-gd, rrdcollect, rrdtool, librrdp-perl, librrds-perl ]: + ensure => installed } + + + # unfortunatly i didn't find a way to use nagios_host and nagios_service definition, because + # imho puppet can't handle the "name" variable needed in these 2 definitions + # so we need to copy a file here. + + file { 'pnp4nagios-templates.cfg': + path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg", + source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg", + "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ] + } +} diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp new file mode 100644 index 0000000..372fe3b --- /dev/null +++ b/manifests/pnp4nagios/popup.pp @@ -0,0 +1,17 @@ +class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { + File['pnp4nagios-templates.cfg']{ + path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg", + source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg", + "puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg" ] + } + + file { "/usr/share/$nagios::nagios_packagename/htdocs/ssi": + ensure => directory } + + file { 'status-header.ssi': + path => "/usr/share/$nagios::nagios_packagename/htdocs/ssi/status-header.ssi", + source => [ "puppet:///modules/site-nagios/pnp4nagios/status-header.ssi", + "puppet:///modules/nagios/pnp4nagios/status-header.ssi" ] + } + +} -- cgit v1.2.3 From e412a2f09450c2ed19034619ae7d75c32d58b436 Mon Sep 17 00:00:00 2001 From: nadir Date: Sat, 23 Oct 2010 16:28:19 +0200 Subject: possibility to deploy a custom pnp4nagios apache config --- manifests/pnp4nagios.pp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 051bad8..9fa4d63 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -14,4 +14,14 @@ class nagios::pnp4nagios { source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg", "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ] } + + file { 'apache.conf': + path => "/etc/pnp4nagios/apache.conf", + source => [ "puppet:///modules/site-nagios/pnp4nagios/apache.conf", + "puppet:///modules/nagios/configs/apache.conf" + ], + notify => Service['apache'], + } + + } -- cgit v1.2.3 From c36e67271c428c15e7d7381c61d225e54ec92411 Mon Sep 17 00:00:00 2001 From: nadir Date: Sat, 23 Oct 2010 16:28:49 +0200 Subject: standard pnp4nagios apache config --- files/pnp4nagios/apache.conf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 files/pnp4nagios/apache.conf diff --git a/files/pnp4nagios/apache.conf b/files/pnp4nagios/apache.conf new file mode 100644 index 0000000..8f66756 --- /dev/null +++ b/files/pnp4nagios/apache.conf @@ -0,0 +1,30 @@ +# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER + +Alias /pnp4nagios "/usr/share/pnp4nagios/html" + + + AllowOverride None + Order allow,deny + Allow from all + # + # Use the same value as defined in nagios.conf + # + AuthName "Nagios Access" + AuthType Basic + AuthUserFile /etc/nagios3/htpasswd.users + Require valid-user + + # Turn on URL rewriting + RewriteEngine On + Options FollowSymLinks + # Installation directory + RewriteBase /pnp4nagios/ + # Protect application and system files from being viewed + RewriteRule ^(application|modules|system) - [F,L] + # Allow any files or directories that exist to be displayed directly + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + # Rewrite all other URLs to index.php/URL + RewriteRule .* index.php/$0 [PT,L] + + -- cgit v1.2.3 From 30337269f48857c324589dbdbf6dfa0096fcd56f Mon Sep 17 00:00:00 2001 From: nadir Date: Sun, 12 Dec 2010 18:32:41 +0100 Subject: added pnp-grapher templates for explicit use --- files/pnp4nagios/pnp4nagios-popup-templates.cfg | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/files/pnp4nagios/pnp4nagios-popup-templates.cfg b/files/pnp4nagios/pnp4nagios-popup-templates.cfg index 0035c63..de17d84 100644 --- a/files/pnp4nagios/pnp4nagios-popup-templates.cfg +++ b/files/pnp4nagios/pnp4nagios-popup-templates.cfg @@ -12,3 +12,20 @@ define service { register 0 } +# templates for explicit use, i.e. +# use => 'generic-host-pnp' + +define host { + name generic-host-pnp + use generic-host,host-pnp +# action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_ + register 0 +} + +define service { + name generic-service-pnp + use generic-service,srv-pnp +# action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_ + register 0 +} + -- cgit v1.2.3 From bcfbd90706c691d846835cf5ea95969845d48330 Mon Sep 17 00:00:00 2001 From: nadir Date: Sun, 12 Dec 2010 18:35:08 +0100 Subject: added pnp-grapher templates for explicit use --- files/pnp4nagios/pnp4nagios-templates.cfg | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/files/pnp4nagios/pnp4nagios-templates.cfg b/files/pnp4nagios/pnp4nagios-templates.cfg index 14b60c9..64c5186 100644 --- a/files/pnp4nagios/pnp4nagios-templates.cfg +++ b/files/pnp4nagios/pnp4nagios-templates.cfg @@ -1,5 +1,7 @@ # http://docs.pnp4nagios.org/de/pnp-0.6/webfe +# templates for additional use, i.e. +# use => 'generic-host,host-pnp' define host { name host-pnp action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_ @@ -12,3 +14,20 @@ define service { register 0 } +# templates for explicit use, i.e. +# use => 'generic-host-pnp' + +define host { + name generic-host-pnp + use generic-host,host-pnp +# action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_ + register 0 +} + +define service { + name generic-service-pnp + use generic-service,srv-pnp +# action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_ + register 0 +} + -- cgit v1.2.3 From b66c7f897f269d6df95214f7f865501d8f59fc95 Mon Sep 17 00:00:00 2001 From: nadir Date: Tue, 10 Jan 2012 00:20:46 +0100 Subject: added icon for pnp4nagios --- images/nagiosgraph.gif | Bin 0 -> 1252 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 images/nagiosgraph.gif diff --git a/images/nagiosgraph.gif b/images/nagiosgraph.gif new file mode 100644 index 0000000..068082a Binary files /dev/null and b/images/nagiosgraph.gif differ -- cgit v1.2.3 From 8d628310894fd954ddc643932a621f078d874cd9 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 13 Feb 2012 10:40:00 +0100 Subject: README.pnp4nagios --- README.pnp4nagios | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 README.pnp4nagios diff --git a/README.pnp4nagios b/README.pnp4nagios new file mode 100644 index 0000000..76a7d07 --- /dev/null +++ b/README.pnp4nagios @@ -0,0 +1,47 @@ +PNP4Nagios integration +====================== + +As of 2012/01 debian packages for pnp4nagios are availible from lenny-backports on. + +In the default config files the "Bulk Mode with NPCD" is used +(see http://docs.pnp4nagios.org/en/pnp-0.6/config for more infos about the different +modes). + +Include the nagios::pnp4nagios::popup class for fancy popups when you hoover over +the extra service action image. + + +Please include this in your nagios.cfg: + +#http://docs.pnp4nagios.org/en/pnp-0.6/config#bulk_mode_mit_npcd +# +# Service Performance-Data +# +service_perfdata_file=/var/lib/nagios3/service-perfdata +service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$ +service_perfdata_file_mode=a +service_perfdata_file_processing_interval=15 +service_perfdata_file_processing_command=process-service-perfdata-file-pnp4nagios-bulk-npcd + +# +# Host Performance-Data +# +host_perfdata_file=/var/lib/nagios3/host-perfdata +host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$ +host_perfdata_file_mode=a +host_perfdata_file_processing_interval=15 +host_perfdata_file_processing_command=process-host-perfdata-file-pnp4nagios-bulk-npcd + + +For hosts you need to use the host-pnp definition, for services the srv-pnp def. +i.e. + + @@nagios_service { "ping_example_node": + use => "generic-service,srv-pnp", + ... + + nagios_host { 'example_node': + use => 'generic-host,host-pnp', + ... + + -- cgit v1.2.3 From 2924e23b6ed826bf22877978c6b9a430a6407a4b Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 18:34:10 +0200 Subject: corrected path to pnp4nagios apache.conf --- manifests/pnp4nagios.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 9fa4d63..3971f36 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -18,7 +18,7 @@ class nagios::pnp4nagios { file { 'apache.conf': path => "/etc/pnp4nagios/apache.conf", source => [ "puppet:///modules/site-nagios/pnp4nagios/apache.conf", - "puppet:///modules/nagios/configs/apache.conf" + "puppet:///modules/nagios/pnp4nagios/apache.conf" ], notify => Service['apache'], } -- cgit v1.2.3 From cfd48e24151d232a76461acea18795cb8725ca00 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 18:52:22 +0200 Subject: package pnp4nagios available now, fix permissions for config files --- manifests/pnp4nagios.pp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 3971f36..9026d3e 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -1,7 +1,7 @@ class nagios::pnp4nagios { include nagios::defaults::pnp4nagios - package { [php5, php5-gd, rrdcollect, rrdtool, librrdp-perl, librrds-perl ]: + package { pnp4nagios: ensure => installed } @@ -12,14 +12,15 @@ class nagios::pnp4nagios { file { 'pnp4nagios-templates.cfg': path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg", source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg", - "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ] + "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ], + mode => 0644, owner => root, group => root; } file { 'apache.conf': path => "/etc/pnp4nagios/apache.conf", source => [ "puppet:///modules/site-nagios/pnp4nagios/apache.conf", - "puppet:///modules/nagios/pnp4nagios/apache.conf" - ], + "puppet:///modules/nagios/pnp4nagios/apache.conf" ], + mode => 0644, owner => root, group => root; notify => Service['apache'], } -- cgit v1.2.3 From 17db655f6589ecf4d673b723f59dd04e5c22b170 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 19:00:31 +0200 Subject: typo --- manifests/pnp4nagios.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 9026d3e..f0df1ff 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -20,8 +20,8 @@ class nagios::pnp4nagios { path => "/etc/pnp4nagios/apache.conf", source => [ "puppet:///modules/site-nagios/pnp4nagios/apache.conf", "puppet:///modules/nagios/pnp4nagios/apache.conf" ], - mode => 0644, owner => root, group => root; - notify => Service['apache'], + mode => 0644, owner => root, group => root, + notify => Service['apache']; } -- cgit v1.2.3 From 3304733fa0b9bb1ddf49908c4d656fb472caa42c Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 19:41:20 +0200 Subject: configure pnp4nagios npcd --- files/pnp4nagios/npcd | 8 ++++++ manifests/pnp4nagios.pp | 65 +++++++++++++++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 24 deletions(-) create mode 100644 files/pnp4nagios/npcd diff --git a/files/pnp4nagios/npcd b/files/pnp4nagios/npcd new file mode 100644 index 0000000..64b3d4d --- /dev/null +++ b/files/pnp4nagios/npcd @@ -0,0 +1,8 @@ +# Default settings for the NPCD init script. + +# Should NPCD be started? ("yes" to enable) +RUN="yes" + +# Additional options that are passed to the daemon. +DAEMON_OPTS="-d -f /etc/pnp4nagios/npcd.cfg" + diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index f0df1ff..6ab6986 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -1,28 +1,45 @@ class nagios::pnp4nagios { - include nagios::defaults::pnp4nagios - - package { pnp4nagios: - ensure => installed } - - - # unfortunatly i didn't find a way to use nagios_host and nagios_service definition, because - # imho puppet can't handle the "name" variable needed in these 2 definitions - # so we need to copy a file here. - - file { 'pnp4nagios-templates.cfg': - path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg", - source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg", - "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ], - mode => 0644, owner => root, group => root; - } - - file { 'apache.conf': - path => "/etc/pnp4nagios/apache.conf", - source => [ "puppet:///modules/site-nagios/pnp4nagios/apache.conf", - "puppet:///modules/nagios/pnp4nagios/apache.conf" ], - mode => 0644, owner => root, group => root, - notify => Service['apache']; - } + include nagios::defaults::pnp4nagios + package { pnp4nagios: + ensure => installed } + + + # unfortunatly i didn't find a way to use nagios_host and nagios_service definition, because + # imho puppet can't handle the "name" variable needed in these 2 definitions + # so we need to copy a file here. + + file { 'pnp4nagios-templates.cfg': + path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg", + source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg", + "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ], + mode => 0644, owner => root, group => root; + } + + file { 'apache.conf': + path => "/etc/pnp4nagios/apache.conf", + source => [ "puppet:///modules/site-nagios/pnp4nagios/apache.conf", + "puppet:///modules/nagios/pnp4nagios/apache.conf" ], + mode => 0644, owner => root, group => root, + notify => Service['apache']; + } + + # run npcd as daemon + + file { '/etc/default/npcd': + path => "/etc/default/npcd", + source => [ "puppet:///modules/site-nagios/pnp4nagios/npcd", + "puppet:///modules/nagios/pnp4nagios/npcd" ], + mode => 0644, owner => root, group => root, + notify => Service['npcd']; + } + + service { 'npcd': + ensure => running, + enable => true, + hasstatus => true, + require => Package['npcd'], + } + } -- cgit v1.2.3 From 8d902141925b7890bb5c5d706ba7034cb0e42754 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 19:49:01 +0200 Subject: depend on pnp4nagios instead of npcd --- manifests/pnp4nagios.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 6ab6986..dd9b0c6 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -38,7 +38,7 @@ class nagios::pnp4nagios { ensure => running, enable => true, hasstatus => true, - require => Package['npcd'], + require => Package['pnp4nagios'], } -- cgit v1.2.3 From bc2068ee8514e7e90641d5016bf12bd1b4ce48c0 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 19:49:51 +0200 Subject: resolve nagios_cfgdir variable --- manifests/pnp4nagios/popup.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp index 372fe3b..46b346b 100644 --- a/manifests/pnp4nagios/popup.pp +++ b/manifests/pnp4nagios/popup.pp @@ -1,6 +1,6 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { File['pnp4nagios-templates.cfg']{ - path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg", + path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/pnp4nagios-templates.cfg", source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg", "puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg" ] } -- cgit v1.2.3 From 579b622e8f276b01ff0bc85c7828fb3dfb0b70ae Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 19:54:14 +0200 Subject: fixed conf file permissions, notify services --- manifests/pnp4nagios.pp | 1 + manifests/pnp4nagios/popup.pp | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index dd9b0c6..d97bb1e 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -14,6 +14,7 @@ class nagios::pnp4nagios { source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg", "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ], mode => 0644, owner => root, group => root; + notify => Service['nagios'], } file { 'apache.conf': diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp index 46b346b..bfbfae7 100644 --- a/manifests/pnp4nagios/popup.pp +++ b/manifests/pnp4nagios/popup.pp @@ -1,17 +1,20 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { - File['pnp4nagios-templates.cfg']{ - path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/pnp4nagios-templates.cfg", - source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg", - "puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg" ] - } + File['pnp4nagios-templates.cfg']{ + path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/pnp4nagios-templates.cfg", + source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg", + "puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg" ] + mode => 0644, owner => root, group => root; + notify => Service['nagios'], + } - file { "/usr/share/$nagios::nagios_packagename/htdocs/ssi": - ensure => directory } - - file { 'status-header.ssi': - path => "/usr/share/$nagios::nagios_packagename/htdocs/ssi/status-header.ssi", - source => [ "puppet:///modules/site-nagios/pnp4nagios/status-header.ssi", - "puppet:///modules/nagios/pnp4nagios/status-header.ssi" ] - } + file { "/usr/share/$nagios::nagios_packagename/htdocs/ssi": + ensure => directory } + file { 'status-header.ssi': + path => "/usr/share/$nagios::nagios_packagename/htdocs/ssi/status-header.ssi", + source => [ "puppet:///modules/site-nagios/pnp4nagios/status-header.ssi", + "puppet:///modules/nagios/pnp4nagios/status-header.ssi" ] + mode => 0644, owner => root, group => root; + notify => Service['nagios'], + } } -- cgit v1.2.3 From 3e58bf7e96fe1910fbf30b7a72c022ed02ec0e2e Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 20:10:33 +0200 Subject: typo --- manifests/pnp4nagios.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index d97bb1e..837c447 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -13,7 +13,7 @@ class nagios::pnp4nagios { path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg", source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg", "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ], - mode => 0644, owner => root, group => root; + mode => 0644, owner => root, group => root, notify => Service['nagios'], } -- cgit v1.2.3 From ab52e4a72985268419b8b04a487442975d51aca3 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 20:16:05 +0200 Subject: typos again --- manifests/pnp4nagios/popup.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp index bfbfae7..7921a29 100644 --- a/manifests/pnp4nagios/popup.pp +++ b/manifests/pnp4nagios/popup.pp @@ -2,8 +2,8 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { File['pnp4nagios-templates.cfg']{ path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/pnp4nagios-templates.cfg", source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg", - "puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg" ] - mode => 0644, owner => root, group => root; + "puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg" ], + mode => 0644, owner => root, group => root, notify => Service['nagios'], } @@ -13,8 +13,8 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { file { 'status-header.ssi': path => "/usr/share/$nagios::nagios_packagename/htdocs/ssi/status-header.ssi", source => [ "puppet:///modules/site-nagios/pnp4nagios/status-header.ssi", - "puppet:///modules/nagios/pnp4nagios/status-header.ssi" ] - mode => 0644, owner => root, group => root; + "puppet:///modules/nagios/pnp4nagios/status-header.ssi"], + mode => 0644, owner => root, group => root, notify => Service['nagios'], } } -- cgit v1.2.3 From bc4532eaa4450bcf84288c95f06ab7ae978ad072 Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 17 Sep 2012 22:46:00 +0200 Subject: use a graph style icon for action.gif --- files/pnp4nagios/action.gif | Bin 0 -> 1536 bytes manifests/pnp4nagios.pp | 10 ++++++++++ 2 files changed, 10 insertions(+) create mode 100644 files/pnp4nagios/action.gif diff --git a/files/pnp4nagios/action.gif b/files/pnp4nagios/action.gif new file mode 100644 index 0000000..96571a4 Binary files /dev/null and b/files/pnp4nagios/action.gif differ diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 837c447..1eb2bf7 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -42,5 +42,15 @@ class nagios::pnp4nagios { require => Package['pnp4nagios'], } + # modify action.gif + + file { '/usr/share/nagios3/htdocs/images/action.gif': + path => "/usr/share/nagios3/htdocs/images/action.gif", + source => [ "puppet:///modules/site-nagios/pnp4nagios/action.gif", + "puppet:///modules/nagios/pnp4nagios/action.gif" ], + mode => 0644, owner => root, group => root, + notify => Service['nagios']; + } + } -- cgit v1.2.3 From 715ea7b4473da8c44982ae866278da1654543d4d Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 18 Sep 2012 10:22:09 +0200 Subject: require pnp4nagios package for config file --- manifests/pnp4nagios.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 1eb2bf7..0f86d2a 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -22,7 +22,8 @@ class nagios::pnp4nagios { source => [ "puppet:///modules/site-nagios/pnp4nagios/apache.conf", "puppet:///modules/nagios/pnp4nagios/apache.conf" ], mode => 0644, owner => root, group => root, - notify => Service['apache']; + notify => Service['apache'], + require => Package['pnp4nagios'], } # run npcd as daemon -- cgit v1.2.3 From a9d74682007addd6c1a24efc7ee074a04c4bee99 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 18 Sep 2012 21:44:37 +0200 Subject: no ::nagios_packagename variable anymore --- manifests/pnp4nagios/popup.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp index 7921a29..b0da18b 100644 --- a/manifests/pnp4nagios/popup.pp +++ b/manifests/pnp4nagios/popup.pp @@ -1,4 +1,5 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { + notify {"${nagios::defaults::vars::int_nagios_cfgdir}":} File['pnp4nagios-templates.cfg']{ path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/pnp4nagios-templates.cfg", source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg", @@ -7,11 +8,11 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { notify => Service['nagios'], } - file { "/usr/share/$nagios::nagios_packagename/htdocs/ssi": + file { "/usr/share/nagios3/htdocs/ssi": ensure => directory } file { 'status-header.ssi': - path => "/usr/share/$nagios::nagios_packagename/htdocs/ssi/status-header.ssi", + path => "/usr/share/nagios3/htdocs/ssi/status-header.ssi", source => [ "puppet:///modules/site-nagios/pnp4nagios/status-header.ssi", "puppet:///modules/nagios/pnp4nagios/status-header.ssi"], mode => 0644, owner => root, group => root, -- cgit v1.2.3 From 2635b151f7be5aafa83d1d76b50a1586f74ec9c3 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 18 Sep 2012 22:06:26 +0200 Subject: updated readme --- README.pnp4nagios | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.pnp4nagios b/README.pnp4nagios index 76a7d07..ac929e9 100644 --- a/README.pnp4nagios +++ b/README.pnp4nagios @@ -13,6 +13,8 @@ the extra service action image. Please include this in your nagios.cfg: +process_performance_data=1 + #http://docs.pnp4nagios.org/en/pnp-0.6/config#bulk_mode_mit_npcd # # Service Performance-Data -- cgit v1.2.3 From 9aebb810f9c6a5bd211c4fbcb8322a41e5f9a17b Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 25 Sep 2012 21:29:31 +0200 Subject: fix proper deployment of pnp4nagios-templates.cfg --- manifests/pnp4nagios.pp | 2 +- manifests/pnp4nagios/popup.pp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 0f86d2a..efa8681 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -10,7 +10,7 @@ class nagios::pnp4nagios { # so we need to copy a file here. file { 'pnp4nagios-templates.cfg': - path => "$nagios::nagios_cfgdir/conf.d/pnp4nagios-templates.cfg", + path => "{nagios::defaults::vars::int_cfgdir}/conf.d/pnp4nagios-templates.cfg", source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg", "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ], mode => 0644, owner => root, group => root, diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp index b0da18b..a8de7c7 100644 --- a/manifests/pnp4nagios/popup.pp +++ b/manifests/pnp4nagios/popup.pp @@ -1,11 +1,7 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { - notify {"${nagios::defaults::vars::int_nagios_cfgdir}":} File['pnp4nagios-templates.cfg']{ - path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/pnp4nagios-templates.cfg", source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg", "puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg" ], - mode => 0644, owner => root, group => root, - notify => Service['nagios'], } file { "/usr/share/nagios3/htdocs/ssi": -- cgit v1.2.3 From 0911d9cb17f4c02aa42f2da4cd95f8323a239cdd Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 25 Sep 2012 23:47:42 +0200 Subject: forgot $ --- manifests/pnp4nagios.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index efa8681..7c960a7 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -10,7 +10,7 @@ class nagios::pnp4nagios { # so we need to copy a file here. file { 'pnp4nagios-templates.cfg': - path => "{nagios::defaults::vars::int_cfgdir}/conf.d/pnp4nagios-templates.cfg", + path => "${nagios::defaults::vars::int_cfgdir}/conf.d/pnp4nagios-templates.cfg", source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg", "puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg" ], mode => 0644, owner => root, group => root, -- cgit v1.2.3