Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:atzewilms:monitoring
check_mk
check_mk.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File check_mk.spec of Package check_mk
# # spec file for package nagios-check_mk # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: check_mk Summary: Nagios Addon check_mk Version: 1.1.10p3 Release: 1 Url: http://mathias-kettner.de/checkmk_index.html License: GPL v2 or later Group: System/Monitoring BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch PreReq: coreutils PreReq: sed PreReq: /bin/logger Requires: nagios apache2 apache2-mod_python #Source0: %{realname}-%{version}.tar.bz2 Source0: check_mk-%{version}.tar.gz #Source1: check_mk_setup.conf Source2: check_mk-apache2.conf Source3: defaults %define nnmmsg logger -t %{name}/rpm %define nsusr nagios %define nsgrp nagios %define cmdgrp nagcmd %description Check_mk adopts a new a approach for collecting data from operating systems and network components. It obsoletes NRPE, check_by_ssh, NSClient and check_snmp. It has many benefits, the most important of which are: * Significant reduction of CPU usage on the Nagios * host. * Automatic inventory of items to be checked on * hosts. http://mathias-kettner.de/check_mk.html %package agent Summary: Agent for check_mk Group: System/Monitoring Requires: xinetd %description agent Check_mk adopts a new a approach for collecting data from operating systems and network components. It obsoletes NRPE, check_by_ssh, NSClient and check_snmp. It has many benefits, the most important of which are: * Significant reduction of CPU usage on the Nagios * host. * Automatic inventory of items to be checked on * hosts. %prep %setup -q -n %{name}-%{version} %build %install #454 mkdir -p $DESTDIR$modulesdir && #455 create_defaults > $DESTDIR$modulesdir/defaults && mkdir -p %buildroot/usr/share/check_mk/checks tar xzf checks.tar.gz -C %buildroot/usr/share/check_mk/checks mkdir -p %buildroot/usr/share/nagios tar xzf htdocs.tar.gz -C %buildroot/usr/share/nagios for php in %buildroot/usr/share/nagios/*php; do sed -ri 's@\$vardir *= *"(.*)"@$vardir="'"/var/lib/check_mk"'"@' $php done mkdir -p %buildroot/usr/share/check_mk/web tar xzf web.tar.gz -C %buildroot/usr/share/check_mk/web mkdir -p %buildroot/usr/share/pnp/templates tar xzf pnp-templates.tar.gz -C %buildroot/usr/share/pnp/templates mkdir -p %buildroot/usr/share/check_mk/modules rm -f %buildroot/usr/share/check_mk/modules/check_mk{,_admin} tar xzf modules.tar.gz -C %buildroot/usr/share/check_mk/modules mkdir -p %buildroot/%_docdir/check_mk tar xzf doc.tar.gz -C %buildroot/%_docdir/check_mk mkdir -p %buildroot/%_docdir/check_mk/checks tar xzf checkman.tar.gz -C %buildroot/%_docdir/check_mk/checks if [ -f mibs.tar.gz ] ; then mkdir -p %buildroot/usr/share/snmp/mibs tar xzf mibs.tar.gz -C %buildroot/usr/share/snmp/mibs fi mkdir -p %buildroot/usr/lib/check_mk/agents tar xzf agents.tar.gz -C %buildroot/usr/lib/check_mk/agents for agent in %buildroot/usr/lib/check_mk/agents/*; do sed -ri 's@^export MK_LIBDIR="(.*)"@export MK_LIBDIR="'"/usr/lib/check_mk/agents"'"@' $agent sed -ri 's@^export MK_CONFDIR="(.*)"@export MK_CONFDIR="'"/etc/check_mk"'"@' $agent done mkdir -p %buildroot/usr/bin cp %buildroot/usr/lib/check_mk/agents/check_mk_agent.linux %buildroot/usr/bin/check_mk_agent mkdir -p %buildroot/etc/xinetd.d cp %buildroot/usr/lib/check_mk/agents/xinetd.conf %buildroot/etc/xinetd.d/check_mk-agent rm -rf %buildroot/usr/lib/check_mk/agents mkdir -p %buildroot/var/lib/check_mk/{autochecks,counter,precompiled,cache,logwatch} mkdir -p %buildroot/etc/check_mk/conf.d tar xzf conf.tar.gz -C %buildroot/etc/check_mk/conf.d if [ -e %buildroot/etc/check_mk/check_mk.cfg -a ! -e %buildroot/etc/check_mk/main.mk ] ; then mv -v %buildroot/etc/check_mk/check_mk.cfg %buildroot/etc/check_mk/main.mk fi for f in %buildroot/var/lib/check_mk/*.cfg %buildroot/etc/check_mk/conf.d/*.cfg ; do if [ -f "$f" ] ; then mv -v $f ${f%.cfg}.mk fi done if [ ! -f %buildroot/etc/check_mk/main.mk ] ; then tar xzf conf.tar.gz --to-stdout > %buildroot/etc/check_mk/main.mk fi echo 'All files in this directory that end with .mk will be read in after main.mk' > %buildroot/etc/check_mk/conf.d/README if [ ! -d %buildroot/var/lib/nagios/pnp ] ; then mkdir -p %buildroot/var/lib/nagios/pnp fi mkdir -p %buildroot%_bindir rm -f %buildroot%_bindir/check_mk echo -e "#!/bin/sh\nexec python $buildroot/usr/share/%{name}/modules/check_mk.py "'"$@"' > %buildroot%_bindir/check_mk sed -i "s#@BINDIR@#%_bindir#g" %buildroot%_docdir/%{name}/check_mk_templates.cfg sed -i "s#@VARDIR@#/var/lib/check_mk#g" %buildroot%_docdir/%{name}/check_mk_templates.cfg sed -i "s#@CGIURL@#/nagios/cgi-bin#g" %buildroot%_docdir/%{name}/check_mk_templates.cfg sed -i "s#@CHECK_ICMP@#/usr/lib/nagios/plugins/check_icmp#g" %buildroot%_docdir/%{name}/check_mk_templates.cfg sed -i "s#@NAGIOSURL@#/nagios#g" %buildroot%_docdir/%{name}/check_mk_templates.cfg mkdir -p %buildroot/etc/nagios/objects cp %buildroot/%_docdir/check_mk/check_mk_templates.cfg %buildroot/etc/nagios/objects/check_mk_templates.cfg sed -i "s#/usr/lib/nagios/plugins/check_icmp#/usr/lib/nagios/plugins/check_ping -w 3000.0,80% -c 5000.0,100% -p 1 -4 -H #g" %buildroot/etc/nagios/objects/check_mk_templates.cfg mkdir -p %buildroot/etc/apache2/conf.d %{__install} -m 0644 %{SOURCE2} %buildroot/etc/apache2/conf.d/check_mk.conf %{__install} -m 0644 %{SOURCE3} %buildroot/usr/share/check_mk/modules/defaults sed -i "s#VERSION#%{version}#g" %buildroot/usr/share/check_mk/modules/defaults sed -i "s#NAGIOSUSER#%{nsusr}#g" %buildroot/usr/share/check_mk/modules/defaults sed -i "s#WWWGRP#%{cmdgrp}#g" %buildroot/usr/share/check_mk/modules/defaults %clean rm -rf %buildroot %pre # Create user and group on the system if necessary # default group: nagios if getent group %{nsgrp} >/dev/null then : OK group %{nsgrp} already present else groupadd -r %{nsgrp} 2>/dev/null || : %{nnmmsg} "Added group %{nsgrp} for package %{name}" fi # default group: nagcmd if getent group %{cmdgrp} >/dev/null then : OK group %{cmdgrp} already present else groupadd -r %{cmdgrp} 2>/dev/null || : %{nnmmsg} "Added group %{cmdgrp} for package %{name}" fi # default user: nagios if id %{nsusr} > /dev/null 2>&1 then : OK user %{nsusr} already present else useradd -r -o -g %{nsgrp} -s /bin/false -c "User for Nagios" -d /var/lib/%{nsusr} %{nsusr} 2> /dev/null || : %{nnmmsg} "Added user %{nsusr} for package %{name}" fi #%post #%preun #%postun %files %defattr(-,root,root) %doc VERSION INSTALL COPYING ChangeLog AUTHORS %dir /etc/check_mk %dir /etc/check_mk/conf.d %dir /usr/share/pnp/templates %dir /etc/apache2 %dir /etc/apache2/conf.d %dir /usr/share/nagios %dir /usr/share/pnp %dir /usr/share/check_mk %dir /usr/share/check_mk/checks %dir /usr/share/check_mk/modules %dir /usr/share/check_mk/web /usr/share/nagios/* /usr/share/pnp/templates/* %config %attr(0644,root,root) /etc/apache2/conf.d/check_mk.conf %config /etc/check_mk/conf.d/README %config /etc/check_mk/conf.d/main.mk-1.0.39 %attr(0644,%nsusr,%nsgrp) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/check_mk/main.mk /etc/nagios /etc/nagios/objects %attr(0644,%nsusr,%nsgrp) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/nagios/objects/check_mk_templates.cfg %dir %attr(0744,%nsusr,%nsgrp) /var/lib/check_mk %dir %attr(0744,%nsusr,%nsgrp) /var/lib/check_mk/autochecks %dir %attr(0744,%nsusr,%nsgrp) /var/lib/check_mk/cache %dir %attr(0744,%nsusr,%nsgrp) /var/lib/check_mk/precompiled %dir %attr(0744,%nsusr,%nsgrp) /var/lib/check_mk/logwatch %defattr(0755,root,root) %_bindir/check_mk /usr/share/check_mk/checks/* /usr/share/check_mk/modules/* /usr/share/check_mk/web/* %attr(0644,root,root) /usr/share/check_mk/web/check_mk.css %attr(0644,root,root) /usr/share/check_mk/modules/defaults %defattr(-,root,root) %dir %_docdir/check_mk/ %files agent %defattr(-,root,root) %config /etc/xinetd.d/check_mk-agent %defattr(755,root,root) %_bindir/check_mk_agent %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor