Bug 501573 - Review Request: ndoutils - Stores data from Nagios in a database
Summary: Review Request: ndoutils - Stores data from Nagios in a database
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Dennis Gilmore
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-19 19:34 UTC by Steve Traylen
Modified: 2009-07-29 19:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-29 19:05:50 UTC
Type: ---
Embargoed:
dennis: fedora-review+
dennis: fedora-cvs+


Attachments (Terms of Use)

Description Steve Traylen 2009-05-19 19:34:52 UTC
Spec URL: http://cern.ch/steve.traylen/ndoutils-rpm/ndoutils.spec
SRPM URL: http://cern.ch/steve.traylen/ndoutils-rpm/ndoutils-1.4b7-2.fc10.src.rpm
Description: The NDOUTILS addon is designed to store all configuration and
             event data from Nagios in a database. 

This is my first package for Fedora and as such I require a sponsor.

Comment 1 Itamar Reis Peixoto 2009-05-19 19:47:45 UTC
what's your fedora username in FAS[1] ?

[1] - https://admin.fedoraproject.org/accounts/

Comment 2 Steve Traylen 2009-05-19 20:15:22 UTC
Hi, it's stevetraylen

Comment 3 Itamar Reis Peixoto 2009-05-19 20:58:29 UTC
if you want to speed up the process, please submit a koji scratch build.

https://fedoraproject.org/wiki/PackageMaintainers/Join#Install_the_Client_Tools_.28Koji.29

someone will sponsor you and review your package as soon as possible.

also take a look in packaging guidelines

https://fedoraproject.org/wiki/Packaging:Guidelines

Comment 4 Steve Traylen 2009-05-20 05:58:30 UTC
Yes scratch build done and I hope I've gone through the relavent 
guidelines.

https://koji.fedoraproject.org/koji/taskinfo?taskID=1364519

Comment 5 Steve Traylen 2009-05-29 06:34:35 UTC
Hi,
Is there anything else I can do to help this along?
Steve

Comment 6 Steve Traylen 2009-06-08 20:34:06 UTC
Hi,

 I am attending the FudCon 09 in Berlin.
 Can I use my time there in way to help to this along.

 Steve

Comment 7 Xavier Bachelot 2009-06-09 19:38:00 UTC
I cannot sponsor you, but here are a few comments about the spec :
- Source0 needs to be a full URL.
- The beta status of the package should be reflected in the release tag and thus the version needs to be modified.
  https://fedoraproject.org/wiki/Packaging/NamingGuidelines#Pre-Release_packages
- Why are you disabling postgres support ?
- Why are you installing files manually ? Upstream is not providing an install target in the Makefile ?
- The initscript should be in %{_initrddir}.
- There are spurious spaces in the mkdir lines.
- The first 3 %attr in the %files section are unneeded, the perms are already properly set at install time.
- The package doesn't own %{_sysconfdir}/ndoutils
- You don't need to set the dir perms on the last 3 %attr, this is the standard perms.
- %postun section is empty.
- Add the version and release in the changelog entry.
- You're missing Requires: for the initscripts and scriptlets are not matching the guidelines.
  https://fedoraproject.org/wiki/Packaging/SysVInitScript#Initscripts_in_spec_file_scriptlets


There's probably more than that, but this is a start.

Comment 8 Steve Traylen 2009-06-10 21:26:04 UTC
Thanks for your comments. I worked through them and changed
things and added  comments to the .spec file explaining why certain
things are being done a particular way.

Updated spec and package: ndoutils-1.4-0.1.b7.fc10.src.rpm

http://cern.ch/steve.traylen/ndoutils-rpm/

What is now there is certainly better but two questions:

1) It contains a binary that now pulls in postgres and mysql libs:
   Is that an okay practice? Ideally a ndoutils-mysql package and an 
   ndoutils-pgsql would be better but there is not an obvious method
   without building things twice and renaming the results from 
   the first compile. What to do?

2) Is there a way to disable AutoReqProv just for the 
   /usr/share/docs/nodutils-* ?
   There are some example scripts in there that should probably
   not pull in extra perl dependencies?

Finally I need to check that postgres support actually works.

Another build job:
http://koji.fedoraproject.org/koji/taskinfo?taskID=1404146
Steve

Comment 9 Xavier Bachelot 2009-06-10 23:26:38 UTC
> 1) It contains a binary that now pulls in postgres and mysql libs:
>    Is that an okay practice? Ideally a ndoutils-mysql package and an 
>    ndoutils-pgsql would be better but there is not an obvious method
>    without building things twice and renaming the results from 
>    the first compile. What to do?
> 
I guess in this case, the easiest would be to compile the module once for mysql and once for postgres, rename the modules, and put them in 2 sub-packages, so the packages only pull the deps for one of them. Or you may provide support for only one, not both, but someday someone will probably request support for the other.
Maybe the real reviewer will have more insight than me on this issue.

> 2) Is there a way to disable AutoReqProv just for the 
>    /usr/share/docs/nodutils-* ?
>    There are some example scripts in there that should probably
>    not pull in extra perl dependencies?
> 
Requires can be filtered, but what you really want is remove exec perms on the scripts, so they don't get parsed. This will clear a good chunk of the rpmlint errors below :

ndoutils.i386: W: spurious-executable-perm /usr/share/doc/ndoutils-1.4/db/upgradedb
ndoutils.i386: W: non-conffile-in-etc /etc/rc.d/init.d/ndo2db
ndoutils.i386: E: non-executable-script /etc/rc.d/init.d/ndo2db 0644
ndoutils.i386: W: non-standard-uid /var/log/ndoutils nagios
ndoutils.i386: W: spurious-executable-perm /usr/share/doc/ndoutils-1.4/db/prepsql
ndoutils.i386: W: non-standard-uid /var/run/ndoutils nagios
ndoutils.i386: W: non-standard-uid /var/cache/ndoutils nagios
ndoutils.i386: W: spurious-executable-perm /usr/share/doc/ndoutils-1.4/db/installdb
ndoutils.i386: W: log-files-without-logrotate /var/log/ndoutils
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/upgradedb perl(FindBin)
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/installdb perl(FindBin)
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/upgradedb /usr/bin/perl
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/installdb /usr/bin/perl
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/upgradedb perl(Getopt::Std)
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/installdb perl(Getopt::Std)
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/upgradedb perl(strict)
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/installdb perl(strict)
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/upgradedb perl(DBI)
ndoutils.i386: W: doc-file-dependency /usr/share/doc/ndoutils-1.4/db/installdb perl(DBI)
ndoutils.i386: E: init-script-non-executable /etc/rc.d/init.d/ndo2db
ndoutils.i386: W: missing-lsb-keyword Required-Stop in /etc/rc.d/init.d/ndo2db
ndoutils.i386: W: no-reload-entry /etc/rc.d/init.d/ndo2db
ndoutils.i386: W: incoherent-init-script-name ndo2db
ndoutils.src: W: strange-permission ndo2db.initd 0755
3 packages and 0 specfiles checked; 2 errors, 22 warnings.

use 'rpmlint -I some-error' for more information.
Don't bother for at least these 3, in this case, it's expected :
ndoutils.i386: W: non-standard-uid /var/log/ndoutils nagios
ndoutils.i386: W: non-standard-uid /var/run/ndoutils nagios
ndoutils.i386: W: non-standard-uid /var/cache/ndoutils nagios

After that, you mostly need to work on the initscript and the package should then be in a reasonably good shape.

Btw, the installation instructions want to put the conf file in the nagios conf dir (/etc/nagios). Have you considered doing this or do you want to keep the conf in their own subdir ?

Comment 10 Steve Traylen 2009-06-11 12:01:50 UTC
Thanks again. Another update

ndoutils.spec and ndoutils-1.4-0.2.b7.fc10.src.rpm

http://cern.ch/steve.traylen/ndoutils-rpm

rpmlint shows as below. I've tried to explain each of the warnings, for
me they are all justified.

