diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index ee5e152..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: mon -# $Id$ -NAME := mon -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/broken-percent-20.patch b/broken-percent-20.patch new file mode 100644 index 0000000..51d8e1f --- /dev/null +++ b/broken-percent-20.patch @@ -0,0 +1,39 @@ +--- mon.original 2013-10-20 18:08:16.249267591 +0200 ++++ mon 2013-10-20 18:16:43.958008453 +0200 +@@ -2511,9 +2511,9 @@ + foreach $group (keys %watch) { + foreach $service (keys %{$watch{$group}}) { + if (view_match($clients{$cl}->{"view"}, $group, $service)) { +- sock_write ($fh, "$group $service " . ++ sock_write ($fh, "$group $service '" . + esc_str ($watch{$group}->{$service}->{"description"}, 1) . +- "\n"); ++ "'\n"); + } + } + } +@@ -3035,7 +3035,23 @@ + if (defined $sref->{"periods"}->{$period}->{"_last_alert"} && $sref->{"periods"}->{$period}->{"_last_alert"} > $l); + } + +- my $buf = sprintf("group=$group service=$service opstatus=$sref->{_op_status} last_opstatus=%s exitval=%s timer=%s last_success=%s last_trap=%s last_traphost=%s last_check=%s ack=%s ackcomment=$comment alerts_sent=$alerts_sent depstatus=%s depend=$depend hostdepend=$hostdepend monitordepend=$monitordepend alertdepend=$alertdepend monitor=$monitor last_summary=%s last_detail=%s", (defined $sref->{_last_op_status} ? $sref->{_last_op_status} : ""), (defined $sref->{_exitval} ? $sref->{_exitval} : ""), (defined $sref->{_timer} ? $sref->{_timer} : ""), (defined $sref->{_last_success} ? $sref->{_last_success} : ""), (defined $sref->{_last_trap} ? $sref->{_last_trap} : ""), (defined $sref->{_last_traphost} ? $sref->{_last_traphost} : ""), (defined $sref->{_last_check} ? $sref->{_last_check} : ""), (defined $sref->{_ack} ? $sref->{_ack} : ""), (defined $sref->{"_depend_status"} ? int ($sref->{"_depend_status"}) : ""), $summary, $detail); ++ my $buf = "group=$group" . ++ " service=$service" . ++ " opstatus=$sref->{_op_status}" . ++ " last_opstatus=$sref->{_last_op_status}" . ++ " exitval=$sref->{_exitval}" . ++ " timer=$sref->{_timer}" . ++ " last_success=$sref->{_last_success}" . ++ " last_trap=$sref->{_last_trap}" . ++ " last_check=$sref->{_last_check}" . ++ " ack=$sref->{_ack}" . ++ " ackcomment='$comment'" . ++ " alerts_sent=$alerts_sent" . ++ " depstatus=" . int ($sref->{"_depend_status"}) . ++ " depend='$depend'" . ++ " monitor='$monitor'" . ++ " last_summary='$summary'" . ++ " last_detail='$detail'"; + + $buf .= " last_failure=$sref->{_last_failure}" + if ($sref->{"_last_failure"}); diff --git a/mon.spec b/mon.spec index 3ebe910..aa2568f 100644 --- a/mon.spec +++ b/mon.spec @@ -1,12 +1,13 @@ # TODO: Split monitors and alerts into subpackages # they drag in way too much dependencies -%define moncgi_version 1.52 +%global moncgi_version 1.52 +%global fixlib sed 's,/usr/lib,%{_libdir},g' Name: mon Summary: General-purpose resource monitoring system Version: 1.2.0 -Release: 5%{?dist} +Release: 11%{?dist} License: GPLv2+ Group: Applications/Internet URL: http://www.kernel.org/software/mon/ @@ -21,6 +22,15 @@ Source5: userfile Patch0: mon-1.2.0-perl.patch Patch1: mon-1.2.0-uucp.patch +# #107 mon is not logging anything to syslog +# http://sourceforge.net/p/mon/bugs/107/ +Patch2: syslog.patch +Patch3: broken-percent-20.patch + +Requires: perl(Authen::PAM) +Requires: iputils +Requires: fping +Requires: traceroute BuildRequires: dos2unix BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -44,6 +54,8 @@ required, the mon server will not need to be changed. %setup -q -a 1 -a 2 %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p0 # Filter out unwanted requires cat << \EOF > %{name}-req @@ -91,8 +103,9 @@ install -p -m0755 mon.d/*.wrap mon.d/*.monitor $RPM_BUILD_ROOT%{_libdir}/mon/mon install -p -m0755 alert.d/* $RPM_BUILD_ROOT%{_libdir}/mon/alert.d/ install -p -m0755 alerts/*/*.alert $RPM_BUILD_ROOT%{_libdir}/mon/alert.d/ -install -Dp -m0644 etc/auth.cf $RPM_BUILD_ROOT%{_sysconfdir}/mon/auth.cf -install -Dp -m0644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/mon/mon.cf +install -d $RPM_BUILD_ROOT%{_sysconfdir}/mon +%{fixlib} etc/auth.cf >$RPM_BUILD_ROOT%{_sysconfdir}/mon/auth.cf +%{fixlib} %{SOURCE3} >$RPM_BUILD_ROOT%{_sysconfdir}/mon/mon.cf install -Dp -m0755 %{SOURCE4} $RPM_BUILD_ROOT%{_initrddir}/mon install -Dp -m0600 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mon/userfile @@ -107,6 +120,9 @@ chmod -x mon.cgi-1.52/mon.cgi \ clients/batch-example \ utils/syslog.monitor +# Fix library path in examples +%{fixlib} -i etc/*.cf + %clean @@ -147,7 +163,7 @@ fi %attr(2755, root, uucp) %{_libdir}/mon/mon.d/dialin.monitor.wrap # These packages are not in EPEL -%if 0%{?rhel} <= 5 +%if 0%{?rhel} <= 6 # perl(Expect) %exclude %{_libdir}/mon/mon.d/dialin.monitor # perl(Authen::Radius) @@ -162,6 +178,19 @@ fi %changelog +* Sun Oct 20 2013 Jan-Frode Myklebust - 1.2.0-10 +- Add patch for upstream bug #100, Mangled output on descritption and detail. + +* Fri Oct 11 2013 Jan-Frode Myklebust - 1.2.0-9 +- Add patch for upstream bug #107, mon not logging anything to syslog. + +* Sun Apr 24 2011 Jan-Frode Myklebust - 1.2.0-8 +- Remove perl-Authen-Radius dependency since it's not available in EPEL6 either. + +* Wed Apr 21 2010 Lubomir Rintel (GoodData) - 1.2.0-6 +- Add missing dependencies (#584281) +- Fix path to libdir for 64-bits + * Sat Jul 25 2009 Fedora Release Engineering - 1.2.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild @@ -183,7 +212,7 @@ fi * Wed Jun 27 2007 Dag Wieers - 1.2.0-1 - 4303+/dries - Updated to release 1.2.0. -* Tue Mar 06 2004 Dag Wieers - 0.99.2-1 +* Tue Mar 02 2004 Dag Wieers - 0.99.2-1 - Fixed problems with perl-modules. * Fri Jan 09 2004 Dag Wieers - 0.99.2-0 diff --git a/syslog.patch b/syslog.patch new file mode 100644 index 0000000..a86bd55 --- /dev/null +++ b/syslog.patch @@ -0,0 +1,14 @@ +--- a/mon 2011-02-01 14:13:05.425802661 -0500 ++++ b/mon 2011-02-01 14:17:43.814709129 -0500 +@@ -5392,9 +5392,10 @@ + + no warnings; # Redefining syslog + sub syslog { ++ my @args = @_; + eval { + local $SIG{"__DIE__"}= sub { }; +- my @log = map { s/\%//mg; } @_; ++ my @log = map { s/\%//mg; $_ } @args; + Sys::Syslog::syslog(@log); + } + }