rpms / specs / pnp4nagios / pnp4nagios.spec #223

Closed
cinch opened this Issue Dec 21, 2012 · 7 comments

Projects

None yet

3 participants

@cinch

after installing this package (self compiled), i get a warning:

warning: user nagios does not exist - using root
warning: group nagios does not exist - using root

same if i pass the user/group of icinga to configure.
in the #icinga irc room, a guy said i should post the issue here:
" hm, afaik that's the issue with pnp requiring nagios previously
haven't investigated further yet"

@dnsmichi
RepoForge.Org member

that guy was me btw.

@dnsmichi dnsmichi added a commit that closed this issue Dec 28, 2012
@dnsmichi dnsmichi pnp4nagios: detect if used with icinga, and adjust users/configs (fixes
#223)

this fixes some longlasting issues with both cores, nagios and icinga,
and pnp4nagios package itsself too.

tested with different settings (with icinga, without icinga and
defaults, etc)

* Fri Dec 28 2012 Michael Friedrich <michael.friedrich@netways.de> - 0.6.19-2
- add logmsg
- mv misccommands.cfg-sample to misccommands.cfg-sample-{nagios,icinga}
- create icinga.cfg-sample from nagios.cfg-sample
- fix paths for nagios/icinga packages in misccommands.cfg-sample-{nagios,icinga} and {nagios,icinga}.cfg-sample
- add detection of nagios or icinga pkg install to pre  (/etc/{nagios,icinga}/{nagios,icinga}.cfg)
- if icinga pkg detected, correct all config and initscript attributes  to properly match icinga
- fix location of htpasswd.users in pnp4nagios.conf for nagios
- FIXME: package detection of nagios or icinga is pretty poor, needs proper method
a09e005
@dnsmichi dnsmichi closed this in a09e005 Dec 28, 2012
@dnsmichi
RepoForge.Org member

i've now added a somehow ugly method detecting if icinga is installed, and adding the icinga user if not existing too. this requires a change to all the configs (npcd will run as icinga user e.g.)

while i am at it, i've also fixed all known locations which are hardcoded nagios default, and may need an adjustment for icinga. once icinga is detected, this is adjusted in %post to match the icinga rpm setup accordingly (check the diff for details).

for nagios, the htpasswd.users location in the httpd config is also fixed while fixing the rest.

the detection if icinga is installed, now focuses on icinga.cfg and icinga binary, but that may be properly fixed by someone in the future.

@buschsalat

Maybe I'm doing something wrong, but your fix isn't working. I'm trying to build a pnp4nagios rpm for version 0.6.19.
In the spec file I added these three lines:
--with-nagios-user=icinga \
--with-nagios-group=icinga \
--with-command-group=icingacmd

When installing my rpm I still get these error messages:
warning: user nagios does not exist - using root
warning: group nagios does not exist - using root

@dnsmichi
RepoForge.Org member

did you check the fix and used the spec file from git? you do not need any changes at all, only having the icinga package installed in order to detect the proper usernames and configs.

@buschsalat

I used https://raw.github.com/repoforge/rpms/master/specs/pnp4nagios/pnp4nagios.spec found at https://wiki.icinga.org/display/howtos/Build+PNP+RPMs.
Also tried https://raw.github.com/dnsmichi/rpms/master/specs/pnp4nagios/pnp4nagios.spec. Same result, but had to fix this:
File listed twice: /usr/lib64/pnp4nagios/npcdmod.o
Installed (but unpackaged) file(s) found:
/usr/libexec/rrd_modify.pl

Haven't seen a different spec file anywhere. Icinga is properly installed, including nagios-plugins and icinga-web. Everything with own rpms. /etc/icinga/icinga.cfg and /usr/bin/icinga are present. As are icinga user and icinga/icingacmd groups.

@buschsalat

I changed the %post part of your fixed spec file. Removed the else part and made the part where every path is changed to icinga mandatory. Still used
--with-nagios-user=icinga \
--with-nagios-group=icinga \
--with-command-group=icingacmd
in %configure and built the RPM. Error message still says:
warning: user nagios does not exist - using root
warning: group nagios does not exist - using root
Right now, I am not able to find the reason for that.

@dnsmichi
RepoForge.Org member

I've tested my spec file with and without icinga installed before uploading to repoforge. I am sorry, but I have no idea nor insight what you are doing wrong here. And instead of flooding this already closed issue please rather use the mailinglists for better reading and discussion on your issue of building the pnp4nagios spec file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment