summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2017-11-02 16:42:36 -0400
committerMichael Orlitzky <mjo@gentoo.org>2017-11-04 19:37:22 -0400
commit667c4d4c33593e983947d5a4ce2f59288bd9dc76 (patch)
treef1bf35252d40e08ebc90038b46dc00aad85a0596 /net-analyzer/pnp4nagios
parentnet-analyzer/pnp4nagios: new revision to fix apache2 conf file. (diff)
downloadgentoo-667c4d4c33593e983947d5a4ce2f59288bd9dc76.tar.gz
gentoo-667c4d4c33593e983947d5a4ce2f59288bd9dc76.tar.bz2
gentoo-667c4d4c33593e983947d5a4ce2f59288bd9dc76.zip
net-analyzer/pnp4nagios: use consistent perfdata directories.
Past revisions have stored the RRDtool data and the process_perdata.pl logs in (for example) /var/nagios or /var/icinga, depending on whether or you had Nagios or Icinga installed. That's silly: the data format doesn't change, so it makes more sense to choose one location (now: /var/lib/pnp) and stick with it. Package-Manager: Portage-2.3.8, Repoman-2.3.3
Diffstat (limited to 'net-analyzer/pnp4nagios')
-rw-r--r--net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild (renamed from net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r4.ebuild)32
1 files changed, 15 insertions, 17 deletions
diff --git a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r4.ebuild b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild
index c173abd999e4..3e886eb89dc7 100644
--- a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r4.ebuild
+++ b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26-r5.ebuild
@@ -38,27 +38,16 @@ RDEPEND="${DEPEND}
PATCHES=( "${FILESDIR}/${PN}-0.6.14-makefile.patch" )
src_configure() {
- local var_dir user_group
-
- if use icinga; then
- var_dir=/var/lib/icinga
- user_group=icinga
- elif use icinga2; then
- var_dir=/var/lib/icinga2
- user_group=icinga
- else
- # Thanks to REQUIRED_USE, "use nagios" is the only other case.
- var_dir=/var/nagios
- user_group=nagios
- fi
+ local user_group=nagios
+ ( use icinga || use icinga2 ) && user_group=icinga
econf \
--sysconfdir="${EPREFIX}"/etc/pnp \
--datarootdir="${EPREFIX}"/usr/share/pnp \
- --with-perfdata-dir="${EPREFIX}"${var_dir}/perfdata \
- --with-nagios-user=${user_group} \
- --with-nagios-group=${user_group} \
- --with-perfdata-logfile="${EPREFIX}"${var_dir}/perfdata.log \
+ --with-nagios-user="${user_group}" \
+ --with-nagios-group="${user_group}" \
+ --with-perfdata-dir="${EPREFIX}"/var/lib/pnp/perfdata \
+ --with-perfdata-logfile="${EPREFIX}"/var/log/pnp/process_perfdata.log \
--with-perfdata-spool-dir="${EPREFIX}"/var/spool/pnp
}
@@ -88,6 +77,15 @@ src_install() {
# server read it.
fowners :apache /etc/pnp/process_perfdata.cfg
fi
+
+ # The nagios or icinga user will also need to be able to write
+ # performance data to the perfdata-dir and perfdata-spool-dir
+ # directories.
+ local user_group=nagios
+ ( use icinga || use icinga2 ) && user_group=icinga
+ dodir /var/lib/pnp/{,perfdata} /var/log/pnp
+ fowners "${user_group}:${user_group}" /var/lib/pnp/{,perfdata}
+ fowners "${user_group}:${user_group}" /var/log/pnp
}
pkg_postinst() {