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 From bab19af527a21d689324a95aa9a0134c9aadb863 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 8fcd85d..b24f9b3 100644 --- a/README +++ b/README @@ -193,6 +193,25 @@ For the irc_bot class: '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 3daee03641834a17818d323258f7b80179b7f0d6 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 4c407f8575c290082fc61c3db42c0390c25d0aac 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 dc61b5b838a2835be4f2b89d585f7daef980e6ea 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 cd6386a3854099a312891ef65d86ce72e9a86912 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 2f8d046607ad0bd5555ef812880cd97431b24977 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 559dfc75fb78b9a52a8bc551bbbe2134c8dd3c93 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 4bd3595f84d6c8aa304a4048b3a082a82d911910 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 64e2b42f925d263a11ff6b6b39a6c42511007ed1 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 09ea320fc19e872012d88fb748e2d784e360afa4 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 c35d053d62ff363a53b797aca10e254bd4a405e2 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 bb37870bc5cd38e0d7e5480c941aebe7dd9589de 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 49c433284cc069984535b452ba5c36446de8cda3 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 11925952cbe29b25c776941a35ae921f43882359 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 6c60742df8e27c855352cfe4d5539c644d832e0c 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 2900c2406015e39420d922d0067ec69926d73667 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 54695b64c2ac83962a461cefd91c79c2fd5775ab 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 139e8fd42661848da4765b8c4f65fe85a54a2d9f 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 52ee95453998f64bb7a97dfff31d6e35c8e31b88 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 fafc63a04fad697d67dc98b96ef24015473b62f9 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 1c2981ae2f82b80d49fcc9349a959f1152b6b9ab 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 c1ef04bf0bd3dad921c27a0d8ad3c7f6e06977fa 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 From e72f4b51dbc9f183d60251de44e80149d88a1da3 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 14 Feb 2013 18:47:26 -0500 Subject: lintian of pnp4nagios commits --- manifests/defaults/pnp4nagios.pp | 4 +-- manifests/pnp4nagios.pp | 68 ++++++++++++++++++++++------------------ manifests/pnp4nagios/popup.pp | 16 +++++----- 3 files changed, 48 insertions(+), 40 deletions(-) diff --git a/manifests/defaults/pnp4nagios.pp b/manifests/defaults/pnp4nagios.pp index f6556c9..2ad8767 100644 --- a/manifests/defaults/pnp4nagios.pp +++ b/manifests/defaults/pnp4nagios.pp @@ -10,8 +10,8 @@ class nagios::defaults::pnp4nagios { # nagios host templates # http://docs.pnp4nagios.org/de/pnp-0.6/webfe - - # this doesn't work, see manifests/pnp4nagios.pp + + # this doesn't work, see manifests/pnp4nagios.pp #nagios_host { 'host-pnp': # action_url => '/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_', # register => 0, diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 7c960a7..e7d2be1 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -1,57 +1,63 @@ class nagios::pnp4nagios { include nagios::defaults::pnp4nagios - package { 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. + # 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::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, - notify => Service['nagios'], + 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, + notify => Service['nagios'], } - + 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'], + 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'], require => Package['pnp4nagios'], } # 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, + 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['pnp4nagios'], + ensure => running, + enable => true, + hasstatus => true, + 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, + 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']; } - - } diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp index a8de7c7..80f8def 100644 --- a/manifests/pnp4nagios/popup.pp +++ b/manifests/pnp4nagios/popup.pp @@ -1,17 +1,19 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { File['pnp4nagios-templates.cfg']{ - source => [ "puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg", - "puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg" ], + source => [ 'puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg', + 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg' ], } - file { "/usr/share/nagios3/htdocs/ssi": + file { '/usr/share/nagios3/htdocs/ssi': ensure => directory } file { '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, + 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, notify => Service['nagios'], } } -- cgit v1.2.3 From 2bf3d8f17fae838982fcfa7a7c9e1833e65aec18 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 14 Feb 2013 18:50:00 -0500 Subject: make site_nagios source primary, but allow fall-back to site-nagios --- manifests/pnp4nagios.pp | 12 ++++++++---- manifests/pnp4nagios/popup.pp | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index e7d2be1..d8ee85e 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -11,7 +11,8 @@ class nagios::pnp4nagios { file { 'pnp4nagios-templates.cfg': path => "${nagios::defaults::vars::int_cfgdir}/conf.d/pnp4nagios-templates.cfg", - source => [ 'puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg', + source => [ 'puppet:///modules/site_nagios/pnp4nagios/pnp4nagios-templates.cfg', + 'puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg', 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg' ], mode => '0644', owner => root, @@ -21,7 +22,8 @@ class nagios::pnp4nagios { file { 'apache.conf': path => '/etc/pnp4nagios/apache.conf', - source => [ 'puppet:///modules/site-nagios/pnp4nagios/apache.conf', + source => [ 'puppet:///modules/site_nagios/pnp4nagios/apache.conf', + 'puppet:///modules/site-nagios/pnp4nagios/apache.conf', 'puppet:///modules/nagios/pnp4nagios/apache.conf' ], mode => '0644', owner => root, @@ -34,7 +36,8 @@ class nagios::pnp4nagios { file { '/etc/default/npcd': path => '/etc/default/npcd', - source => [ 'puppet:///modules/site-nagios/pnp4nagios/npcd', + source => [ 'puppet:///modules/site_nagios/pnp4nagios/npcd', + 'puppet:///modules/site-nagios/pnp4nagios/npcd', 'puppet:///modules/nagios/pnp4nagios/npcd' ], mode => '0644', owner => root, @@ -53,7 +56,8 @@ class nagios::pnp4nagios { file { '/usr/share/nagios3/htdocs/images/action.gif': path => '/usr/share/nagios3/htdocs/images/action.gif', - source => [ 'puppet:///modules/site-nagios/pnp4nagios/action.gif', + source => [ 'puppet:///modules/site_nagios/pnp4nagios/action.gif', + 'puppet:///modules/site-nagios/pnp4nagios/action.gif', 'puppet:///modules/nagios/pnp4nagios/action.gif' ], mode => '0644', owner => root, diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp index 80f8def..b90f163 100644 --- a/manifests/pnp4nagios/popup.pp +++ b/manifests/pnp4nagios/popup.pp @@ -1,6 +1,7 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { File['pnp4nagios-templates.cfg']{ - source => [ 'puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg', + source => [ 'puppet:///modules/site_nagios/pnp4nagios/pnp4nagios-popup-templates.cfg', + 'puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg', 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg' ], } @@ -9,7 +10,8 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { file { 'status-header.ssi': path => '/usr/share/nagios3/htdocs/ssi/status-header.ssi', - source => [ 'puppet:///modules/site-nagios/pnp4nagios/status-header.ssi', + source => [ 'puppet:///modules/site_nagios/pnp4nagios/status-header.ssi', + 'puppet:///modules/site-nagios/pnp4nagios/status-header.ssi', 'puppet:///modules/nagios/pnp4nagios/status-header.ssi' ], mode => '0644', owner => root, -- cgit v1.2.3 From 2ba84e4e9f009e570826fd2439f989fac0080258 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 14 Feb 2013 18:50:27 -0500 Subject: Revert "added icon for pnp4nagios" This reverts commit 2f8d046607ad0bd5555ef812880cd97431b24977. This was never used in any resource --- images/nagiosgraph.gif | Bin 1252 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 images/nagiosgraph.gif diff --git a/images/nagiosgraph.gif b/images/nagiosgraph.gif deleted file mode 100644 index 068082a..0000000 Binary files a/images/nagiosgraph.gif and /dev/null differ -- cgit v1.2.3 From db5987a9a1c85371d6028cf375409ffed5be0cf0 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 14 Feb 2013 18:52:31 -0500 Subject: move all pnp4nagios stuff into README.pnp4nagios remove line that says that there are no packages (there are now) --- README | 17 ++--------------- README.pnp4nagios | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/README b/README index b24f9b3..0857524 100644 --- a/README +++ b/README @@ -195,21 +195,8 @@ For the irc_bot class: 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', - ... + +For PNP4Nagios integration information, please see README.pnp4nagios Examples diff --git a/README.pnp4nagios b/README.pnp4nagios index ac929e9..dd40702 100644 --- a/README.pnp4nagios +++ b/README.pnp4nagios @@ -3,6 +3,22 @@ PNP4Nagios integration As of 2012/01 debian packages for pnp4nagios are availible from lenny-backports on. +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', + ... + 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). -- cgit v1.2.3 From 4cc87a364640b8c15b16fcddf1ffdc75b0dfa649 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 22 Feb 2013 16:12:20 -0500 Subject: remove site-nagios source lines, we decided that it is better not to carry that old baggage around --- manifests/pnp4nagios.pp | 4 ---- manifests/pnp4nagios/popup.pp | 2 -- 2 files changed, 6 deletions(-) diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index d8ee85e..0c920eb 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -12,7 +12,6 @@ class nagios::pnp4nagios { file { '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/site-nagios/pnp4nagios/pnp4nagios-templates.cfg', 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg' ], mode => '0644', owner => root, @@ -23,7 +22,6 @@ class nagios::pnp4nagios { file { 'apache.conf': path => '/etc/pnp4nagios/apache.conf', source => [ 'puppet:///modules/site_nagios/pnp4nagios/apache.conf', - 'puppet:///modules/site-nagios/pnp4nagios/apache.conf', 'puppet:///modules/nagios/pnp4nagios/apache.conf' ], mode => '0644', owner => root, @@ -37,7 +35,6 @@ class nagios::pnp4nagios { file { '/etc/default/npcd': path => '/etc/default/npcd', source => [ 'puppet:///modules/site_nagios/pnp4nagios/npcd', - 'puppet:///modules/site-nagios/pnp4nagios/npcd', 'puppet:///modules/nagios/pnp4nagios/npcd' ], mode => '0644', owner => root, @@ -57,7 +54,6 @@ class nagios::pnp4nagios { 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/site-nagios/pnp4nagios/action.gif', 'puppet:///modules/nagios/pnp4nagios/action.gif' ], mode => '0644', owner => root, diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp index b90f163..0dc04b0 100644 --- a/manifests/pnp4nagios/popup.pp +++ b/manifests/pnp4nagios/popup.pp @@ -1,7 +1,6 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { File['pnp4nagios-templates.cfg']{ source => [ 'puppet:///modules/site_nagios/pnp4nagios/pnp4nagios-popup-templates.cfg', - 'puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg', 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg' ], } @@ -11,7 +10,6 @@ class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { file { 'status-header.ssi': path => '/usr/share/nagios3/htdocs/ssi/status-header.ssi', source => [ 'puppet:///modules/site_nagios/pnp4nagios/status-header.ssi', - 'puppet:///modules/site-nagios/pnp4nagios/status-header.ssi', 'puppet:///modules/nagios/pnp4nagios/status-header.ssi' ], mode => '0644', owner => root, -- cgit v1.2.3 From cfb91ce97243e743f5af0c417851aa730ab96f41 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 27 Feb 2013 19:47:14 +0100 Subject: delete commented nagios_host and -service template definitions --- manifests/defaults/pnp4nagios.pp | 18 ------------------ manifests/pnp4nagios.pp | 6 +++--- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/manifests/defaults/pnp4nagios.pp b/manifests/defaults/pnp4nagios.pp index ff918b6..662d13b 100644 --- a/manifests/defaults/pnp4nagios.pp +++ b/manifests/defaults/pnp4nagios.pp @@ -7,22 +7,4 @@ class nagios::defaults::pnp4nagios { '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 index 0c920eb..5ade74f 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -5,9 +5,9 @@ class nagios::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. + # unfortunatly we can't use the nagios_host and nagios_service + # definition to define templates, so we need to copy a file here. + # see http://projects.reductivelabs.com/issues/1180 for this limitation file { 'pnp4nagios-templates.cfg': path => "${nagios::defaults::vars::int_cfgdir}/conf.d/pnp4nagios-templates.cfg", -- cgit v1.2.3 From 27f0c77945444e14d77866fcd497eb21ecc662e4 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Wed, 17 Oct 2012 14:49:15 -0400 Subject: Fix munin plugins the basic path for nagiosstats is wrong/hardcoded. that binary comes in with the nagios3 package in Debian. set the default value to the right path under Debian and make it possible to override the path with an environment variable. Signed-off-by: Gabriel Filion --- files/munin/nagios_hosts | 10 +++++++--- files/munin/nagios_perf | 8 ++++++-- files/munin/nagios_svc | 12 ++++++++---- manifests/munin.pp | 41 ++++++++++++++++------------------------- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/files/munin/nagios_hosts b/files/munin/nagios_hosts index fa8f9dc..3fa00f1 100644 --- a/files/munin/nagios_hosts +++ b/files/munin/nagios_hosts @@ -1,5 +1,9 @@ #!/bin/bash +if [ -z "$nag_stats_binary" ]; then + nag_stats_binary=/usr/sbin/nagios3stats +fi + if [ "$1" = "config" ]; then echo 'graph_title Nagios host stats' echo 'graph_args --base 1000 -l 0' @@ -20,9 +24,9 @@ if [ "$1" = "config" ]; then fi echo -n 'up.value ' -/usr/local/sbin/nagiostats --mrtg --data NUMHSTUP +$nag_stats_binary --mrtg --data NUMHSTUP echo -n 'down.value ' -/usr/local/sbin/nagiostats --mrtg --data NUMHSTDOWN +$nag_stats_binary --mrtg --data NUMHSTDOWN echo -n 'unr.value ' -/usr/local/sbin/nagiostats --mrtg --data NUMHSTUNR +$nag_stats_binary --mrtg --data NUMHSTUNR diff --git a/files/munin/nagios_perf b/files/munin/nagios_perf index 35fd9cd..609d62f 100644 --- a/files/munin/nagios_perf +++ b/files/munin/nagios_perf @@ -1,5 +1,9 @@ #!/bin/bash +if [ -z "$nag_stats_binary" ]; then + nag_stats_binary=/usr/sbin/nagios3stats +fi + NAME=$(basename $0) TYPE=${NAME##nagios_perf_} @@ -30,5 +34,5 @@ if [ "$1" = "config" ]; then exit 0 fi -echo "act_lat_$TYPE_ABBR.value " $(/usr/local/sbin/nagiostats --mrtg --data AVGACT${TYPE_ABBR}LAT) -echo "act_ext_$TYPE_ABBR.value " $(/usr/local/sbin/nagiostats --mrtg --data AVGACT${TYPE_ABBR}EXT) +echo "act_lat_$TYPE_ABBR.value " $($nag_stats_binary --mrtg --data AVGACT${TYPE_ABBR}LAT) +echo "act_ext_$TYPE_ABBR.value " $($nag_stats_binary --mrtg --data AVGACT${TYPE_ABBR}EXT) diff --git a/files/munin/nagios_svc b/files/munin/nagios_svc index 0a9a9bf..97c8bfc 100644 --- a/files/munin/nagios_svc +++ b/files/munin/nagios_svc @@ -1,5 +1,9 @@ #!/bin/bash +if [ -z "$nag_stats_binary" ]; then + nag_stats_binary=/usr/sbin/nagios3stats +fi + if [ "$1" = "config" ]; then echo 'graph_title Nagios service stats' echo 'graph_args --base 1000 -l 0' @@ -23,11 +27,11 @@ if [ "$1" = "config" ]; then fi echo -n 'ok.value ' -/usr/local/sbin/nagiostats --mrtg --data NUMSVCOK +$nag_stats_binary --mrtg --data NUMSVCOK echo -n 'warn.value ' -/usr/local/sbin/nagiostats --mrtg --data NUMSVCWARN +$nag_stats_binary --mrtg --data NUMSVCWARN echo -n 'crit.value ' -/usr/local/sbin/nagiostats --mrtg --data NUMSVCCRIT +$nag_stats_binary --mrtg --data NUMSVCCRIT echo -n 'unkn.value ' -/usr/local/sbin/nagiostats --mrtg --data NUMSVCUNKN +$nag_stats_binary --mrtg --data NUMSVCUNKN diff --git a/manifests/munin.pp b/manifests/munin.pp index 92a389f..dc5cc4c 100644 --- a/manifests/munin.pp +++ b/manifests/munin.pp @@ -1,28 +1,19 @@ -class nagios::munin inherits munin::plugins::base { +class nagios::munin { + include munin::plugins::base - munin::plugin::deploy { - nagios_hosts: - source => 'nagios/munin/nagios_hosts', - config => 'user root'; - nagios_svc: - source => 'nagios/munin/nagios_svc', - config => 'user root'; - nagios_perf_hosts: - source => 'nagios/munin/nagios_perf', - config => 'user root'; - nagios_perf_svc: - source => 'nagios/munin/nagios_perf', - config => 'user root'; - } - - exec { 'munin_nagios2stats_link': - command => 'ln -s /usr/sbin/nagios2stats /usr/local/sbin/nagiostats', - onlyif => ["test ! -e /usr/local/sbin/nagiostats", "test -e /usr/sbin/nagios2stats"], - } - - exec { 'munin_nagios3stats_link': - command => 'ln -s /usr/sbin/nagios3stats /usr/local/sbin/nagiostats', - onlyif => ["test ! -e /usr/local/sbin/nagiostats", "test -e /usr/sbin/nagios3stats"], - } + munin::plugin::deploy { + 'nagios_hosts': + source => 'nagios/munin/nagios_hosts', + config => 'user nagios'; + 'nagios_svc': + source => 'nagios/munin/nagios_svc', + config => 'user nagios'; + 'nagios_perf_hosts': + source => 'nagios/munin/nagios_perf', + config => 'user nagios'; + 'nagios_perf_svc': + source => 'nagios/munin/nagios_perf', + config => 'user nagios'; + } } -- cgit v1.2.3 From a814cdad2b1ff47066df4c8b5d948f22210c0832 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 25 Jan 2013 21:22:43 -0200 Subject: Update nagios::headless to use parametrized class --- manifests/headless.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/headless.pp b/manifests/headless.pp index cccfce7..ba8af8f 100644 --- a/manifests/headless.pp +++ b/manifests/headless.pp @@ -1,4 +1,5 @@ class nagios::headless { - $nagios_httpd = 'absent' - include nagios + class { 'nagios': + httpd => 'absent', + } } -- cgit v1.2.3