173 lines
6.4 KiB
RPMSpec
173 lines
6.4 KiB
RPMSpec
|
%define moncgi_version 1.52
|
||
|
|
||
|
Name: mon
|
||
|
Version: 1.2.0
|
||
|
Release: 3mamba
|
||
|
Summary: A scheduler and alert management tool used for monitoring service availability and triggering alerts upon failure detection
|
||
|
Group: System/Servers
|
||
|
Vendor: openmamba
|
||
|
Distribution: openmamba
|
||
|
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
||
|
URL: http://www.kernel.org/pub/software/admin/mon/html/
|
||
|
Source0: http://www.giano.lkams.kernel.org/pub/software/admin/mon/mon-%{version}.tar.bz2
|
||
|
Source1: mon-initscript
|
||
|
Source2: mon-lvs.alert
|
||
|
Source3: mon-bring-ha-down.alert
|
||
|
Source4: mon-squid.monitor
|
||
|
Source5: http://www.kernel.org/pub/software/admin/mon/contrib/all-monitors.tar.gz
|
||
|
Source6: http://www.kernel.org/pub/software/admin/mon/contrib/all-alerts.tar.gz
|
||
|
Source7: http://www.kernel.org/pub/software/admin/mon/contrib/cgi-bin/mon.cgi/mon.cgi-%{moncgi_version}.tar.bz2
|
||
|
Source8: mon-bring-ha-up.alert
|
||
|
Patch0: mon-1.2.0-Makefile.patch
|
||
|
License: GPL
|
||
|
## AUTOBUILDREQ-BEGIN
|
||
|
BuildRequires: glibc-devel
|
||
|
BuildRequires: libtirpc-devel
|
||
|
## AUTOBUILDREQ-END
|
||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||
|
|
||
|
%description
|
||
|
mon is a general-purpose scheduler and alert management tool used for monitoring service availability and triggering alerts upon failure detection.
|
||
|
mon was designed to be open and extensible in the sense that it supports arbitrary monitoring facilities and alert methods via a common interface, all of which are easily implemented with programs in C, Perl, shell, etc., SNMP traps, and special mon traps.
|
||
|
mon views resource monitoring as two separate tasks: the testing of a condition, and triggering an action upon failure. mon was designed to implement the testing and action-taking tasks as separate, stand-alone programs. mon is fundamentally a scheduler which executes the monitors (each test a specific condition), and calls the appropriate alerts if the monitor fails.
|
||
|
The decision to invoke an alert is governed by logic which offers various "squelch" features and dependencies, all of which are configurable by the user.
|
||
|
Monitors and alerts are not a part of the core mon server, even though 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 necessary, the mon server does not need to be changed.
|
||
|
This makes mon easily extensible.
|
||
|
|
||
|
%prep
|
||
|
%setup -q
|
||
|
%patch0 -p1
|
||
|
|
||
|
## fix an incorrect autodiscovered -Dopt dependency
|
||
|
#%define __perl_requires %{_builddir}/%{name}-%{version}/perl_requires.sh
|
||
|
#cat > perl_requires.sh << _EOF
|
||
|
##! /bin/sh
|
||
|
#%{_prefix}/lib/rpm/find-requires %{buildroot} %{_target_cpu} | grep -v "\-Dopt"
|
||
|
#_EOF
|
||
|
#chmod +x perl_requires.sh
|
||
|
|
||
|
%build
|
||
|
%make -C mon.d LDLIBS="-ltirpc"
|
||
|
|
||
|
%install
|
||
|
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
|
||
|
|
||
|
make -C mon.d install MONPATH=%{buildroot}%{_libdir}/mon
|
||
|
make install DESTDIR=%{buildroot}
|
||
|
|
||
|
install -m 755 %{S:1} %{buildroot}%{_initrddir}/mon
|
||
|
install -m 755 %{S:2} %{buildroot}%{_libdir}/mon/alert.d/lvs.alert
|
||
|
install -m 755 %{S:3} %{buildroot}%{_libdir}/mon/alert.d/bring-ha-down.alert
|
||
|
install -m 755 %{S:4} %{buildroot}%{_libdir}/mon/mon.d/squid.monitor
|
||
|
install -m 755 %{S:8} %{buildroot}%{_libdir}/mon/alert.d/bring-ha-up.alert
|
||
|
|
||
|
#sed -i "s|/usr/lib/sendmail|/usr/sbin/sendmail|" \
|
||
|
# %{buildroot}%{_libdir}/mon/alert.d/*
|
||
|
|
||
|
install -d %{buildroot}/var/log/mon
|
||
|
|
||
|
rm -f %{buildroot}%{_sysconfdir}/mon/S99mon
|
||
|
|
||
|
# install additional monitors and alerts
|
||
|
install -d %{buildroot}%{_libdir}/mon/examples
|
||
|
|
||
|
pushd %{buildroot}%{_libdir}/mon/examples
|
||
|
tar xzf %{S:5}
|
||
|
tar xzf %{S:6}
|
||
|
sed -i "s|/usr/local/bin/perl|/usr/bin/perl|" \
|
||
|
alerts/*/* monitors/*/*
|
||
|
# remove aim to avoid a perl dependency on aol perl module we don't want
|
||
|
rm -rf alerts/aim
|
||
|
popd
|
||
|
|
||
|
%clean
|
||
|
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
|
||
|
|
||
|
%preun
|
||
|
if [ $1 -eq 0 ]; then
|
||
|
# erase
|
||
|
chkconfig mon
|
||
|
if [ $? -eq 0 ]; then
|
||
|
service mon stop
|
||
|
chkconfig --del mon
|
||
|
fi
|
||
|
fi
|
||
|
exit 0
|
||
|
|
||
|
%postun
|
||
|
if [ $1 -eq 1 ]; then
|
||
|
# upgrade
|
||
|
chkconfig mon
|
||
|
[ $? -eq 0 ] && service mon restart
|
||
|
fi
|
||
|
exit 0
|
||
|
|
||
|
%files
|
||
|
%defattr(-,root,root)
|
||
|
%dir %{_sysconfdir}/mon
|
||
|
%config(noreplace) %{_sysconfdir}/mon/*
|
||
|
%{_initrddir}/mon
|
||
|
%dir %{_libdir}/mon
|
||
|
%dir %{_libdir}/mon/mon.d
|
||
|
%{_libdir}/mon/mon.d/*
|
||
|
%dir %{_libdir}/mon/state.d
|
||
|
%{_libdir}/mon/state.d/*
|
||
|
%dir %{_libdir}/mon/alert.d
|
||
|
%{_libdir}/mon/alert.d/*
|
||
|
%{_libdir}/mon/mon
|
||
|
%dir %{_libdir}/mon/examples
|
||
|
%{_libdir}/mon/examples/*
|
||
|
%dir /var/log/mon
|
||
|
%{_mandir}/man1/*
|
||
|
%{_mandir}/man8/*
|
||
|
|
||
|
%changelog
|
||
|
* Mon Nov 19 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.0-3mamba
|
||
|
- remove monitor which requires obsoleted module perl-LWP-Parallel-UserAgent
|
||
|
|
||
|
* Fri Feb 05 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.0-2mamba
|
||
|
- rebuilt to remove executable requirements
|
||
|
|
||
|
* Thu Jan 01 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.0-1mamba
|
||
|
- automatic update by autodist
|
||
|
|
||
|
* Wed Oct 18 2006 Davide Madrisan <davide.madrisan@qilinux.it> 0.99.2-11qilnx
|
||
|
- specfile fixes and updates
|
||
|
- stop and restart the mon service using the 'service' command
|
||
|
- fixed %%preun script
|
||
|
|
||
|
* Thu Nov 25 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-10qilnx
|
||
|
- added bring-ha-up.alert script to allow ha auto-failback
|
||
|
|
||
|
* Fri Oct 15 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-9qilnx
|
||
|
- added additional monitors and alerts from ftp.kernel.org as examples
|
||
|
|
||
|
* Thu Oct 14 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-8qilnx
|
||
|
- added squid.monitor script
|
||
|
- changed references to sendmail from /usr/lib/sendmail to /usr/sbin/sendmail
|
||
|
|
||
|
* Thu Oct 14 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-7qilnx
|
||
|
- fix for previous fix
|
||
|
|
||
|
* Thu Oct 14 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-6qilnx
|
||
|
- added bring-ha-down.alert script for use with heartbeat
|
||
|
|
||
|
* Fri Jun 18 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-5qilnx
|
||
|
- really fixed initscript (oops I forgot to add the install line)
|
||
|
- don't overwrite config files on update
|
||
|
- create log directory (/var/log/mon)
|
||
|
|
||
|
* Thu Jun 10 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-4qilnx
|
||
|
- added script lvs.alert
|
||
|
- fixed initscript restart
|
||
|
|
||
|
* Mon May 03 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-3qilnx
|
||
|
- fixed requirement list (excluded "-Dopt")
|
||
|
|
||
|
* Fri Apr 30 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-2qilnx
|
||
|
- fixed references tu /usr/local/bin/perl
|
||
|
|
||
|
* Fri Apr 30 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 0.99.2-1qilnx
|
||
|
- first build
|