1) ndoutils.x86_64: W: non-standard-uid /var/log/ndoutils nagios
   ndoutils.x86_64: W: non-standard-uid /var/run/ndoutils nagios
   ndoutils.x86_64: W: non-standard-uid /var/cache/ndoutils nagios

These 3 are expected, nagios user executed processes write to these.

2) ndoutils.x86_64: W: log-files-without-logrotate /var/log/ndoutils
 
ndo2db does its own rotation and has a max log size in its configuration.

3) ndoutils.x86_64: W: incoherent-init-script-name ndo2db

ndoutils packages contains ndomod and ndo2db utilities. Only the latter
is the init.d thing to be started.


4) ndoutils-mysql.x86_64: W: no-documentation
   ndoutils-pgsql.x86_64: W: no-documentation

Both packages require ndoutils anyway which does contain the docs.


 Steve

Comment 11 Xavier Bachelot 2009-06-11 12:21:51 UTC
Well done, the spec looks much better now. One last thing, the perms mod on the examples should be done in the %prep section, not at the end of %install.
Also, what about putting the confs in /etc/nagios rather than /etc/ndoutils ?

Comment 12 Steve Traylen 2009-06-14 09:33:42 UTC
Hi, The chmod is moved now to the %prep set up with sense.

Concerning the configuration I've put now in /etc/nagios as per the documentation.
It is certainly harmless in there and if that matches the documentation then
I guess that is good. I moved it originally so as not to clutter the 
/etc/nagios directory.
Steve

Comment 13 Mike Bonnet 2009-07-16 19:02:34 UTC
rpmlint output:

$ rpmlint ndoutils-1.4-0.3.b7.fc12.x86_64.rpm ndoutils-mysql-1.4-0.3.b7.fc12.x86_64.rpm ndoutils-pgsql-1.4-0.3.b7.fc12.x86_64.rpm
ndoutils.x86_64: W: non-standard-uid /var/log/ndoutils nagios
ndoutils.x86_64: W: non-standard-uid /var/run/ndoutils nagios
ndoutils.x86_64: W: non-standard-uid /var/cache/ndoutils nagios
ndoutils.x86_64: W: log-files-without-logrotate /var/log/ndoutils
ndoutils.x86_64: W: incoherent-init-script-name ndo2db
ndoutils-mysql.x86_64: W: no-documentation
ndoutils-pgsql.x86_64: W: no-documentation

All of them are explained satisfactorily above.

The GPLv2 license is mentioned in a few of the source files, but you may want to encourage upstream to include a LICENSE or COPYING file in the source tarball.

A better URL might be http://www.nagios.org/download/addons/, but I'll leave that decision to you.

The Source0 URL should be:

Source0: http://downloads.sourceforge.net/nagios/ndoutils-1.4b7.tar.gz

in accordance with:

https://fedoraproject.org/wiki/Packaging/SourceURL#Sourceforge.net

Tarball in .src.rpm matches upstream tarball.

Koji scratch build succeeded on all arches: https://koji.fedoraproject.org/koji/taskinfo?taskID=1480076

The %files sections for the mysql and pgsql subpackages need %defattr lines (I don't think this changes anything, but it's in the guidelines).

It seems very odd to be dropping a .o file into %{_libdir} (rather than a versioned .so).  Is this customary for nagios addons?  Are there other packages that do this?

Comment 14 Steve Traylen 2009-07-20 21:28:54 UTC
Thanks for all the comments, hopefully all addressed:

http://cern.ch/steve.traylen/ndoutils-rpm/ndoutils-1.4-0.4.b7.fc11.src.rpm
http://cern.ch/steve.traylen/ndoutils-rpm/ndoutils.spec

from the .spec file:
- Patch ndomod.o to be ndomod.so since it was a shared object.
- Move ndomod.so from /usr/lib to /usr/lib/nagios/brokers
- Change URL to better one.
- Change SourceURL to fedora package guideline for sourceforge.
- Completely removed postgres support. The documents clearly state
  it is not supported.

In particular postgres is mentioned as not being supported in the docs and 
moreover in the new b8 release it is even removed from the configure
options. Consequently I have removed all traces of postgres support. It
can be added later.

