mon/mon.spec

164 lines
6.4 KiB
RPMSpec
Raw Permalink Normal View History

%define moncgi_version 1.52
Name: mon
Version: 1.2.3
Release: 1mamba
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: https://mirrors.edge.kernel.org/pub/software/admin/mon/html/
Source0: https://github.com/tj/mon.git/%{version}/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: libperl
BuildRequires: perl(SNMP_Session)
BuildRequires: perl-Authen-Radius
BuildRequires: perl-HTML-Parser
BuildRequires: perl-HTTP-Cookies
BuildRequires: perl-HTTP-Message
BuildRequires: perl-Net-SSLeay
BuildRequires: perl-Net-Telnet
BuildRequires: perl-NetSNMP
BuildRequires: perl-ParallelUserAgent
BuildRequires: perl-URI
BuildRequires: perl-devel
BuildRequires: perl-libwww
## AUTOBUILDREQ-END
%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.
%debug_package
%prep
%setup -q
#%patch0 -p1
%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 -D -m0755 mon %{buildroot}%{_bindir}/mon
#install -m 755 %{S:1} %{buildroot}%{_initrddir}/mon
install -D -m0644 %{S:2} %{buildroot}%{_prefix}/lib/mon/alert.d/lvs.alert
install -D -m0644 %{S:3} %{buildroot}%{_prefix}/lib/mon/alert.d/bring-ha-down.alert
install -D -m0644 %{S:4} %{buildroot}%{_prefix}/lib/mon/mon.d/squid.monitor
install -D -m0644 %{S:8} %{buildroot}%{_prefix}/lib/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}%{_prefix}/lib/mon/examples
pushd %{buildroot}%{_prefix}/lib/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}
%files
%defattr(-,root,root)
#%dir %{_sysconfdir}/mon
#%config(noreplace) %{_sysconfdir}/mon/*
%{_bindir}/mon
%dir %{_prefix}/lib/mon
%dir %{_prefix}/lib/mon/mon.d
%{_prefix}/lib/mon/mon.d/*
#%dir %{_prefix}/lib/mon/state.d
#%{_prefix}/lib/mon/state.d/*
%dir %{_prefix}/lib/mon/alert.d
%{_prefix}/lib/mon/alert.d/*
%dir %{_prefix}/lib/mon/examples
%{_prefix}/lib/mon/examples/*
%dir /var/log/mon
#%{_mandir}/man1/*
#%{_mandir}/man8/*
%changelog
* Mon Dec 27 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.3-1mamba
- update to 1.2.3
* 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