1 # +------------------------------------------------------------------+
2 # | ____ _ _ __ __ _ __ |
3 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
4 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
5 # | | |___| | | | __/ (__| < | | | | . \ |
6 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
8 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
9 # +------------------------------------------------------------------+
11 # This file is part of Check_MK.
12 # The official homepage is at http://mathias-kettner.de/check_mk.
14 # check_mk is free software; you can redistribute it and/or modify it
15 # under the terms of the GNU General Public License as published by
16 # the Free Software Foundation in version 2. check_mk is distributed
17 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
18 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
19 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
20 # tails. You should have received a copy of the GNU General Public
21 # License along with GNU Make; see the file COPYING. If not, write
22 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 # Boston, MA 02110-1301 USA.
25 Summary: Check_MK Agent
for Linux
27 Version: (automatically inserted
)
30 Group: System
/Monitoring
31 URL: http
://mathias
-kettner.de
/check_mk.html
32 Vendor: Mathias Kettner GmbH
33 Source: check
-mk
-agent
-%{_version}.tar.gz
34 BuildRoot: %{_topdir}/buildroot
38 Obsoletes
: check_mk
-agent check_mk_agent
39 Provides: check_mk
-agent check_mk_agent
42 The Check_MK Agent uses xinetd to provide information about the system
43 on TCP port
6556. This can be used to monitor the host via Check_MK.
45 %define _binaries_in_noarch_packages_terminate_build
0
48 %setup -n check
-mk
-agent
-%{_version}
57 mkdir -p $R
/etc
/xinetd.d
58 install -m
644 cfg_examples
/xinetd.conf $R
/etc
/xinetd.d
/check_mk
60 mkdir -p $R
/etc
/systemd
/system
61 install -m
644 cfg_examples
/systemd
/check_mk\@.service $R
/etc
/systemd
/system
62 install -m
644 cfg_examples
/systemd
/check_mk.socket $R
/etc
/systemd
/system
63 mkdir -p $R
/etc
/check_mk
65 install -m
755 check_mk_agent.linux $R
/usr
/bin
/check_mk_agent
66 install -m
755 check_mk_caching_agent.linux $R
/usr
/bin
/check_mk_caching_agent
67 install -m
755 waitmax $R
/usr
/bin
68 install -m
755 mk
-job $R
/usr
/bin
69 mkdir -p $R
/usr
/lib
/check_mk_agent
/plugins
70 mkdir -p $R
/usr
/lib
/check_mk_agent
/local
71 mkdir -p $R
/var
/lib
/check_mk_agent
72 mkdir -p $R
/var
/lib
/check_mk_agent
/job
73 mkdir -p $R
/var
/lib
/check_mk_agent
/spool
76 rm -rf $RPM_BUILD_ROOT
79 %config(noreplace
) /etc
/xinetd.d
/check_mk
80 %config(noreplace
) /etc
/systemd
/system
/check_mk@.service
81 %config(noreplace
) /etc
/systemd
/system
/check_mk.socket
84 /usr
/lib
/check_mk_agent
85 /var
/lib
/check_mk_agent
87 %define reload_xinetd
if which xinetd
>/dev
/null
2>&1 ; then if pgrep
-x xinetd
>/dev
/null
; then echo "Reloading xinetd..."
; service xinetd reload
; else echo "Starting xinetd..."
; service xinetd start
; fi ; fi
89 %define activate_xinetd
if which xinetd
>/dev
/null
2>&1 && which chkconfig
>/dev
/null
2>&1 ; then echo "Activating startscript of xinetd"
; chkconfig xinetd on
; fi
91 %define cleanup_rpmnew
if [ -f
/etc
/xinetd.d
/check_mk.rpmnew
] ; then rm /etc
/xinetd.d
/check_mk.rpmnew
; fi
93 %define systemd_enable
if which systemctl
>/dev
/null
2>&1 && ! which xinetd
>/dev
/null
2>&1 ; then echo "Enable Check_MK_Agent
in systemd..."
; systemctl
enable check_mk.socket
; systemctl restart sockets.target
; fi
96 if ! which xinetd
>/dev
/null
2>&1 && ! which systemctl
>/dev
/null
2>&1 ; then
98 echo "
---------------------------------------------"
101 echo "This package needs xinetd to be installed. "
102 echo "Currently you
do not have installed xinetd. "
103 echo "Please
install and start xinetd or
install "
104 echo "and setup another inetd manually."
106 echo "It's also possible to monitor via SSH without "
108 echo "
---------------------------------------------"