In fact the .a file in /usr/lib was a .so file but hardcoded to be a .a. 
This is now patched to be a .so. Concerning your question about where it 
should go this ndomod.so is the same to nagios as say mod_alias.so is to
httpd. So I put in  /usr/lib/nagios/brokers which makes a lot more sense.

A good koji build:
http://koji.fedoraproject.org/koji/taskinfo?taskID=1487645

rpmlint ndoutils-1.4-0.4.b7.fc11.src.rpm \
        ndoutils-1.4-0.4.b7.fc11.x86_64.rpm \
        ndoutils-mysql-1.4-0.4.b7.fc11.x86_64.rpm

ndoutils.x86_64: W: non-standard-uid /var/cache/ndoutils nagios
ndoutils.x86_64: W: non-standard-uid /var/run/ndoutils nagios
ndoutils.x86_64: W: non-standard-uid /var/log/ndoutils nagios
ndoutils.x86_64: W: log-files-without-logrotate /var/log/ndoutils
ndoutils.x86_64: W: incoherent-init-script-name ndo2db ('ndoutils', 'ndoutilsd')

which are all explained above.

 Steve.

Comment 15 Xavier Bachelot 2009-07-21 09:04:16 UTC
A couple more comments :
- According to the doc, ndoutils should work with nagios 2 too. You could add conditionals to the spec to be able to build both for Fedora and RHEL/CentOS 5 (Nagios 2 is shipped in EPEL). I don't know if you wish to maintain ndoutils in EPEL too, but it looks like a good idea to me and probably others.

- (pedantic) There are small typos in some comments :
"# Remove executables bits from the example sripts in the documentation." executable_ and s_c_ripts.
"# Upsteam does not provide a install target." Upst_r_eam and a_n_ install target
"# MySQL lib locations must be explicitly specifed to be found on " location_ and specif_i_ed

- You should package the latest version.

Comment 16 Steve Traylen 2009-07-21 14:25:13 UTC
Concerning the nagios 2/3 there was a thread on the EPEL mailing list
recently about possibly upgrading to nagios 3 anyway within EPEL.

I was waiting for that to conclude. I do want ndoutils for RHEL in the
end though for my day job.

Or is it reasonable to calculate dynamically the version of nagios?
The odd thing here is that nagios is not needed at all until runtime
so installing it just to find the version would be a little odd.

I'll ask within the thread in fact as it has gone a little cold.



Steve

Comment 17 Xavier Bachelot 2009-07-21 15:43:28 UTC
I know about the thread on epel-devel, and the idea was not to discard nagios 2, but rather to add nagios 3 in order to have both, at least for some time.

As it stands currently, all supported Fedora version have nagios 3 and EPEL has nagios 2, so you can just build either the 2.x or 3.x ndoutils module depending on the distro you're building for. If/when EPEL grows nagios 3, you can build both and include them in 2 different packages, possibly conflicting on each other, and requiring either nagios 2 or nagios 3. Actually, it's not really different than what you did with the mysql vs postgres build.

Comment 18 Steve Traylen 2009-07-21 20:50:10 UTC
Hi Xavier,

spec and .src.rpm are in:

http://straylen.web.cern.ch/straylen/ndoutils-rpm/

changes from the .spec file are:

- Updated to nodutils 1.4b8.
- mysql lib path no longer needs to be set explicitly.
- Use dist tags to install for nagios2 on el4 and el5.

My lazy typos have also been corrected.

fc11, fc12, el4 and el5 builds are respectively at:

https://koji.fedoraproject.org/koji/taskinfo?taskID=1490662
https://koji.fedoraproject.org/koji/taskinfo?taskID=1490667
https://koji.fedoraproject.org/koji/taskinfo?taskID=1490744
https://koji.fedoraproject.org/koji/taskinfo?taskID=1490749

The el4, 5 builds effectively hard code to need nagios-2. As you say
they can be extended later if a nagios3 appears here.

(I probably should have dropped the release from 4 to 0 rather than 5 with
 the increase in the beta version... Next time).

rpmlint has not changed.

Steve

