From 334b070c0185aabbc99184e4d37002dac242a3ae Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 23 Jul 2008 15:58:47 +0000 Subject: [PATCH 1/5] Initialize branch F-9 for mon --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..1c26f78 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-9 From 38fc3a2f37cb335f26448f45906ed1269f57daa1 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 19 Feb 2009 08:31:37 +0000 Subject: [PATCH 2/5] Import mon --- .cvsignore | 3 + mon-1.2.0-perl.patch | 20 ++++++ mon-1.2.0-uucp.patch | 11 +++ mon.cf | 51 ++++++++++++++ mon.init | 82 ++++++++++++++++++++++ mon.spec | 163 +++++++++++++++++++++++++++++++++++++++++++ sources | 3 + userfile | 1 + 8 files changed, 334 insertions(+) create mode 100644 mon-1.2.0-perl.patch create mode 100644 mon-1.2.0-uucp.patch create mode 100644 mon.cf create mode 100644 mon.init create mode 100644 mon.spec create mode 100644 userfile diff --git a/.cvsignore b/.cvsignore index e69de29..4497076 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1,3 @@ +all-alerts.tar.bz2 +mon-1.2.0.tar.bz2 +mon.cgi-1.52.tar.bz2 diff --git a/mon-1.2.0-perl.patch b/mon-1.2.0-perl.patch new file mode 100644 index 0000000..c84473c --- /dev/null +++ b/mon-1.2.0-perl.patch @@ -0,0 +1,20 @@ +Originally, a perl scriptlet in Dag's SPEC did this. + +diff -rup mon-1.2.0.orig/alerts/hpov/hpov.alert mon-1.2.0/alerts/hpov/hpov.alert +--- mon-1.2.0.orig/alerts/hpov/hpov.alert 2001-05-23 03:27:54.000000000 +0200 ++++ mon-1.2.0/alerts/hpov/hpov.alert 2008-07-13 12:48:53.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl ++#!/usr/bin/perl + # + # hpov.alert - generate event in HP OpenView + # +diff -rup mon-1.2.0.orig/mon.cgi-1.52/util/moncgi-appsecret.pl mon-1.2.0/mon.cgi-1.52/util/moncgi-appsecret.pl +--- mon-1.2.0.orig/mon.cgi-1.52/util/moncgi-appsecret.pl 2001-04-19 01:13:56.000000000 +0200 ++++ mon-1.2.0/mon.cgi-1.52/util/moncgi-appsecret.pl 2008-07-13 12:48:53.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/perl -w ++#!/usr/bin/perl -w + # + # NAME + # moncgi-appsecret.pl diff --git a/mon-1.2.0-uucp.patch b/mon-1.2.0-uucp.patch new file mode 100644 index 0000000..7dcbebb --- /dev/null +++ b/mon-1.2.0-uucp.patch @@ -0,0 +1,11 @@ +Originally, a perl scriptlet in Dag's SPEC did this. + +diff -rup mon-1.2.0.orig/mon.d/Makefile mon-1.2.0/mon.d/Makefile +--- mon-1.2.0.orig/mon.d/Makefile 2004-06-09 07:18:05.000000000 +0200 ++++ mon-1.2.0/mon.d/Makefile 2008-07-13 12:44:50.000000000 +0200 +@@ -31,4 +31,4 @@ + install: + install -d $(MONPATH)/mon.d + install rpc.monitor $(MONPATH)/mon.d/ +- install -g uucp -m 02555 dialin.monitor.wrap $(MONPATH)/mon.d/ ++ install -m 02555 dialin.monitor.wrap $(MONPATH)/mon.d/ diff --git a/mon.cf b/mon.cf new file mode 100644 index 0000000..58d8b66 --- /dev/null +++ b/mon.cf @@ -0,0 +1,51 @@ +### Extremely basic mon.cf file + +### global options +cfbasedir = /etc/mon +pidfile = /var/run/mon.pid +statedir = /var/lib/mon/state.d +logdir = /var/lib/mon/log.d +dtlogfile = /var/lib/mon/log.d/downtime.log +alertdir = /usr/lib/mon/alert.d +mondir = /usr/lib/mon/mon.d +maxprocs = 20 +histlength = 100 +randstart = 60s +authtype = pam +userfile = /etc/mon/userfile + +### group definitions (hostnames or IP addresses) +hostgroup servers localhost + +watch servers + service ping + interval 5m + monitor ping.monitor + period wd {Mon-Fri} hr {7am-10pm} + alert mail.alert root@localhost + alertevery 1h + period wd {Sat-Sun} + alert mail.alert root@localhost + service telnet + interval 10m + monitor telnet.monitor + period wd {Mon-Fri} hr {7am-10pm} + alertevery 1h + alertafter 2 30m + alert mail.alert root@localhost + service http + interval 4m + monitor http.monitor + allow_empty_group + period wd {Sun-Sat} + upalert mail.alert -S "web server is back up" mis + alertevery 45m + service smtp + interval 10m + monitor smtp.monitor + period wd {Mon-Fri} hr {7am-10pm} + alertevery 1h + alertafter 2 30m + alert qpage.alert mis-pagers@domain.com + +### See /usr/share/doc for the original example... diff --git a/mon.init b/mon.init new file mode 100644 index 0000000..ec53765 --- /dev/null +++ b/mon.init @@ -0,0 +1,82 @@ +#!/bin/bash +# +# Init file for Mon System Monitoring daemon +# +# Written by Dag Wieers . +# +# chkconfig: - 99 10 +# description: Mon System Monitoring daemon +# +# processname: mon +# config: /etc/mon/mon.conf +# config: /etc/mon/auth.conf +# pidfile: /var/run/mon.pid + +source /etc/rc.d/init.d/functions + +[ -x /usr/bin/mon ] || exit 1 +[ -r /etc/mon/mon.cf ] || exit 1 +[ -r /etc/mon/auth.cf ] || exit 1 + +RETVAL=0 +prog="mon" +desc="System Monitoring daemon" + +start() { + echo -n $"Starting $desc ($prog): " + daemon $prog -f -c /etc/mon/mon.cf + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog + return $RETVAL +} + +stop() { + echo -n $"Shutting down $desc ($prog): " + killproc $prog + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog + return $RETVAL +} + +restart() { + stop + start +} + +reload() { + echo -n $"Reloading $desc ($prog): " + killproc $prog -HUP + RETVAL=$? + echo + return $RETVAL +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + reload) + reload + ;; + condrestart) + [ -e /var/lock/subsys/$prog ] && restart + RETVAL=$? + ;; + status) + status $prog + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" + RETVAL=1 +esac + +exit $RETVAL diff --git a/mon.spec b/mon.spec new file mode 100644 index 0000000..8372460 --- /dev/null +++ b/mon.spec @@ -0,0 +1,163 @@ +%define moncgi_version 1.52 + +Name: mon +Summary: General-purpose resource monitoring system +Version: 1.2.0 +Release: 2%{?dist} +License: GPLv2+ +Group: Applications/Internet +URL: http://www.kernel.org/software/mon/ + +Source0: ftp://ftp.kernel.org/pub/software/admin/mon/mon-%{version}.tar.bz2 +Source1: ftp://ftp.kernel.org/pub/software/admin/mon/contrib/cgi-bin/mon.cgi/mon.cgi-%{moncgi_version}.tar.bz2 +Source2: ftp://ftp.kernel.org/pub/software/admin/mon/contrib/all-alerts.tar.bz2 + +Source3: mon.cf +Source4: mon.init +Source5: userfile + +Patch0: mon-1.2.0-perl.patch +Patch1: mon-1.2.0-uucp.patch + +BuildRequires: dos2unix +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + +%description +Mon is a general-purpose resource monitoring system. It can be used +to monitor network service availability, server problems, +environmental conditions (i.e., the temperature in a room) or other +things. Mon can be used to test the condition and/or to trigger an +action upon failure of the condition. Mon keeps the testing and +action-taking tasks as separate, stand-alone programs. + +Mon is very extensible. Monitors and alerts are not a part of mon, but +the distribution comes with a handful of them to get you started. This +means that if a new service needs monitoring, or if a new alert is +required, the mon server will not need to be changed. + + +%prep +%setup -q -a 1 -a 2 +%patch0 -p1 +%patch1 -p1 + +# Filter out unwanted requires +cat << \EOF > %{name}-req +#!/bin/sh +%{__perl_requires} $* |\ +sed -e ' + /perl(Math::TrulyRandom)/d + /perl(Net::hostent)/d +' +EOF + +%define __perl_requires %{_builddir}/%{name}-%{version}/%{name}-req +chmod +x %{__perl_requires} + + +%build +for F in CHANGES doc/README.syslog.monitor +do + iconv -f ISO-8859-1 -t UTF-8 $F >tmp + touch --reference $F tmp + mv tmp $F +done + +dos2unix -q -k alerts/sms/sms.alert + +make %{?_smp_mflags} -C mon.d \ + CFLAGS="%{optflags} -DUSE_VENDOR_CF_PATH=1" + + +%install +rm -rf $RPM_BUILD_ROOT +install -d -m0755 $RPM_BUILD_ROOT%{_bindir} \ + $RPM_BUILD_ROOT%{_mandir}/man{1,8}/ \ + $RPM_BUILD_ROOT%{_libdir}/mon/{alert.d,mon.d}/ \ + $RPM_BUILD_ROOT%{_sysconfdir}/mon/ \ + $RPM_BUILD_ROOT%{_initrddir} \ + $RPM_BUILD_ROOT%{_localstatedir}/www/cgi-bin/ \ + $RPM_BUILD_ROOT%{_localstatedir}/lib/mon/{log.d,state.d}/ + +make install -C mon.d \ + MONPATH="$RPM_BUILD_ROOT%{_libdir}/mon" + +install -p -m0755 mon clients/moncmd clients/monshow clients/skymon/skymon $RPM_BUILD_ROOT%{_bindir} +install -p -m0644 doc/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ +install -p -m0644 doc/*.8 $RPM_BUILD_ROOT%{_mandir}/man8/ + +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 -Dp -m0755 %{SOURCE4} $RPM_BUILD_ROOT%{_initrddir}/mon +install -Dp -m0600 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/mon/userfile + +install -Dp -m0755 mon.cgi-%{moncgi_version}/mon.cgi $RPM_BUILD_ROOT%{_localstatedir}/www/cgi-bin/mon.cgi + +# Fix permissions in examples documentation files +chmod -x mon.cgi-1.52/mon.cgi \ + clients/skymon/skymon \ + mon.cgi-1.52/util/moncgi-appsecret.pl \ + doc/README.snmpdiskspace.monitor \ + utils/cf-to-hosts \ + clients/batch-example \ + utils/syslog.monitor + + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%post +/sbin/chkconfig --add mon + + +%preun +if [ $1 -eq 0 ]; then + /sbin/service mon stop &>/dev/null || : + /sbin/chkconfig --del mon +fi + + +%postun +/sbin/service mon condrestart &>/dev/null || : + + +%files +%defattr(-, root, root, -) +%doc CHANGES COPYING COPYRIGHT CREDITS README TODO doc/README.* +%doc KNOWN-PROBLEMS utils/ VERSION +%doc alerts/*/*.README mon.cgi-1.52/ +%doc clients/{skymon,batch-example} etc/*.cf etc/example.m4 etc/example.monshowrc +%config(noreplace) %{_sysconfdir}/mon/ +%{_initrddir}/* +%{_mandir}/man?/* +%{_localstatedir}/www/cgi-bin/mon.cgi +%{_bindir}/* +%{_localstatedir}/lib/mon/ +%{_libdir}/mon/ + +%attr(2755, root, uucp) %{_libdir}/mon/mon.d/dialin.monitor.wrap + + +%changelog +* Sun Jul 13 2008 Lubomir Rintel - 1.2.0-2 +- Refactor a bit, to fit Fedora customs and guidelines +- Fix use of optflags +- Fix file encodings +- Do not start service by default +- Remove unneeded requires +- Fix file modes + +* 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 +- Fixed problems with perl-modules. + +* Fri Jan 09 2004 Dag Wieers - 0.99.2-0 +- Initial package. (using DAR) diff --git a/sources b/sources index e69de29..10de733 100644 --- a/sources +++ b/sources @@ -0,0 +1,3 @@ +73631aa8d71beaf2dc5d655785cc5063 all-alerts.tar.bz2 +ed52e4d4c6bbe8bca72f2a7843c0bcea mon-1.2.0.tar.bz2 +0bfe8402b83679307ce50d0dfc56bd45 mon.cgi-1.52.tar.bz2 diff --git a/userfile b/userfile new file mode 100644 index 0000000..698b3d8 --- /dev/null +++ b/userfile @@ -0,0 +1 @@ +# user: passwd From 21aef2316e73651227909d6e48f89807a29e492e Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 20 Feb 2009 14:55:00 +0000 Subject: [PATCH 3/5] - Remove AOL::TOC - Add most of shipped monitors (GDC #581) --- mon.spec | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/mon.spec b/mon.spec index 8372460..0a5ba6b 100644 --- a/mon.spec +++ b/mon.spec @@ -1,9 +1,12 @@ +# TODO: Split monitors and alerts into subpackages +# they drag in way too much dependencies + %define moncgi_version 1.52 Name: mon Summary: General-purpose resource monitoring system Version: 1.2.0 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: Applications/Internet URL: http://www.kernel.org/software/mon/ @@ -80,13 +83,11 @@ install -d -m0755 $RPM_BUILD_ROOT%{_bindir} \ $RPM_BUILD_ROOT%{_localstatedir}/www/cgi-bin/ \ $RPM_BUILD_ROOT%{_localstatedir}/lib/mon/{log.d,state.d}/ -make install -C mon.d \ - MONPATH="$RPM_BUILD_ROOT%{_libdir}/mon" - install -p -m0755 mon clients/moncmd clients/monshow clients/skymon/skymon $RPM_BUILD_ROOT%{_bindir} install -p -m0644 doc/*.1 $RPM_BUILD_ROOT%{_mandir}/man1/ install -p -m0644 doc/*.8 $RPM_BUILD_ROOT%{_mandir}/man8/ +install -p -m0755 mon.d/*.wrap mon.d/*.monitor $RPM_BUILD_ROOT%{_libdir}/mon/mon.d/ install -p -m0755 alert.d/* $RPM_BUILD_ROOT%{_libdir}/mon/alert.d/ install -p -m0755 alerts/*/*.alert $RPM_BUILD_ROOT%{_libdir}/mon/alert.d/ @@ -139,13 +140,33 @@ fi %{_localstatedir}/www/cgi-bin/mon.cgi %{_bindir}/* %{_localstatedir}/lib/mon/ -%{_libdir}/mon/ - +%dir %{_libdir}/mon +%{_libdir}/mon/alert.d +%dir %{_libdir}/mon/mon.d +%{_libdir}/mon/mon.d/*.monitor %attr(2755, root, uucp) %{_libdir}/mon/mon.d/dialin.monitor.wrap +# These packages are not in EPEL +%if 0%{?rhel} <= 5 +# perl(Expect) +%exclude %{_libdir}/mon/mon.d/dialin.monitor +# perl(Authen::Radius) +%exclude %{_libdir}/mon/mon.d/radius.monitor +%endif + +# These are not in Fedora either +# perl(AOL::TOC) +%exclude %{_libdir}/mon/alert.d/aim.alert +# perl(Filesys::DiskSpace) +%exclude %{_libdir}/mon/mon.d/freespace.monitor + %changelog -* Sun Jul 13 2008 Lubomir Rintel - 1.2.0-2 +* Fri Feb 20 2009 Lubomir Rintel (Good Data) - 1.2.0-3 +- Remove AOL::TOC +- Add most of shipped monitors (GDC #581) + +* Sun Jul 13 2008 Lubomir Rintel (Good Data) - 1.2.0-2 - Refactor a bit, to fit Fedora customs and guidelines - Fix use of optflags - Fix file encodings From 47f436a505f72c7a45bdb2f16231f433aac8039e Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:39:23 +0000 Subject: [PATCH 4/5] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ee5e152..26bd3e6 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: mon -# $Id$ +# $Id: Makefile,v 1.1 2008/07/23 15:58:31 kevin Exp $ 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 +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 32e6750273796853229cd71929297a160faeda70 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 03:36:41 +0000 Subject: [PATCH 5/5] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch 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 26bd3e6..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: mon -# $Id: Makefile,v 1.1 2008/07/23 15:58:31 kevin Exp $ -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 $$d/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/branch b/branch deleted file mode 100644 index 1c26f78..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-9