Bug 212102 - net-mgmt/cnagios - Update to 0.33 release, add support for Nagios 4.x
Summary: net-mgmt/cnagios - Update to 0.33 release, add support for Nagios 4.x
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Rodrigo Osorio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-24 10:23 UTC by danny
Modified: 2018-01-14 05:33 UTC (History)
7 users (show)

See Also:
swills: maintainer-feedback+


Attachments
cnagios-0.33-2016082300.patch (1.36 KB, patch)
2016-08-24 10:23 UTC, danny
swills: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description danny 2016-08-24 10:23:46 UTC
Created attachment 174009 [details]
cnagios-0.33-2016082300.patch

Hi all!  I've just released cnagios 0.33 via github, which includes a few important user-contributed fixes.

  * Fix segfault in time parsing (pull #5 from Peter Hill)
  * Add support for Nagios 4.x status files (pull #4 from Peter Hill)

Attached is a patch that bumps the distinfo and package version.  

Note that I've removed the dependency on net-mgmt/nagios, as the cnagios port now works with either net-mgmt/nagios *or* net-mgmt/cnagios.

However, I can't find a clean way to represent that logic with the *_DEPENDS variables.  If someone knows a best practices way to do deal with that, I'm curious. 

So, as things sit right now I think it's fairly reasonable to yank the nagios dependency, since:

  1) All the other nagios-related ports (such as the nagios-plugins, monitoring-plugins, nagios-plugin-*, etc) also choose not to depend on a specific flavor of nagios, probably for this same reason.

  2) You have to have nagios up and running before it's possible to install cnagios, due to the nagios status.dat checks that run during configure time, and as such no *_DEPENDS variable will work for automating this port.

  3) Specifying a version via the "--with-nagios-data" option doesn't actually do anything to prevent the need to query Nagios' status.dat file.

  4) The cnagios utility doesn't link against nagios at all, and in theory could be installed without nagios and used only for parsing of status.dat files.

Thoughts?

The real fix is to clean up the build process upstream, which I plan to address in a future release.  But for now, we probably shouldn't block Nagios 4.x users since cnagios now works equally well with 3.x and 4.x.
Comment 1 danny 2016-08-24 10:25:14 UTC
Pardon, I meant to say "works with net-mgmt/nagios or net/mgmt/nagios4".
Comment 2 alexander.4mail 2016-08-31 15:21:59 UTC
Hi! I think you should take maintainership, Danny :). What do you think about it?
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2016-08-31 18:16:34 UTC
It fails to build if no nagios is installed. Is this to avoid a fixed dependency on nagios or nagios4 ? If not, can you add a BUILD_DEPEND on nagios4 ?
Comment 4 danny 2016-08-31 19:33:36 UTC
You're right, it does do a check for a live nagios status.dat file if you don't pass in an explicit version variable at config time.

So, looks like it's always going to have problems building in this way, as it is looking for a live running nagios install to pull the version from at build time - which will never exist on a package build box or poudriere.

Locking it to nagios4 would work, since passing the the version in via "--with-nagios-data" prevents it from looking for a live nagios install.  But that would be unfortunately, since it works great with net-mgmt/nagios.

Is there a sane way to add a dependency on net-mgmt/nagios *or* net-mgmt/nagios4?

Given that I have control of upstream now, I could also fix the build process there to not be so brittle, too.
Comment 5 Kurt Jaeger freebsd_committer freebsd_triage 2016-08-31 19:35:14 UTC
Yes, if possible, fix it upstreams. A warning at runtime is much better than a fail at buildtime.
Comment 6 Kurt Jaeger freebsd_committer freebsd_triage 2016-08-31 19:36:26 UTC
There's a way using OPTIONS, but it hard-codes the version into the pkg from the pkg-builders (which it should not, if it is not necessary).
Comment 7 danny 2016-08-31 20:00:22 UTC
Agreed.  I'll fix it upstream so that cnagios doesn't require a live nagios instance at build time.  

I'll submit a new patch after that.
Comment 8 danny 2016-08-31 20:04:32 UTC
(In reply to alexander.4mail from comment #2)

Alexander, I'd love to take maintainership of this port, as long as that is acceptable to the freebsd-ports folks.

I stare at cnagios all day on several production systems, so there will definitely be some eyeballs on it.
Comment 9 Kurt Jaeger freebsd_committer freebsd_triage 2016-09-01 01:45:05 UTC
Btw, does it also work with icinga2 ?
Comment 10 danny 2016-09-01 03:56:15 UTC
(In reply to Kurt Jaeger from comment #9)
Good question.  It *should*, since I believe they have the same status.dat format, but I've never tried it.  I'll verify that when testing the upstream build fixes.
Comment 11 commit-hook freebsd_committer freebsd_triage 2016-09-17 17:55:04 UTC
A commit references this bug:

Author: ohauer
Date: Sat Sep 17 17:54:25 UTC 2016
New revision: 422337
URL: https://svnweb.freebsd.org/changeset/ports/422337

Log:
  - change MAINTAINER

  PR:		212102
  Approved by:	alexander.4mail@gmail.com (old maintainer)

Changes:
  head/net-mgmt/cnagios/Makefile
Comment 12 danny 2016-09-17 18:36:15 UTC
Hi all, sorry about the delay in implementing the upstream fixes required to fix this PR, I've been swamped at $dayjob the past few weeks.

I should be able to get this wrapped up in the next week.

Thanks everyone!
Comment 13 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2017-02-05 19:16:36 UTC
Hi, any news one this one?
Comment 14 danny 2017-02-05 20:07:00 UTC
(In reply to Ruslan Makhmatkhanov from comment #13)

Hi!  I'm planning on picking this back up and getting it finished in the next few weeks, apologies again for the delay.
Comment 15 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2017-02-05 20:09:38 UTC
Ok, just pinging to make sure it still actual :). Thanks for response!
Comment 16 danny 2017-02-05 20:16:48 UTC
(In reply to Ruslan Makhmatkhanov from comment #15)
Understood, and appreciated! :)
Comment 17 danny 2017-11-09 00:30:06 UTC
All - I just noticed some movement on this bug and realized I've been punting this fix for way too long.

The proper fix requires some heavy work on upstream cnagios to make everything work cleanly with just build flags alone to avoid nasty workarounds on the ports Makefile side.  I just haven't been able to get to that bigger work, it's messy.

The above patch would unblock cnagios 0.33 for the use case mentioned in this bug, but doesn't fix the big picture problems with cnagios, but it definitely doesn't do things the right way for a sensible port Makefile.

Not sure what to do here.  Ideas?
Comment 18 danny 2018-01-14 05:33:18 UTC
Closing this bug, as this has gone past its original scope.  I need to incorporate all the feedback from this PR along with a few github bugs and rework the project in to an application agnostic one.

I will track this on the upstream side, and then submit a new PR and a version bump once the upstream work is done.

If anyone objects, I'm happy to reopen.  Thanks everyone for all the advice here.