Comment 19 Mike Bonnet 2009-07-21 21:20:52 UTC
Steve, the package looks good, I'm approving it.

Xavier, thanks for all your comments, you've been very helpful!

Comment 20 Xavier Bachelot 2009-07-21 22:07:03 UTC
(In reply to comment #18)
> - Use dist tags to install for nagios2 on el4 and el5.

I'm not sure if testing against %{?el4}%{el5} is correct. I thought the test was against %{?rhel}, but I can be wrong. Also Requires: nagios = 2 is definitely not ok, it can't match. Not sure how to enforce nagios 2.x. Maybe something like : Requires: nagios > 2
Requires: nagios < 3

> (I probably should have dropped the release from 4 to 0 rather than 5 with
>  the increase in the beta version... Next time).
>
No you can't. 1.4-0.1.b8 < 1.4-0.5.b7
 
(In reply to comment #19)
> Xavier, thanks for all your comments, you've been very helpful!  
You're welcome, I'm glad to be helpful :-)

Comment 21 Steve Traylen 2009-07-22 01:20:24 UTC
A new one, same location.
ndoutils-1.4-0.6.b8.fc11.src.rpm

%{?el4}%{?el5}

looks to be correct, there is a similar example on the disttag description
page. It certainly works and I'm assuming .el6 will be nagios 3.

Nagios deps changed to 

nagios < 3 

for el4 and 5. Nagios 1 has not been around for ages.

Steve

Comment 22 Steve Traylen 2009-07-22 09:38:20 UTC
Hi 
I finished some testing this morning on SL4 and SL5.

It seems that really MySQL 5 is needed to support long enough varchars
that are present in the schema. As such unless someone requests it
I wont do an EL4 release as that will require some back porting.

So my current offer as it were is:

http://straylen.web.cern.ch/straylen/ndoutils-rpm/ndoutils-1.4-0.6.b8.fc11.src.rpm
http://straylen.web.cern.ch/straylen/ndoutils-rpm/ndoutils.spec

built on fc11, fc12 and el5.

https://koji.fedoraproject.org/koji/taskinfo?taskID=1490662
https://koji.fedoraproject.org/koji/taskinfo?taskID=1490667
https://koji.fedoraproject.org/koji/taskinfo?taskID=1490749

Comment 23 Xavier Bachelot 2009-07-22 10:04:55 UTC
Mike, are you a sponsor ? If yes, then you need to sponsor Steve and once the paperwork is done then Steve can file the CVS branch request. However, it seems you're unfortunately not, so someone else need to volunteer.

Comment 24 Mike Bonnet 2009-07-22 15:18:30 UTC
Xavier, you're correct, I'm not a sponsor yet (though I'm working on it).  I'm going to see about getting someone else to sponsor Steve.

Comment 25 Dennis Gilmore 2009-07-22 15:27:40 UTC
Steve i can and will sponsor you.  please apply for packager access in FAS

Comment 26 Mamoru TASAKA 2009-07-26 07:06:10 UTC
Dennis, are you going to sponsor Steve? (Steve's FAS is
stevetraylen and is waiting for sponsorship approval)

Comment 27 Steve Traylen 2009-07-29 07:24:35 UTC
Dennis,
  Can I now proceed to the cvs request or am I waiting for a review
  from you as a sponser. If the latter just fine.

  Steve

Comment 28 Steve Traylen 2009-07-29 09:59:56 UTC
New Package CVS Request
=======================
Package Name: ndoutils
Short Description: Stores data from Nagios in a database.
Owners: stevetraylen
Branches: F-10 F-11 EL-5
InitialCC:

Comment 29 Dennis Gilmore 2009-07-29 14:22:54 UTC
CVS Done

Comment 30 Steve Traylen 2009-07-29 19:05:50 UTC
Think this all done then now?

Builds created for devel , fc10, fc11 and EL-5.

fc10, fc11 and el5 ones submitted for testing via bhodi.

I think the devel is picked up by the action of closing this with NEXTRELEASE.

Thanks to all support and advice along the way.

 Steve


Note You need to log in before you can comment on or make changes to this bug.