munin/munin.spec

447 lines
16 KiB
RPMSpec
Raw Normal View History

# norootforbuild
%define htmldir /srv/www/htdocs/munin
%define cgidir /srv/www/cgi-bin
%define dbdir /var/lib/munin
%define logdir /var/log/munin
%define plugindir /usr/lib/munin/plugins
Name: munin
Version: 2.0.11.1
Release: 1
License: GPL-2.0
Summary: Network-wide graphing framework (grapher/gatherer)
Url: http://munin-monitoring.org/
Group: System/Monitoring
Source0: http://heanet.dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.gz
Source1: Makefile.config
%if 0%{?suse_version} < 1220
Source2: munin-node.rc
%endif
Source3: munin.cron.d
Source4: munin.logrotate
Source5: munin-node.logrotate
Source7: plugins.conf
%if 0%{?suse_version} >= 1220
Source8: munin-node.tmpfiles
Source9: munin-node.service
%endif
# https://github.com/ifad/nginx-munin/archive/master.zip
Source10: nginx-munin.zip
BuildRequires: perl-HTML-Template perl-Log-Log4perl perl-Net-Server perl-Net-SNMP
BuildRequires: perl-Net-SSLeay
BuildRequires: html2text
BuildRequires: pwdutils
BuildRequires: unzip
%if 0%{?suse_version} >= 1220
%{?systemd_requires}
BuildRequires: systemd
BuildRequires: htmldoc
%else
BuildRequires: sysvinit
%endif
Requires: perl-base = %{perl_version}
Requires: perl-HTML-Template perl-Log-Log4perl perl-Net-Server perl-Net-SNMP
Requires: perl-Net-SSLeay perl-File-Copy-Recursive perl-Date-Manip
Requires: perl-IO-Socket-INET6 pwdutils rrdtool
Recommends: logrotate cron
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
Munin is a highly flexible and powerful solution used to create graphs of
virtually everything imaginable throughout your network, while still
maintaining a rattling ease of installation and configuration.
This package contains the grapher/gatherer. You will only need one instance of
it in your network. It will periodically poll all the nodes in your network
it's aware of for data, which it in turn will use to create graphs and HTML
pages, suitable for viewing with your graphical web browser of choice.
Munin is written in Perl, and relies heavily on Tobi Oetiker's excellent
RRDtool.
%package node
Summary: Network-wide graphing framework (node)
Group: System/Monitoring
Requires: perl-base = %{perl_version}
Requires: perl-HTML-Template perl-Log-Log4perl perl-Net-Server perl-Net-SNMP
Requires: perl-Net-SSLeay
Requires: pwdutils ps sysstat logdigest
Recommends: logrotate
BuildArch: noarch
%description node
Munin is a highly flexible and powerful solution used to create graphs of
virtually everything imaginable throughout your network, while still
maintaining a rattling ease of installation and configuration.
This package contains node software. You should install it on all the nodes
in your network. It will know how to extract all sorts of data from the
node it runs on, and will wait for the gatherer to request this data for
further processing.
It includes a range of plugins capable of extracting common values such as
cpu usage, network usage, load average, and so on. Creating your own plugins
which are capable of extracting other system-specific values is very easy,
and is often done in a matter of minutes. You can also create plugins which
relay information from other devices in your network that can't run Munin,
such as a switch or a server running another operating system, by using
SNMP or similar technology.
Munin is written in Perl, and relies heavily on Tobi Oetiker's excellent
RRDtool. To see a real example of Munin in action, take a peek at
<http://www.linpro.no/projects/munin/example/>.
%prep
%setup -q
cp %{SOURCE1} .
unzip %{SOURCE10}
%build
%__make
%install
%makeinstall
%__mkdir_p %{buildroot}/%{_sysconfdir}/munin/plugins
%__mkdir_p %{buildroot}/%{_sysconfdir}/munin/munin-conf.d
%__mkdir_p %{buildroot}/%{_sysconfdir}/cron.d
%__install -m0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/cron.d/munin
%__mkdir_p %{buildroot}/etc/logrotate.d
%__install -m0644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/logrotate.d/munin
%__install -m0644 %{SOURCE5} %{buildroot}/%{_sysconfdir}/logrotate.d/munin-node
%__install -m0644 %{SOURCE7} %{buildroot}/%{_sysconfdir}/munin/plugin-conf.d/munin-node
%__mkdir_p %{buildroot}/sbin
%if 0%{?suse_version} < 1220
%__mkdir_p %{buildroot}/%{_sysconfdir}/init.d
%__install -m0755 %{SOURCE2} %{buildroot}/%{_sysconfdir}/init.d/munin-node
%__ln_s %{_sysconfdir}/init.d/munin-node $RPM_BUILD_ROOT/sbin/rcmunin-node
%else
%__ln_s /sbin/service $RPM_BUILD_ROOT/sbin/rcmunin-node
%endif
%if 0%{?suse_version} >= 1220
%__mkdir_p %{buildroot}/%{_prefix}/lib/tmpfiles.d
%__install -m0644 %{SOURCE8} %{buildroot}/%{_prefix}/lib/tmpfiles.d/munin-node.conf
%__mkdir_p %{buildroot}/%{_unitdir}
%__install -m0644 %{SOURCE9} %{buildroot}/%{_unitdir}/munin-node.service
%endif
%__mkdir_p %{buildroot}/%{logdir}
%__mkdir_p %{buildroot}/%{htmldir}
%__mkdir_p %{buildroot}/%{dbdir}
%__mkdir_p %{buildroot}/%{dbdir}/plugin-state
%__install -m0755 nginx-munin-master/nginx_* %{buildroot}/%{plugindir}
ln nginx-munin-master/README.org README.nginx
%clean
%{__rm} -rf %{buildroot}
%pre
getent group munin >/dev/null || /usr/sbin/groupadd -r munin
getent passwd munin > /dev/null || /usr/sbin/useradd -r -c "munin monitoring" -d %{dbdir} -g munin munin
%post
chown -R munin:munin %{htmldir}
chown -R munin:munin %{dbdir}
chmod 755 %{dbdir}
touch %{logdir}/munin-graph.log %{logdir}/munin-html.log %{logdir}/munin-nagios.log %{logdir}/munin-limits.log %{logdir}/munin-update.log
chown munin:munin %{logdir}/*
chown root:root %{logdir}/munin-node.log* >/dev/null 2>&1 || true
## Node
%pre node
getent group munin >/dev/null || /usr/sbin/groupadd -r munin
getent passwd munin > /dev/null || /usr/sbin/useradd -r -c "munin monitoring" -d %{dbdir} -g munin munin
%if 0%{?suse_version} >= 1220
%service_add_pre munin-node.service
%endif
%post node
if [ $1 = 1 ]
then
%if 0%{?suse_version} < 1220
/sbin/chkconfig --add munin-node
%endif
/usr/sbin/munin-node-configure --shell | sh
fi
chown -R munin:munin %{dbdir}
chmod 755 %{dbdir}
touch %{logdir}/munin-node.log
chown munin:munin %{logdir}/*
chown root:root %{logdir}/munin-node.log*
chown -R nobody:nobody %{dbdir}/plugin-state/* >/dev/null 2>&1
%if 0%{?suse_version} >= 1220
systemd-tmpfiles --create /usr/lib/tmpfiles.d/munin-node.conf
%service_add_post munin-node.service
%else
/etc/init.d/munin-node status >/dev/null 2>&1 || /etc/init.d/munin-node start
%endif
%preun node
if [ $1 = 1 ] ; then
%if 0%{?suse_version} < 1220
/sbin/service munin-node stop >/dev/null 2>&1
/sbin/chkconfig --del munin-node
%endif
rmdir %{logdir} 2>/dev/null || true
fi
%if 0%{?suse_version} >= 1220
%service_del_preun munin-node.service
%else
%stop_on_removal munin-node
%endif
%postun node
%if 0%{?suse_version} >= 1220
%service_del_postun munin-node.service
%else
%restart_on_update munin-node
%{insserv_cleanup}
%endif
%files
%defattr(-, root, root)
%doc ChangeLog COPYING README UPGRADING README.nginx
%{_bindir}/munin-check
%{_bindir}/munin-cron
%{_bindir}/munindoc
%dir %{_prefix}/lib/munin
%{_prefix}/lib/munin/munin-graph
%{_prefix}/lib/munin/munin-html
%{_prefix}/lib/munin/munin-datafile2storable
%{_prefix}/lib/munin/munin-storable2datafile
%{_prefix}/lib/munin/munin-limits
%{_prefix}/lib/munin/munin-update
%{_prefix}/lib/munin/DejaVuSans.ttf
%{_prefix}/lib/munin/DejaVuSansMono.ttf
%{cgidir}/munin-cgi-graph
%{cgidir}/munin-cgi-html
%attr(0755, munin, munin) %dir %{htmldir}
%attr(0444, munin, munin) %{htmldir}/.htaccess
%dir %{_sysconfdir}/munin
%dir %{_sysconfdir}/munin/munin-conf.d
%dir %{_sysconfdir}/munin/templates
%dir %{_sysconfdir}/munin/static
%config %{_sysconfdir}/munin/templates/*
%config %{_sysconfdir}/munin/static/*
%config %{_sysconfdir}/cron.d/munin
%config(noreplace) %{_sysconfdir}/munin/munin.conf
%config %{_sysconfdir}/logrotate.d/munin
%dir %{perl_vendorlib}/Munin
%dir %{perl_vendorlib}/Munin/Master
%{perl_vendorlib}/Munin/Master/Config.pm
%{perl_vendorlib}/Munin/Master/GraphOld.pm
%{perl_vendorlib}/Munin/Master/Group.pm
%{perl_vendorlib}/Munin/Master/GroupRepository.pm
%{perl_vendorlib}/Munin/Master/HTMLConfig.pm
%{perl_vendorlib}/Munin/Master/HTMLOld.pm
%{perl_vendorlib}/Munin/Master/Host.pm
%{perl_vendorlib}/Munin/Master/LimitsOld.pm
%{perl_vendorlib}/Munin/Master/Logger.pm
%{perl_vendorlib}/Munin/Master/Node.pm
%{perl_vendorlib}/Munin/Master/ProcessManager.pm
%{perl_vendorlib}/Munin/Master/Update.pm
%{perl_vendorlib}/Munin/Master/UpdateWorker.pm
%{perl_vendorlib}/Munin/Master/Utils.pm
%{perl_vendorlib}/Munin/Master/Worker.pm
%{_mandir}/man3/Munin::Master::Config.3pm.gz
%{_mandir}/man3/Munin::Master::Group.3pm.gz
%{_mandir}/man3/Munin::Master::GroupRepository.3pm.gz
%{_mandir}/man3/Munin::Master::HTMLOld.3pm.gz
%{_mandir}/man3/Munin::Master::Host.3pm.gz
%{_mandir}/man3/Munin::Master::LimitsOld.3pm.gz
%{_mandir}/man3/Munin::Master::Logger.3pm.gz
%{_mandir}/man3/Munin::Master::Node.3pm.gz
%{_mandir}/man3/Munin::Master::ProcessManager.3pm.gz
%{_mandir}/man3/Munin::Master::Update.3pm.gz
%{_mandir}/man3/Munin::Master::UpdateWorker.3pm.gz
%{_mandir}/man3/Munin::Master::Utils.3pm.gz
%{_mandir}/man3/Munin::Master::Worker.3pm.gz
%{_mandir}/man5/munin-node.conf.5.gz
%{_mandir}/man5/munin.conf.5.gz
%{_mandir}/man8/munin-check.8.gz
%{_mandir}/man8/munin-cron.8.gz
%{_mandir}/man8/munin-graph.8.gz
%{_mandir}/man8/munin-html.8.gz
%{_mandir}/man8/munin-limits.8.gz
%{_mandir}/man8/munin-update.8.gz
%{_mandir}/man8/munin.8.gz
%attr(0750, munin, munin) %dir %{logdir}
%attr(0755, munin, munin) %dir %{dbdir}
%files node
%defattr(-, root, root)
%{_sbindir}/munin-run
%{_sbindir}/munin-sched
%{_sbindir}/munin-node
%{_sbindir}/munin-node-configure
%if 0%{?suse_version} >= 1220
%{_prefix}/lib/tmpfiles.d/munin-node.conf
%{_unitdir}/munin-node.service
%endif
%dir %{_prefix}/lib/munin
%{_prefix}/lib/munin/munin-async
%{_prefix}/lib/munin/munin-asyncd
%{_prefix}/lib/munin/plugins/
/sbin/rcmunin-node
%if 0%{?suse_version} < 1220
%config %{_sysconfdir}/init.d/munin-node
%endif
%dir %{_sysconfdir}/munin/plugin-conf.d
%dir %{_sysconfdir}/munin/plugins
%config(noreplace) %{_sysconfdir}/munin/plugin-conf.d/munin-node
%config(noreplace) %{_sysconfdir}/munin/munin-node.conf
%config %{_sysconfdir}/logrotate.d/munin-node
%dir %{perl_vendorlib}/Munin/Common
%{perl_vendorlib}/Munin/Common/Config.pm
%{perl_vendorlib}/Munin/Common/Defaults.pm
%{perl_vendorlib}/Munin/Common/TLS.pm
%{perl_vendorlib}/Munin/Common/TLSClient.pm
%{perl_vendorlib}/Munin/Common/TLSServer.pm
%{perl_vendorlib}/Munin/Common/Timeout.pm
%{perl_vendorlib}/Munin/Common/DictFile.pm
%{perl_vendorlib}/Munin/Common/SyncDictFile.pm
%dir %{perl_vendorlib}/Munin/Node
%{perl_vendorlib}/Munin/Node/Config.pm
%dir %{perl_vendorlib}/Munin/Node/Configure
%{perl_vendorlib}/Munin/Node/Configure/Debug.pm
%{perl_vendorlib}/Munin/Node/Configure/History.pm
%{perl_vendorlib}/Munin/Node/Configure/HostEnumeration.pm
%{perl_vendorlib}/Munin/Node/Configure/Plugin.pm
%{perl_vendorlib}/Munin/Node/Configure/PluginList.pm
%{perl_vendorlib}/Munin/Node/Logger.pm
%{perl_vendorlib}/Munin/Node/OS.pm
%{perl_vendorlib}/Munin/Node/SNMPConfig.pm
%{perl_vendorlib}/Munin/Node/Server.pm
%{perl_vendorlib}/Munin/Node/Service.pm
%{perl_vendorlib}/Munin/Node/Session.pm
%{perl_vendorlib}/Munin/Node/Utils.pm
%{perl_vendorlib}/Munin/Node/ProxySpooler.pm
%{perl_vendorlib}/Munin/Node/SpoolReader.pm
%{perl_vendorlib}/Munin/Node/SpoolWriter.pm
%{perl_vendorlib}/Munin/Plugin.pm
%dir %{perl_vendorlib}/Munin/Plugin
%{perl_vendorlib}/Munin/Plugin/Pgsql.pm
%{perl_vendorlib}/Munin/Plugin/SNMP.pm
%{_mandir}/man1/munin-node-configure.1.gz
%{_mandir}/man1/munin-node.1.gz
%{_mandir}/man1/munin-run.1.gz
%{_mandir}/man1/munin-sched.1.gz
%{_mandir}/man1/munindoc.1.gz
%{_mandir}/man3/Munin::Common::Config.3pm.gz
%{_mandir}/man3/Munin::Common::Defaults.3pm.gz
%{_mandir}/man3/Munin::Common::TLS.3pm.gz
%{_mandir}/man3/Munin::Common::TLSClient.3pm.gz
%{_mandir}/man3/Munin::Common::TLSServer.3pm.gz
%{_mandir}/man3/Munin::Common::Timeout.3pm.gz
%{_mandir}/man3/Munin::Node::Config.3pm.gz
%{_mandir}/man3/Munin::Node::Configure::Debug.3pm.gz
%{_mandir}/man3/Munin::Node::Configure::History.3pm.gz
%{_mandir}/man3/Munin::Node::Configure::HostEnumeration.3pm.gz
%{_mandir}/man3/Munin::Node::Configure::Plugin.3pm.gz
%{_mandir}/man3/Munin::Node::Configure::PluginList.3pm.gz
%{_mandir}/man3/Munin::Node::Logger.3pm.gz
%{_mandir}/man3/Munin::Node::ProxySpooler.3pm.gz
%{_mandir}/man3/Munin::Node::OS.3pm.gz
%{_mandir}/man3/Munin::Node::SpoolReader.3pm.gz
%{_mandir}/man3/Munin::Node::SpoolWriter.3pm.gz
%{_mandir}/man3/Munin::Node::SNMPConfig.3pm.gz
%{_mandir}/man3/Munin::Node::Server.3pm.gz
%{_mandir}/man3/Munin::Node::Service.3pm.gz
%{_mandir}/man3/Munin::Node::Session.3pm.gz
%{_mandir}/man3/Munin::Node::Utils.3pm.gz
%{_mandir}/man3/Munin::Plugin.3pm.gz
%{_mandir}/man3/Munin::Plugin::Pgsql.3pm.gz
%{_mandir}/man3/Munin::Plugin::SNMP.3pm.gz
%attr(0750, munin, munin) %dir %{logdir}
%attr(0755, munin, munin) %dir %{dbdir}
%attr(0775, nobody, nobody) %dir %{dbdir}/plugin-state
%changelog
* Wed Jun 09 2010 Detlef Reichelt <detlef@links2linux.de> - 1.4.5
- new upstream version <1.4.5>
* bugfix release
* Sat Mar 06 2010 Detlef Reichelt <detlef@links2linux.de> - 1.4.4
- new upstream version <1.4.4>
* Thu Dec 31 2009 Detlef Reichelt <detlef@links2linux.de> - 1.4.3
- new upstream release <1.4.3>
* Mon Dec 21 2009 Detlef Reichelt <detlef@links2linux.de> - 1.4.2
- new upstream release <1.4.2>
* Mon Dec 07 2009 Detlef Reichelt <detlef@links2linux.de> - 1.4.1
- new upstream release <1.4.1>
* Sat Nov 28 2009 Detlef Reichelt <detlef@links2linux.de> - 1.4.0
- new upstream release <1.4.0>
* Sat Dec 27 2008 Detlef Reichelt 1.2.6
- add UTF8 patch
* Sat Jul 19 2008 Detlef Reichelt <1.2.6>-<0.pm.1>
- new upstream release <1.2.6>
* Wed Aug 15 2007 Detlef Reichelt <1.2.5>-<0.pm.1>
- new upstream release <1.2.5>
* Mon Oct 17 2005 Detlef Reichelt <detlef@links2linux.de>
- Fixed missing /sbin/rcmunin-node
* Sun Oct 16 2005 Detlef Reichelt <detlef@links2linux.de>
- First build for packman
* Mon Apr 3 2005 Rune Nordbe Skillingstad <runesk@linpro.no>
- 1.2.3 release
* Fri Apr 1 2005 Rune Nordbe Skillingstad <runesk@linpro.no>
- 1.2.2 release
- Fixed SF bug 1164481 (missing /srv/www/htdocs/munin)
- Fixed SF bug 1164477 (patch for Net::Domain on PPC64)
* Fri Mar 11 2005 Rune Nordbe Skillingstad <runesk@linpro.no>
- 1.2.1 release
* Wed Mar 9 2005 Rune Nordbe Skillingstad <runesk@linpro.no>
- Fixed erronumous path to web directory
- Added start of node if not running
* Thu Mar 8 2005 Rune Nordbe Skillingstad <runesk@linpro.no>
- Fixed some build path problems
* Thu Feb 24 2005 Rune Nordbe Skillingstad <runesk@linpro.no>
- New major release
* Wed Feb 9 2005 Rune Nordbe Skillingstad <runesk@linpro.no>
- Updated to version 1.2.0rc2.
- Removed Nagios stuff
- Added noreplace for some central configuration files
* Thu Nov 18 2004 Rune Nordbe Skillingstad <runesk@linpro.no>
- Updated to version 1.0.4
* Mon Nov 08 2004 Rune Nordbe Skillingstad <runesk@linpro.no>
- Updated version 1.0.3 / sync with redhat-build
* Wed Aug 04 2004 Rune Nordbe Skillingstad <runesk@linpro.no>
- Initial SuSE build
* Sun Feb 01 2004 Ingvar Hagelund <ingvar@linpro.no>
- Sync with CVS. Version 1.0.0pre2
* Sun Jan 18 2004 Ingvar Hagelund <ingvar@linpro.no>
- Sync with CVS. Change names to munin.
* Fri Oct 31 2003 Ingvar Hagelund <ingvar@linpro.no>
- Lot of small fixes. Now builds on more RPM distros
* Wed May 21 2003 Ingvar Hagelund <ingvar@linpro.no>
- Sync with CVS
- 0.9.5-1
* Tue Apr 1 2003 Ingvar Hagelund <ingvar@linpro.no>
- Sync with CVS
- Makefile-based install of core files
- Build doc (only pod2man)
* Thu Jan 9 2003 Ingvar Hagelund <ingvar@linpro.no>
- Sync with CVS, auto rpmbuild
* Thu Jan 2 2003 Ingvar Hagelund <ingvar@linpro.no>
- Fix spec file for RedHat 8.0 and new version of lrrd
* Wed Sep 4 2002 Ingvar Hagelund <ingvar@linpro.no>
- Small bugfixes in the rpm package
* Tue Jun 18 2002 Kjetil Torgrim Homme <kjetilho@linpro.no>
- new package