Compare commits

...
Sign in to create a new pull request.

11 commits

Author SHA1 Message Date
Jan-Frode Myklebust
d12eb3e3e5 bump 2014-06-14 15:01:33 +02:00
Jan-Frode Myklebust
b943b1be64 Fix bogus date. 2014-06-14 14:49:59 +02:00
Jan-Frode Myklebust
4a1b7b107b Fix bogus date in changelog. 2014-06-14 14:48:33 +02:00
Jan-Frode Myklebust
cc48e98178 Add patch for upstream bug #100, mangled output on descritption and detail:
http://sourceforge.net/p/mon/bugs/100/
2013-10-20 18:30:06 +02:00
Jan-Frode Myklebust
7d54f2bec2 Fix logging to syslog. Same was fixed in debian's mon in 2011.
Ref:
   http://sourceforge.net/p/mon/bugs/107/
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=611751
   http://anonscm.debian.org/gitweb/?p=collab-maint/mon.git;a=commit;h=9d4e7dbfc523c49ad0ff4b40d3481bebfff32430
2013-10-20 13:41:43 +02:00
Jan-Frode Myklebust
fe388a9ef2 Remove perl-Authen-Radius dependency since it's not available,
in EPEL6 either. Same as for EPEL5.
2011-04-24 12:40:22 +02:00
Jan-Frode Myklebust
e685e94d09 Bump release number to allow koji build. 2011-04-20 15:23:39 +02:00
Fedora Release Engineering
84584ad003 dist-git conversion 2010-07-29 03:36:41 +00:00
Lubomir Rintel
695d59e91e Pull from devel 2010-07-08 20:48:02 +00:00
Dennis Gilmore
c1647940f4 Initialize branch EL-6 for mon 2010-05-08 02:00:13 +00:00
Bill Nottingham
645f7100e9 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:39:23 +00:00
5 changed files with 88 additions and 27 deletions

View file

View file

@ -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)

39
broken-percent-20.patch Normal file
View file

@ -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"});

View file

@ -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 <janfrode@tanso.net> - 1.2.0-10
- Add patch for upstream bug #100, Mangled output on descritption and detail.
* Fri Oct 11 2013 Jan-Frode Myklebust <janfrode@tanso.net> - 1.2.0-9
- Add patch for upstream bug #107, mon not logging anything to syslog.
* Sun Apr 24 2011 Jan-Frode Myklebust <janfrode@tanso.net> - 1.2.0-8
- Remove perl-Authen-Radius dependency since it's not available in EPEL6 either.
* Wed Apr 21 2010 Lubomir Rintel (GoodData) <lubo.rintel@gooddata.com> - 1.2.0-6
- Add missing dependencies (#584281)
- Fix path to libdir for 64-bits
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 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 <dag@wieers.com> - 1.2.0-1 - 4303+/dries
- Updated to release 1.2.0.
* Tue Mar 06 2004 Dag Wieers <dag@wieers.com> - 0.99.2-1
* Tue Mar 02 2004 Dag Wieers <dag@wieers.com> - 0.99.2-1
- Fixed problems with perl-modules.
* Fri Jan 09 2004 Dag Wieers <dag@wieers.com> - 0.99.2-0

14
syslog.patch Normal file
View file

@ -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);
}
}