]> git.pld-linux.org Git - packages/nagios-nrpe.git/blob - nagios-nrpe.spec
b5e972924ed9c05253f0e71518885d6067a75eba
[packages/nagios-nrpe.git] / nagios-nrpe.spec
1 #
2 # Conditional build:
3 #
4 Summary:        Nagios remote monitoring service/plugin
5 Summary(pl):    Demon i wtyczka zdalnego monitorowania Nagios
6 Name:           nrpe
7 Version:        2.0
8 Release:        1
9 License:        GPL v2
10 Group:          Networking
11 Source0:        http://dl.sourceforge.net/nagios/nrpe-%{version}.tar.gz
12 Source1:        %{name}.init
13 URL:            http://www.nagios.org/
14 BuildRequires:  autoconf
15 BuildRequires:  automake
16 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
17 Requires(pre):  /usr/bin/getgid
18 Requires(pre):  /bin/id
19 Requires(pre):  /usr/sbin/groupadd
20 Requires(pre):  /usr/sbin/useradd
21 Requires(post,postun):  /sbin/chkconfig
22 Requires:       nagios-plugins
23
24 %define         _sysconfdir     /etc/nagios
25 %define         _datadir        %{_prefix}/share/%{name}
26 %define         _plugindir      %{_libdir}/nagios/plugins
27 %define         _localstatedir  %{_var}/log/nagios
28 %define         nsusr           nagios
29 %define         nsgrp           nagios
30 %define         nsport          5666
31
32 %description
33 Nagios is a program that will monitor hosts and services on your
34 network. It has the ability to email or page you when a problem arises
35 and when a problem is resolved. Nagios is written in C and is designed
36 to run under Linux (and some other *NIX variants) as a background
37 process, intermittently running checks on various services that you
38 specify.
39
40 The actual service checks are performed by separate "plugin" programs
41 which return the status of the checks to Nagios. The plugins are
42 available in nagios-plugins packages.
43
44 Nagios is successor to NetSaint.
45
46 %description -l pl
47 Nagios to program, który monitoruje serwery oraz us³ugi w naszej
48 sieci. Posiada on mo¿liwo¶æ wysy³ania informacji o wyst±pieniu oraz
49 rozwi±zaniu problemu. Nagios zosta³ napisany w C oraz jest
50 zaprojektowany do pracy pod Linuksem (i niektórymi innymi uniksami)
51 jako proces pracuj±cy w tle i bezustannie wykonuj±cy pewne operacje
52 sprawdzaj±ce.
53
54 W³a¶ciwe sprawdzanie jest wykonywane przez osobne programy
55 ("wtyczki"), które zwracaj± informacje o statusie do Nagiosa. Wtyczki
56 s± dostêpne na stronie w pakietach nagios-plugins.
57
58 Nagios jest nastêpc± NetSainta.
59
60 %package plugin
61 Summary:        check_nrpe plugin for Nagios
62 Summary(pl):    Wtyczka check_nrpe dla Nagiosa
63 Group:          Networking
64
65 %description plugin
66 check_nrpe plugin for Nagios. This plugin allows running plugins on
67 remote machines using nrpe service.
68
69 %description plugin -l pl
70 Wtyczka check_nrpe dla Nagiosa. Pozwala na zdalne uruchamianie
71 wtyczek na innych komputerach za pomoc± demona nrpe.
72
73 %prep
74 %setup -q
75
76 %build
77 %{__aclocal}
78 %{__autoconf}
79
80 %configure \
81         --with-init-dir=/etc/rc.d/init.d \
82         --with-nrpe-port=%{nsport} \
83         --with-nrpe-user=%{nsusr} \
84         --with-nrpe-grp=%{nsgrp} \
85         --prefix=%{_prefix} \
86         --exec-prefix=%{_sbindir} \
87         --bindir=%{_sbindir} \
88         --libexecdir=%{_plugindir} \
89         --datadir=%{_prefix}/share/nagios \
90         --sysconfdir=%{_sysconfdir} \
91         --localstatedir=%{_localstatedir} 
92
93 %{__make} all
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir},%{_libdir}/nagios/plugins,%{_sbindir}} \
98         $RPM_BUILD_ROOT%{_localstatedir}
99
100 install nrpe.cfg $RPM_BUILD_ROOT/etc/nagios/nrpe.cfg
101 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
102 install src/nrpe $RPM_BUILD_ROOT%{_sbindir}
103 install src/check_nrpe $RPM_BUILD_ROOT%{_plugindir}
104
105 %clean
106 rm -rf $RPM_BUILD_ROOT
107
108 %pre
109 if [ -n "`getgid %{nsgrp}`" ]; then
110        if [ "`getgid %{nsgrp}`" != "72" ]; then
111                echo "Error: group %{nsgrp} doesn't have gid=72. Correct this before installing %{name}." 1>&2
112                exit 1
113        fi
114 else
115        /usr/sbin/groupadd -g 72 -f %{nsgrp}
116 fi
117 if [ -n "`id -u %{nsusr} 2>/dev/null`" ]; then
118        if [ "`id -u %{nsusr}`" != "72" ]; then
119                echo "Error: user %{nsusr} doesn't have uid=72. Correct this before installing %{name}." 1>&2
120                exit 1
121        fi
122 else
123        /usr/sbin/useradd -u 72 -d %{_libdir}/%{name} -s /bin/false -c "%{name} User" -g %{nsgrp} %{nsusr} 1>&2
124 fi
125
126 %post
127 /sbin/chkconfig --add %{name}
128 if [ -f /var/lock/subsys/%{name} ]; then
129         /etc/rc.d/init.d/%{name} restart 1>&2
130 fi
131
132 %preun
133 if [ "$1" = "0" ] ; then
134         if [ -f /var/lock/subsys/%{name} ]; then
135                 /etc/rc.d/init.d/%{name} stop 1>&2
136         fi
137         /sbin/chkconfig --del %{name}
138 fi
139
140 %postun
141 if [ "$1" = "0" ]; then
142        /usr/sbin/userdel %{nsusr}
143        /usr/sbin/groupdel %{nsgrp}
144 fi
145
146 %files
147 %defattr(644,root,root,755)
148 %doc Changelog LEGAL README* SECURITY
149 %attr(754,root,root) /etc/rc.d/init.d/%{name}
150 %attr(751,root,%{nsgrp}) %dir %{_sysconfdir}
151 %attr(644,root,%{nsgrp}) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/nrpe.cfg
152 %attr(755,root,root) %{_sbindir}/nrpe
153
154 %files plugin
155 %defattr(644,root,root,755)
156 %dir %{_plugindir}
157 %attr(755,root,root) %{_plugindir}/*
This page took 0.058962 seconds and 3 git commands to generate.